Module: AxeSelenium

Defined in:
lib/axe-selenium.rb

Class Method Summary collapse

Class Method Details

.configure(browser = :firefox, opts = nil) {|config| ... } ⇒ Object

configure method

  • which takes an optional argument browser

  • an optional options (sic) object to configure the underlying driver

  • and a configuration block optional for Axe

Yields:

  • (config)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/axe-selenium.rb', line 9

def self.configure(browser = :firefox, opts = nil)
  # instantiate axe configuration (singleton) with defaults or given config: opts
  if !block_given?
    raise Exception.new "Please provide a configure block for AxeSelenium"
  end

  config = Axe::Configuration.instance

  # provide a selenium webdriver page object
  config.page = get_driver(browser, opts)

  # await and return
  yield config
  config
end