Commit 9fd73908 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Enable capybara tests with Firefox (via geckodriver)

To run capybara with firefox, set the ENV variable:
`WEBDRIVER` to `firefox`

It will run in 'headless' mode by default unless
`WEBDRIVER_HEADLESS` is set to `false`, `no` or `0`
parent e27b7460
......@@ -79,8 +79,30 @@ Capybara.register_driver :chrome do |app|
)
end
Capybara.register_driver :firefox do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(
log: {
level: :trace
}
)
options = Selenium::WebDriver::Firefox::Options.new(log_level: :trace)
options.add_argument("--window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}")
# Run headless by default unless WEBDRIVER_HEADLESS specified
options.add_argument("--headless") unless ENV['WEBDRIVER_HEADLESS'] =~ /^(false|no|0)$/i
Capybara::Selenium::Driver.new(
app,
browser: :firefox,
desired_capabilities: capabilities,
options: options
)
end
Capybara.server = :puma_via_workhorse
Capybara.javascript_driver = :chrome
Capybara.javascript_driver = ENV.fetch('WEBDRIVER', :chrome).to_sym
Capybara.default_max_wait_time = timeout
Capybara.ignore_hidden_elements = true
Capybara.default_normalize_ws = true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment