enable CHROME_HEADLESS environment variable for Spinach tests similar to RSpec
This commit is contained in:
parent
1d85dbc979
commit
3839dd0dba
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue