From 285de09f36d1c33d7e052a7bd7ade2706d67fc68 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Sat, 21 Oct 2017 23:21:13 +0300 Subject: add CHROME_HEADLESS environment variable to disable headless mode --- spec/support/capybara.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'spec/support/capybara.rb') 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 } ) -- cgit v1.2.1