diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-11-01 11:03:06 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-11-01 11:03:06 -0500 |
commit | 3839dd0dbad9cdb0063f22302ddc50c84ab8d9f2 (patch) | |
tree | a9f252aa4bf88f434433537871579c5ca9615d56 /features | |
parent | 1d85dbc979e1e5f5c6e373a64e41bfb8d5caf6fd (diff) | |
download | gitlab-ce-3839dd0dbad9cdb0063f22302ddc50c84ab8d9f2.tar.gz |
enable CHROME_HEADLESS environment variable for Spinach tests similar to RSpec
Diffstat (limited to 'features')
-rw-r--r-- | features/support/capybara.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 8628a38eaac..3c4db8b9601 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -5,9 +5,12 @@ timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 60 : 30 Capybara.javascript_driver = :chrome Capybara.register_driver :chrome do |app| + extra_args = [] + extra_args << 'headless' unless ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i + capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( chromeOptions: { - 'args' => %w[headless no-sandbox disable-gpu --window-size=1240,1400] + 'args' => %w[no-sandbox disable-gpu --window-size=1240,1400] + extra_args } ) |