Commit 036bf218 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch 'brodock/capybara-firefox-geckodriver' into 'master'

Enable capybara tests with Firefox (via geckodriver)

See merge request gitlab-org/gitlab!55377
parents 2c680468 7bc13815
...@@ -61,6 +61,7 @@ module DeprecationToolkitEnv ...@@ -61,6 +61,7 @@ module DeprecationToolkitEnv
batch-loader-1.4.0/lib/batch_loader/graphql.rb batch-loader-1.4.0/lib/batch_loader/graphql.rb
carrierwave-1.3.1/lib/carrierwave/sanitized_file.rb carrierwave-1.3.1/lib/carrierwave/sanitized_file.rb
activerecord-6.0.3.4/lib/active_record/relation.rb activerecord-6.0.3.4/lib/active_record/relation.rb
selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/driver.rb
] ]
end end
......
...@@ -79,8 +79,30 @@ Capybara.register_driver :chrome do |app| ...@@ -79,8 +79,30 @@ Capybara.register_driver :chrome do |app|
) )
end 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.server = :puma_via_workhorse
Capybara.javascript_driver = :chrome Capybara.javascript_driver = ENV.fetch('WEBDRIVER', :chrome).to_sym
Capybara.default_max_wait_time = timeout Capybara.default_max_wait_time = timeout
Capybara.ignore_hidden_elements = true Capybara.ignore_hidden_elements = true
Capybara.default_normalize_ws = 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