Module: AxeCapybara

Defined in:
lib/axe-capybara.rb

Class Method Summary collapse

Class Method Details

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

configure method

  • which takes an optional argument browser

  • and a configuration block optional for Axe

Yields:

  • (config)


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

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

  config = Axe::Configuration.instance

  config.page = set_driver(browser)

  # await and return
  yield config
  config
end