From c9449cc28488b78e0f604dcf9387235b9e39f50b Mon Sep 17 00:00:00 2001 From: Jay McCure Date: Wed, 10 Sep 2025 10:11:41 +1000 Subject: [PATCH] Tests: use chrome 138 --- .gitlab/ci/version.yml | 2 +- qa/Dockerfile | 2 +- spec/features/snippets/user_creates_snippet_spec.rb | 4 +--- spec/support/capybara.rb | 11 ++++++----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitlab/ci/version.yml b/.gitlab/ci/version.yml index 3d7ac30ab2d579..aab3b3de2c6b56 100644 --- a/.gitlab/ci/version.yml +++ b/.gitlab/ci/version.yml @@ -1,6 +1,6 @@ variables: BUILD_OS: "debian" - CHROME_VERSION: "123" + CHROME_VERSION: "138" DOCKER_VERSION: "27.4.1" EXIFTOOL_VERSION: "12.60" GCLOUD_VERSION: "413" diff --git a/qa/Dockerfile b/qa/Dockerfile index a10db24c2f0566..4a66992bddabfa 100644 --- a/qa/Dockerfile +++ b/qa/Dockerfile @@ -1,5 +1,5 @@ ARG BUILD_OS=debian -ARG CHROME_VERSION=123 +ARG CHROME_VERSION=138 ARG DOCKER_VERSION=24.0.5 ARG GCLOUD_VERSION=413 ARG GIT_VERSION=2.51 diff --git a/spec/features/snippets/user_creates_snippet_spec.rb b/spec/features/snippets/user_creates_snippet_spec.rb index e49b4707e2ed86..4245839cfd93b4 100644 --- a/spec/features/snippets/user_creates_snippet_spec.rb +++ b/spec/features/snippets/user_creates_snippet_spec.rb @@ -146,9 +146,7 @@ def fill_form # not anymore as requests when they come straight from memory cache. # accept_confirm is needed because of https://gitlab.com/gitlab-org/gitlab/-/issues/262102 reqs = inspect_requests do - visit("#{link}?ran=#{SecureRandom.base64(20)}") do - page.driver.browser.switch_to.alert.accept - end + visit("#{link}?ran=#{SecureRandom.base64(20)}") end expect(reqs.first.status_code).to eq(200) end diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 7d58a81ede1577..7135fc7e4c80b7 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -37,19 +37,20 @@ # Force the browser's scale factor to prevent inconsistencies on high-res devices options.add_argument('--force-device-scale-factor=1') - options.add_argument("window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}") + options.add_argument("--window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}") # Chrome won't work properly in a Docker container in sandbox mode - options.add_argument("no-sandbox") + options.add_argument("--no-sandbox") - options.add_argument("disable-search-engine-choice-screen") + options.add_argument("--disable-search-engine-choice-screen") # Ensure the Chrome locale is `en` so all dates are deterministic regardless of local settings options.add_preference('intl.accept_languages', 'en') unless ENV['WEBDRIVER_HEADLESS'] =~ /^(false|no|0)$/i || ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i # Run headless by default unless WEBDRIVER_HEADLESS specified - options.add_argument("headless") + options.add_argument('--headless=new') + options.add_argument('--disable-gpu') # Chrome may not run `requestAnimationFrame` callbacks when running multiple test cases in headless # mode due to background tab optimizations. We can disable some troublesome optimizations below. @@ -61,7 +62,7 @@ end # Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab/issues/4252 - options.add_argument("disable-dev-shm-usage") if ENV['CI'] || ENV['CI_SERVER'] + options.add_argument("--disable-dev-shm-usage") if ENV['CI'] || ENV['CI_SERVER'] # Set chrome default download path if ENV['DEFAULT_CHROME_DOWNLOAD_PATH'] -- GitLab