From 61b1e73fcb7c5b215ae76b2999e02c251f96f977 Mon Sep 17 00:00:00 2001 From: Minno Dang Date: Fri, 15 Dec 2023 12:36:51 +0000 Subject: [PATCH] Update options so the new chrome driver version 120 will work Within our cucumber tests, fetching logs from the driver seems to be broken with the new chrome version 119 -> 120 upgrade. This issue seems to be solved in this github issue thread by updating the options to '--headless=new' https://github.com/SeleniumHQ/selenium/issues/13112 --- lib/govuk_test.rb | 2 +- spec/govuk_test_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/govuk_test.rb b/lib/govuk_test.rb index 72903bb..3fbe3c1 100644 --- a/lib/govuk_test.rb +++ b/lib/govuk_test.rb @@ -18,7 +18,7 @@ def self.configure def self.headless_chrome_selenium_options Selenium::WebDriver::Chrome::Options.new.tap do |options| - options.add_argument("--headless") + options.add_argument("--headless=new") options.add_argument("--no-sandbox") if ENV["GOVUK_TEST_CHROME_NO_SANDBOX"] end end diff --git a/spec/govuk_test_spec.rb b/spec/govuk_test_spec.rb index 823c97a..9e4eb81 100644 --- a/spec/govuk_test_spec.rb +++ b/spec/govuk_test_spec.rb @@ -23,7 +23,7 @@ options = described_class.headless_chrome_selenium_options expect(options).to be_instance_of(Selenium::WebDriver::Chrome::Options) - expect(options.args).to include("--headless") + expect(options.args).to include("--headless=new") end it "can be configured with an environment variable to run in no-sandbox" do