Class: IntegrationTestsRails::Configuration
- Inherits:
-
Object
- Object
- IntegrationTestsRails::Configuration
- Defined in:
- lib/integration_tests_rails/configuration.rb
Overview
Configuration class for this gem to modify adjustable settings for Capybara, Cuprite and Istanbul.
Constant Summary collapse
- DEFAULT_HTML_CONTENT =
<<~HTML.squish <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="turbo-visit-control" content="reload"> <%= csrf_meta_tags %> <%= csp_meta_tag %> <!-- If there are stylesheets to include, include them here for testing. --> <!-- E.g. The line below loads a stylesheet file located in app/assets/stylesheets/app.css --> <%#= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> <!-- If there are JavaScript libraries not globally available, include them here for testing.--> <!-- E.g. The block below shows how to import a JavaScript module and attach it to the window object. --> <!-- The file is located in app/javascripts/libs/my_library.js --> <!-- <script type="module"> import MyLibrary from 'libs/my_library'; window.MyLibrary = MyLibrary; </script> --> </head> <body> <!-- Include JavaScript libraries here instead if they need to be loaded much later. --> <!-- E.g. The line below loads a JavaScript file located in app/assets/javascripts/plugins/vendor.min.js --> <%#= javascript_include_tag 'plugins/vendor.min' %> </body> </html> HTML
Instance Attribute Summary collapse
-
#auto_retry ⇒ Object
Returns the value of attribute auto_retry.
-
#backup_dir ⇒ Object
Returns the value of attribute backup_dir.
-
#chrome_url ⇒ Object
Returns the value of attribute chrome_url.
-
#coverage_path ⇒ Object
Returns the value of attribute coverage_path.
-
#experimental_features ⇒ Object
Returns the value of attribute experimental_features.
-
#headless ⇒ Object
Returns the value of attribute headless.
-
#js_coverage ⇒ Object
Returns the value of attribute js_coverage.
-
#max_server_retries ⇒ Object
Returns the value of attribute max_server_retries.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#puma_threads ⇒ Object
Returns the value of attribute puma_threads.
-
#remote ⇒ Object
Returns the value of attribute remote.
-
#retry_attempts ⇒ Object
Returns the value of attribute retry_attempts.
-
#retry_capture_exceptions ⇒ Object
Returns the value of attribute retry_capture_exceptions.
-
#retry_sleep_duration ⇒ Object
Returns the value of attribute retry_sleep_duration.
-
#server_host ⇒ Object
Returns the value of attribute server_host.
-
#server_port ⇒ Object
Returns the value of attribute server_port.
-
#source_dir ⇒ Object
Returns the value of attribute source_dir.
-
#tests_page_html ⇒ Object
Returns the value of attribute tests_page_html.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#wait_time ⇒ Object
Returns the value of attribute wait_time.
-
#window_size ⇒ Object
Returns the value of attribute window_size.
Instance Method Summary collapse
- #backup_path ⇒ Object
- #coverage_dir ⇒ Object
- #coverage_file ⇒ Object
-
#initialize ⇒ Configuration
constructor
rubocop:disable Metrics/MethodLength, Metrics/AbcSize.
- #output_path ⇒ Object
- #source_path ⇒ Object
Constructor Details
#initialize ⇒ Configuration
rubocop:disable Metrics/MethodLength, Metrics/AbcSize
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/integration_tests_rails/configuration.rb', line 45 def initialize # rubocop:disable Metrics/MethodLength, Metrics/AbcSize @auto_retry = false @backup_dir = 'tmp/js_backup' @chrome_url = nil @coverage_path = 'coverage/nyc' @experimental_features = false @headless = true @js_coverage = true @max_server_retries = 1000 @output_dir = 'tmp/instrumented_js' @puma_threads = '1:1' @remote = false @retry_attempts = 1 @retry_capture_exceptions = [ 'RSpec::Expectations::ExpectationNotMetError', 'Capybara::ElementNotFound', 'Ferrum::JavaScriptError' ] @retry_sleep_duration = 0 @server_host = '0.0.0.0' # rubocop:disable Style/IpAddresses @server_port = nil @source_dir = 'app/javascript' @tests_page_html = DEFAULT_HTML_CONTENT @timeout = 30 @verbose = false @wait_time = 5 @window_size = [1920, 1080] end |
Instance Attribute Details
#auto_retry ⇒ Object
Returns the value of attribute auto_retry.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def auto_retry @auto_retry end |
#backup_dir ⇒ Object
Returns the value of attribute backup_dir.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def backup_dir @backup_dir end |
#chrome_url ⇒ Object
Returns the value of attribute chrome_url.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def chrome_url @chrome_url end |
#coverage_path ⇒ Object
Returns the value of attribute coverage_path.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def coverage_path @coverage_path end |
#experimental_features ⇒ Object
Returns the value of attribute experimental_features.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def experimental_features @experimental_features end |
#headless ⇒ Object
Returns the value of attribute headless.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def headless @headless end |
#js_coverage ⇒ Object
Returns the value of attribute js_coverage.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def js_coverage @js_coverage end |
#max_server_retries ⇒ Object
Returns the value of attribute max_server_retries.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def max_server_retries @max_server_retries end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def output_dir @output_dir end |
#puma_threads ⇒ Object
Returns the value of attribute puma_threads.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def puma_threads @puma_threads end |
#remote ⇒ Object
Returns the value of attribute remote.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def remote @remote end |
#retry_attempts ⇒ Object
Returns the value of attribute retry_attempts.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def retry_attempts @retry_attempts end |
#retry_capture_exceptions ⇒ Object
Returns the value of attribute retry_capture_exceptions.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def retry_capture_exceptions @retry_capture_exceptions end |
#retry_sleep_duration ⇒ Object
Returns the value of attribute retry_sleep_duration.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def retry_sleep_duration @retry_sleep_duration end |
#server_host ⇒ Object
Returns the value of attribute server_host.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def server_host @server_host end |
#server_port ⇒ Object
Returns the value of attribute server_port.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def server_port @server_port end |
#source_dir ⇒ Object
Returns the value of attribute source_dir.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def source_dir @source_dir end |
#tests_page_html ⇒ Object
Returns the value of attribute tests_page_html.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def tests_page_html @tests_page_html end |
#timeout ⇒ Object
Returns the value of attribute timeout.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def timeout @timeout end |
#verbose ⇒ Object
Returns the value of attribute verbose.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def verbose @verbose end |
#wait_time ⇒ Object
Returns the value of attribute wait_time.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def wait_time @wait_time end |
#window_size ⇒ Object
Returns the value of attribute window_size.
40 41 42 |
# File 'lib/integration_tests_rails/configuration.rb', line 40 def window_size @window_size end |
Instance Method Details
#backup_path ⇒ Object
82 83 84 |
# File 'lib/integration_tests_rails/configuration.rb', line 82 def backup_path Rails.root.join(backup_dir) end |
#coverage_dir ⇒ Object
86 87 88 |
# File 'lib/integration_tests_rails/configuration.rb', line 86 def coverage_dir Rails.root.join(coverage_path) end |
#coverage_file ⇒ Object
90 91 92 |
# File 'lib/integration_tests_rails/configuration.rb', line 90 def coverage_file coverage_dir.join('coverage.json') end |
#output_path ⇒ Object
78 79 80 |
# File 'lib/integration_tests_rails/configuration.rb', line 78 def output_path Rails.root.join(output_dir) end |
#source_path ⇒ Object
74 75 76 |
# File 'lib/integration_tests_rails/configuration.rb', line 74 def source_path Rails.root.join(source_dir) end |