Skip to content

Commit

Permalink
fix(capybara): open selected browser (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnoC committed Apr 24, 2023
1 parent c43ee49 commit 311e4da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/axe-core-capybara/lib/axe-capybara.rb
Expand Up @@ -25,6 +25,6 @@ def self.configure(browser = :firefox)
private

def self.get_driver(browserSymbol)
Capybara::Selenium::Driver.new nil, :browser => browserSymbol
Capybara::Selenium::Driver.new(nil, browser: browserSymbol)
end
end
13 changes: 13 additions & 0 deletions packages/axe-core-capybara/spec/axe-capybara_spec.rb
Expand Up @@ -35,6 +35,19 @@
expect(is_chrome).to be true
end

it "defaults to firefox" do
driver = AxeCapybara.configure() do
end
browser = driver.page.options[:browser]
expect(browser).to be :firefox
end
it "sets browser correctly" do
driver = AxeCapybara.configure(:chrome) do
end
browser = driver.page.options[:browser]
expect(browser).to be :chrome
end

it "should yield configuration with specified jslib path" do
different_axe_path = "different-axe-path/axe.js"

Expand Down

0 comments on commit 311e4da

Please sign in to comment.