Commit 3839dd0d authored by Mike Greiling's avatar Mike Greiling

enable CHROME_HEADLESS environment variable for Spinach tests similar to RSpec

parent 1d85dbc9
...@@ -5,9 +5,12 @@ timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 60 : 30 ...@@ -5,9 +5,12 @@ timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 60 : 30
Capybara.javascript_driver = :chrome Capybara.javascript_driver = :chrome
Capybara.register_driver :chrome do |app| 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( capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { chromeOptions: {
'args' => %w[headless no-sandbox disable-gpu --window-size=1240,1400] 'args' => %w[no-sandbox disable-gpu --window-size=1240,1400] + extra_args
} }
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment