enable CHROME_HEADLESS environment variable for Spinach tests similar to RSpec

This commit is contained in:
Mike Greiling 2017-11-01 11:03:06 -05:00
parent 1d85dbc979
commit 3839dd0dba
No known key found for this signature in database
GPG key ID: 0303DF507FA67596

View file

@ -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
}
)