diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-21 23:21:13 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-21 23:21:13 +0300 |
commit | 285de09f36d1c33d7e052a7bd7ade2706d67fc68 (patch) | |
tree | 24788438ce4c56c0334489c9316f2456685e02b3 /spec/support | |
parent | 4082419442bfd7976034815508b4b1a18c52b389 (diff) | |
download | gitlab-ce-285de09f36d1c33d7e052a7bd7ade2706d67fc68.tar.gz |
add CHROME_HEADLESS environment variable to disable headless mode
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/capybara.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 3755648aaf7..71c86fac3f4 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -9,9 +9,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 } ) |