From f5ac859b9b12b782726e0934e1dac677816ce5c7 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Tue, 29 Sep 2020 00:02:18 +0200 Subject: [PATCH] The "chromeOptions" key in chrome capabilities changed to "goog:chromeOptions". But I'm rather switching to the 'option' array here for readability and alignment with Firefox options. --- spec/spec_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fe6bab9b..a68412da 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -78,12 +78,12 @@ RSpec.configure do |config| end Capybara.register_driver :chrome_headless do |app| - capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( - chromeOptions: { args: %w(headless disable-gpu window-size=1920x1080 no-sandbox) } - ) - Capybara::Selenium::Driver.new( - app, browser: :chrome, desired_capabilities: capabilities - ) + options = ::Selenium::WebDriver::Chrome::Options.new + options.args << '--window-size=1920x1080' + options.args << '--headless' + options.args << '--no-sandbox' + options.args << '--disable-gpu' + Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end Capybara.default_max_wait_time = 10 # seconds