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 =
"<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta name=\"turbo-visit-control\" content=\"reload\">\n <%= csrf_meta_tags %>\n <%= csp_meta_tag %>\n\n <!-- If there are stylesheets to include, include them here for testing. -->\n <!-- E.g. The line below loads a stylesheet file located in app/assets/stylesheets/app.css -->\n <%#= stylesheet_link_tag :app, \"data-turbo-track\": \"reload\" %>\n\n <%= javascript_importmap_tags %>\n\n <!-- If there are JavaScript libraries not globally available, include them here for testing.-->\n <!-- E.g. The block below shows how to import a JavaScript module and attach it to the window object. -->\n <!-- The file is located in app/javascripts/libs/my_library.js -->\n <!--\n <script type=\"module\">\n import MyLibrary from 'libs/my_library';\n window.MyLibrary = MyLibrary;\n </script>\n -->\n </head>\n <body>\n <!-- Include JavaScript libraries here instead if they need to be loaded much later. -->\n <!-- E.g. The line below loads a JavaScript file located in app/assets/javascripts/plugins/vendor.min.js -->\n <%#= javascript_include_tag 'plugins/vendor.min' %>\n </body>\n</html>\n".squish
Instance Attribute Summary collapse
-
#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.
-
#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.
-
#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
A new instance of Configuration.
- #output_path ⇒ Object
- #source_path ⇒ Object
Constructor Details
#initialize ⇒ Configuration
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/integration_tests_rails/configuration.rb', line 44 def initialize @backup_dir = 'tmp/js_backup' @chrome_url = nil @coverage_path = 'coverage/nyc' @experimental_features = false @max_server_retries = 1000 @output_dir = 'tmp/instrumented_js' @puma_threads = '1:1' @remote = false @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
#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 |
#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 |
#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
71 72 73 |
# File 'lib/integration_tests_rails/configuration.rb', line 71 def backup_path Rails.root.join(backup_dir) end |
#coverage_dir ⇒ Object
75 76 77 |
# File 'lib/integration_tests_rails/configuration.rb', line 75 def coverage_dir Rails.root.join(coverage_path) end |
#coverage_file ⇒ Object
79 80 81 |
# File 'lib/integration_tests_rails/configuration.rb', line 79 def coverage_file coverage_dir.join('coverage.json') end |
#output_path ⇒ Object
67 68 69 |
# File 'lib/integration_tests_rails/configuration.rb', line 67 def output_path Rails.root.join(output_dir) end |
#source_path ⇒ Object
63 64 65 |
# File 'lib/integration_tests_rails/configuration.rb', line 63 def source_path Rails.root.join(source_dir) end |