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.



66
67
68
69
70
71
72
73
# File 'lib/e2e.rb', line 66

def initialize
  @driver = :playwright
  @browser_type = :chromium
  @headless = ENV.fetch("HEADLESS", "true") == "true"
  @app = nil
  @wait_timeout = 5
  @flash_selectors = DEFAULT_FLASH_SELECTORS.dup
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



64
65
66
# File 'lib/e2e.rb', line 64

def app
  @app
end

#browser_typeObject

Returns the value of attribute browser_type.



64
65
66
# File 'lib/e2e.rb', line 64

def browser_type
  @browser_type
end

#driverObject

Returns the value of attribute driver.



64
65
66
# File 'lib/e2e.rb', line 64

def driver
  @driver
end

#flash_selectorsObject

Returns the value of attribute flash_selectors.



64
65
66
# File 'lib/e2e.rb', line 64

def flash_selectors
  @flash_selectors
end

#headlessObject

Returns the value of attribute headless.



64
65
66
# File 'lib/e2e.rb', line 64

def headless
  @headless
end

#wait_timeoutObject

Returns the value of attribute wait_timeout.



64
65
66
# File 'lib/e2e.rb', line 64

def wait_timeout
  @wait_timeout
end