Class: E2E::Config

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/e2e.rb', line 73

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
  # :auto builds when ViteRuby is loaded; :build requires it; :warn / :skip
  @ensure_vite_assets = :auto
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



70
71
72
# File 'lib/e2e.rb', line 70

def app
  @app
end

#browser_typeObject

Returns the value of attribute browser_type.



70
71
72
# File 'lib/e2e.rb', line 70

def browser_type
  @browser_type
end

#driverObject

Returns the value of attribute driver.



70
71
72
# File 'lib/e2e.rb', line 70

def driver
  @driver
end

#ensure_vite_assetsObject

Returns the value of attribute ensure_vite_assets.



70
71
72
# File 'lib/e2e.rb', line 70

def ensure_vite_assets
  @ensure_vite_assets
end

#flash_selectorsObject

Returns the value of attribute flash_selectors.



70
71
72
# File 'lib/e2e.rb', line 70

def flash_selectors
  @flash_selectors
end

#headlessObject

Returns the value of attribute headless.



70
71
72
# File 'lib/e2e.rb', line 70

def headless
  @headless
end

Returns the value of attribute navigation_timeout.



70
71
72
# File 'lib/e2e.rb', line 70

def navigation_timeout
  @navigation_timeout
end

Returns the value of attribute navigation_wait_until.



70
71
72
# File 'lib/e2e.rb', line 70

def navigation_wait_until
  @navigation_wait_until
end

#wait_timeoutObject

Returns the value of attribute wait_timeout.



70
71
72
# File 'lib/e2e.rb', line 70

def wait_timeout
  @wait_timeout
end