diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-02 15:10:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-02 15:10:52 +0300 |
commit | 2ce2a08284a698742c24d1b50fab5f77aa5c6321 (patch) | |
tree | 962381f5cf4a6bbdcfeeef78ff35e4707720de58 /spec/support/capybara.rb | |
parent | 26a21ebddbfd2f814738a725f62750bf913796e3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r-- | spec/support/capybara.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index db198ac9808..be2b41d6997 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -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 |