Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(capybara): open browser based on passed symbol #303

Merged
merged 4 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/axe-core-capybara/lib/axe-capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def self.configure(browser = :firefox)
private

def self.get_driver(browserSymbol)
Capybara::Selenium::Driver.new(browserSymbol)
Capybara::Selenium::Driver.new nil, :browser => browserSymbol
end
end
8 changes: 8 additions & 0 deletions packages/axe-core-capybara/spec/axe-capybara_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
}.to yield_with_args(actual)
end

# Default is firefox, so we can just check that we can override the default
it "sets browser" do
driver = AxeCapybara.configure(:chrome) do
end
is_chrome = driver.page.execute_script "return !!window.chrome"
expect(is_chrome).to be true
end

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

Expand Down