Class: E2E::Config
- Inherits:
-
Object
- Object
- E2E::Config
- Defined in:
- lib/e2e.rb
Constant Summary collapse
- DEFAULT_FLASH_SELECTORS =
{ any: "[role='alert'], [role='status'], [data-flash], [data-testid*='flash'], .flash, .notice, .alert, .toast", notice: "[role='status'], [data-flash-type='notice'], [data-flash='notice'], .flash.notice, .flash-success, .notice", alert: "[role='alert'], [data-flash-type='alert'], [data-flash='alert'], .flash.alert, .flash-error, .alert" }.freeze
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#browser_type ⇒ Object
Returns the value of attribute browser_type.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#flash_selectors ⇒ Object
Returns the value of attribute flash_selectors.
-
#headless ⇒ Object
Returns the value of attribute headless.
-
#navigation_timeout ⇒ Object
Returns the value of attribute navigation_timeout.
-
#navigation_wait_until ⇒ Object
Returns the value of attribute navigation_wait_until.
-
#wait_timeout ⇒ Object
Returns the value of attribute wait_timeout.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/e2e.rb', line 72 def initialize @driver = :playwright @browser_type = :chromium @headless = ENV.fetch("HEADLESS", "true") == "true" @app = nil @wait_timeout = 5 # Full "load" waits for every subframe (YouTube/Vimeo/etc.) and can hang # navigations indefinitely when those resources never settle. @navigation_wait_until = "domcontentloaded" @navigation_timeout = 30 @flash_selectors = DEFAULT_FLASH_SELECTORS.dup end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
69 70 71 |
# File 'lib/e2e.rb', line 69 def app @app end |
#browser_type ⇒ Object
Returns the value of attribute browser_type.
69 70 71 |
# File 'lib/e2e.rb', line 69 def browser_type @browser_type end |
#driver ⇒ Object
Returns the value of attribute driver.
69 70 71 |
# File 'lib/e2e.rb', line 69 def driver @driver end |
#flash_selectors ⇒ Object
Returns the value of attribute flash_selectors.
69 70 71 |
# File 'lib/e2e.rb', line 69 def flash_selectors @flash_selectors end |
#headless ⇒ Object
Returns the value of attribute headless.
69 70 71 |
# File 'lib/e2e.rb', line 69 def headless @headless end |
#navigation_timeout ⇒ Object
Returns the value of attribute navigation_timeout.
69 70 71 |
# File 'lib/e2e.rb', line 69 def @navigation_timeout end |
#navigation_wait_until ⇒ Object
Returns the value of attribute navigation_wait_until.
69 70 71 |
# File 'lib/e2e.rb', line 69 def @navigation_wait_until end |
#wait_timeout ⇒ Object
Returns the value of attribute wait_timeout.
69 70 71 |
# File 'lib/e2e.rb', line 69 def wait_timeout @wait_timeout end |