From ba8f102266f11376bb503e5f433a373f629a0386 Mon Sep 17 00:00:00 2001 From: Chad Woolley Date: Thu, 11 Sep 2025 23:13:37 -0700 Subject: [PATCH 1/4] Upgrade to Chrome 138 for CI --- .gitlab/ci/version.yml | 2 +- qa/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/version.yml b/.gitlab/ci/version.yml index 21f326d5885a87..a1b1d09d0c77de 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 -- GitLab From 9108477a59a2140e5df070522d14e0d9b57873b2 Mon Sep 17 00:00:00 2001 From: Jay McCure Date: Wed, 17 Sep 2025 10:24:17 +1000 Subject: [PATCH 2/4] E2E test: fix E2E tests for chrome 138 --- qa/qa/page/base.rb | 3 +++ .../integrations/jenkins/jenkins_build_status_spec.rb | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 153a55dfcb530a..2ec787dd4b8c95 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -571,6 +571,9 @@ def feature_flag_controlled_element( def wait_for_gitlab_to_respond wait_until(sleep_interval: 5, message: '502 - GitLab is taking too much time to respond') do Capybara.page.has_no_text?(/GitLab is taking too much time to respond|Waiting for GitLab to boot/) + rescue Capybara::ElementNotFound + # In Chrome 138 we occasionally get `Unable to find xpath "/html"` + false end end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb index 9e0047fbbee3d5..967662dadf430b 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb @@ -40,7 +40,11 @@ module QA testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347788' do setup_project_integration - jenkins_integration = project.find_integration('jenkins') + jenkins_integration = nil + Support::Waiter.wait_until(max_duration: 10, sleep_interval: 1) do + jenkins_integration = project.find_integration('jenkins') + end + expect(jenkins_integration).not_to be_nil, 'Jenkins integration did not save' expect(jenkins_integration[:active]).to be(true), 'Jenkins integration is not active' -- GitLab From 5df2b35843f19f35232fa74ad3f1cf2206b19e08 Mon Sep 17 00:00:00 2001 From: Jay McCure Date: Wed, 17 Sep 2025 11:06:57 +1000 Subject: [PATCH 3/4] Feature/specs: make more robust with Chrome 138 --- ee/spec/features/admin/admin_settings_spec.rb | 47 +++++++++++++++---- .../features/groups/saml_providers_spec.rb | 4 ++ ee/spec/features/projects/mirror_spec.rb | 23 +++++++-- .../ee/repository_mirrors_settings_spec.rb | 28 ++++++++--- spec/features/admin/users/users_spec.rb | 12 +++++ spec/features/dashboard/group_spec.rb | 4 ++ spec/features/groups_spec.rb | 10 +++- .../settings/merge_requests_settings_spec.rb | 18 +++++-- .../settings/repository_settings_spec.rb | 16 ++----- ...er_manages_merge_requests_settings_spec.rb | 18 +++++-- .../projects/user_creates_project_spec.rb | 21 ++++++++- .../snippets/user_creates_snippet_spec.rb | 5 +- spec/features/users/login_spec.rb | 12 +++-- .../detail/work_item_detail_spec.rb | 32 ++++++------- .../rolledup_dates_shared_examples.rb | 2 + 15 files changed, 186 insertions(+), 66 deletions(-) diff --git a/ee/spec/features/admin/admin_settings_spec.rb b/ee/spec/features/admin/admin_settings_spec.rb index d451d30d8e00d3..ba6e3e565e2320 100644 --- a/ee/spec/features/admin/admin_settings_spec.rb +++ b/ee/spec/features/admin/admin_settings_spec.rb @@ -101,6 +101,10 @@ click_button 'Save changes' end + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + aggregate_failures do expect(current_settings.elasticsearch_indexing).to be_truthy expect(current_settings.elasticsearch_search).to be_truthy @@ -123,7 +127,6 @@ expect(current_settings.elasticsearch_max_bulk_size_mb).to eq(17) expect(current_settings.elasticsearch_max_bulk_concurrency).to eq(23) expect(current_settings.elasticsearch_client_request_timeout).to eq(30) - expect(page).to have_content 'Application settings saved successfully' end end @@ -155,6 +158,10 @@ click_button 'Save changes' end + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + expect(current_settings.elasticsearch_limit_indexing).to be_truthy expect(ElasticsearchIndexedNamespace.exists?(namespace_id: namespace.id)).to be_truthy expect(ElasticsearchIndexedProject.exists?(project_id: project.id)).to be_truthy @@ -186,9 +193,12 @@ click_button 'Save changes' end + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + expect(ElasticsearchIndexedNamespace.count).to eq(0) expect(ElasticsearchIndexedProject.count).to eq(0) - expect(page).to have_content 'Application settings saved successfully' end it 'zero-downtime reindexing shows popup', :js do @@ -278,7 +288,10 @@ click_button _('Save changes') end - expect(page).to have_content _('Application settings saved successfully') + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + expect(find('#application_setting_disable_personal_access_tokens')).not_to be_checked expect(current_settings.disable_personal_access_tokens).to be(false) end @@ -301,7 +314,10 @@ click_button _('Save changes') end - expect(page).to have_content _('Application settings saved successfully') + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + expect(current_settings.disable_personal_access_tokens).to be(false) end end @@ -405,9 +421,13 @@ fill_in 'application_setting[new_user_signups_cap]', with: 5 click_button 'Save changes' - - expect(current_settings.new_user_signups_cap).to eq(5) end + + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + + expect(current_settings.new_user_signups_cap).to eq(5) end context 'with a user cap assigned' do @@ -425,9 +445,13 @@ find_by_testid("seat-control-open-access").click click_button 'Save changes' - - expect(current_settings.new_user_signups_cap).to be_nil end + + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + + expect(current_settings.new_user_signups_cap).to be_nil end context 'with pending users' do @@ -634,6 +658,10 @@ click_button _('Save changes') end + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + expect(page).to have_field(s_('GitAbuse|Number of repositories'), with: 5) expect(page).to have_field(s_('GitAbuse|Reporting time period (seconds)'), with: 300) expect(page).to have_content(user.name) @@ -724,7 +752,10 @@ click_button 'Save changes' + # Waiting for page to load to ensure changes are saved in the backend expect(page).to have_content 'Application settings saved successfully' + wait_for_requests + expect(page).to have_field 'Cost factor for forks of projects', with: '0.008' end diff --git a/ee/spec/features/groups/saml_providers_spec.rb b/ee/spec/features/groups/saml_providers_spec.rb index 2ebbc6c9a0c415..8b43ba9af3987d 100644 --- a/ee/spec/features/groups/saml_providers_spec.rb +++ b/ee/spec/features/groups/saml_providers_spec.rb @@ -22,6 +22,10 @@ def submit page.within('.saml_provider') do click_button('Save changes') end + + # wait for button press to trigger a page reload, without this test will progress immediately + sleep 1 + wait_for_requests end def test_sso diff --git a/ee/spec/features/projects/mirror_spec.rb b/ee/spec/features/projects/mirror_spec.rb index ff72a0279703ca..45a52bd8872a87 100644 --- a/ee/spec/features/projects/mirror_spec.rb +++ b/ee/spec/features/projects/mirror_spec.rb @@ -58,7 +58,12 @@ end Sidekiq::Testing.fake! do - expect { find('.js-force-update-mirror').click } + expect do + find('.js-force-update-mirror').click + + # wait for UI message to ensure job is created + expect(page).to have_content('repository is being updated') + end .to change { UpdateAllMirrorsWorker.jobs.size } .by(1) end @@ -125,13 +130,15 @@ def add_mirror fill_in 'Password', with: password click_without_sidekiq 'Mirror repository' end + + # Waiting for page to load to ensure changes to mirror saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests end it 'can be set up' do add_mirror - expect(page).to have_content('Mirroring settings were successfully updated') - project.reload expect(project.mirror?).to be_truthy expect(import_data.auth_method).to eq('password') @@ -144,8 +151,6 @@ def add_mirror it 'will be ignored' do add_mirror - expect(page).to have_content('Mirroring settings were successfully updated') - project.reload expect(project.mirror?).to be_truthy expect(import_data.auth_method).to eq('password') @@ -281,6 +286,10 @@ def add_mirror click_without_sidekiq 'Mirror repository' end + + # Waiting for page to load to ensure changes to mirror saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests project.reload expect(page).to have_content('Mirroring settings were successfully updated') @@ -305,6 +314,10 @@ def add_mirror click_without_sidekiq 'Mirror repository' end + + # Waiting for page to load to ensure changes to mirror saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests project.reload expect(project.username_only_import_url).to eq('ssh://example.com') expect(import_data.auth_method).to eq('ssh_public_key') diff --git a/ee/spec/features/projects/settings/ee/repository_mirrors_settings_spec.rb b/ee/spec/features/projects/settings/ee/repository_mirrors_settings_spec.rb index cd56796ba512e7..a856c7633facf0 100644 --- a/ee/spec/features/projects/settings/ee/repository_mirrors_settings_spec.rb +++ b/ee/spec/features/projects/settings/ee/repository_mirrors_settings_spec.rb @@ -137,9 +137,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(project.remote_mirrors.first.only_protected_branches).to eq(false) expect(project.remote_mirrors.first.mirror_branch_regex).to be_nil end @@ -156,9 +158,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(project.remote_mirrors.first.only_protected_branches).to eq(true) end @@ -175,9 +179,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(project.remote_mirrors.first.only_protected_branches).to be_falsey expect(project.remote_mirrors.first.mirror_branch_regex).to eq('text') end @@ -203,9 +209,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(project.mirror_branches_setting).to eq('all') expect(project.mirror_branch_regex).to be_nil end @@ -222,9 +230,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(project.only_mirror_protected_branches).to eq(true) end @@ -241,9 +251,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(page).to have_css('.badge[title="text"]', text: 'Specific branches') expect(project.mirror_branches_setting).to eq('regex') expect(project.mirror_branch_regex).to eq('text') @@ -263,9 +275,11 @@ click_button 'Mirror repository' end + # Ensure changes have been saved to the database before reloading + expect(page).to have_content('Mirroring settings were successfully updated') + wait_for_requests project.reload - expect(page).to have_content('Mirroring settings were successfully updated') expect(project.mirror_branches_setting).to eq('all') expect(project.mirror_branch_regex).to be_nil expect(project.only_mirror_protected_branches).to be_falsey diff --git a/spec/features/admin/users/users_spec.rb b/spec/features/admin/users/users_spec.rb index 16277a794c8126..36d50032fa0232 100644 --- a/spec/features/admin/users/users_spec.rb +++ b/spec/features/admin/users/users_spec.rb @@ -642,6 +642,10 @@ def check_breadcrumb(content) it 'shows page with new data' do click_button 'Save changes' + # Wait for UI element and wait for requests otherwise test will proceed immediately to assertion + expect(page).to have_content 'successfully updated' + wait_for_requests + expect(page).to have_content('bigbang@mail.com') expect(page).to have_content('Big Bang') end @@ -649,6 +653,10 @@ def check_breadcrumb(content) it 'changes user entry' do click_button 'Save changes' + # Wait for UI element and wait for requests otherwise test will proceed immediately to assertion + expect(page).to have_content 'successfully updated' + wait_for_requests + user.reload expect(user.name).to eq('Big Bang') expect(user.admin?).to be_truthy @@ -667,6 +675,10 @@ def check_breadcrumb(content) end click_button 'Save changes' + + # Wait for UI element and wait for requests otherwise test will proceed immediately to assertion + expect(page).to have_content 'successfully updated' + wait_for_requests end.to change { organization_user.reload.access_level }.from('default').to('owner') end end diff --git a/spec/features/dashboard/group_spec.rb b/spec/features/dashboard/group_spec.rb index 4ab30411b21dcd..24bdd07f2435dd 100644 --- a/spec/features/dashboard/group_spec.rb +++ b/spec/features/dashboard/group_spec.rb @@ -47,6 +47,10 @@ fill_in 'group_name', with: new_name click_button 'Create group' + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'successfully created' + wait_for_requests + expect(page).to have_current_path group_path(Group.find_by(name: new_name)), ignore_query: true expect(page).to have_content(new_name) end diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 95454706ac35d0..9600e8e1d334e8 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -29,6 +29,10 @@ find("input[name='group[visibility_level]'][value='#{Gitlab::VisibilityLevel::PUBLIC}']").click click_button 'Create group' + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content 'successfully created' + wait_for_requests + group = Group.find_by(name: 'test-group') expect(group.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC) @@ -201,9 +205,11 @@ find("input[name='group[visibility_level]'][value='#{Gitlab::VisibilityLevel::PUBLIC}']").click click_button 'Create group' - group = Group.find_by(name: 'with-default-active-integration') - + # Waiting for page to load to ensure changes are saved in the backend expect(page).to have_content("Group with-default-active-integration was successfully created.") + wait_for_requests + + group = Group.find_by(name: 'with-default-active-integration') visit(group_settings_integrations_path(group)) diff --git a/spec/features/projects/settings/merge_requests_settings_spec.rb b/spec/features/projects/settings/merge_requests_settings_spec.rb index 8ab894db126f2e..d35e97f569d085 100644 --- a/spec/features/projects/settings/merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/merge_requests_settings_spec.rb @@ -61,7 +61,11 @@ end end - find_by_testid('project-features-save-button').send_keys(:return) + find_by_testid('project-features-save-button').click + + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests visit project_settings_merge_requests_path(project) @@ -88,7 +92,11 @@ end end - find_by_testid('project-features-save-button').send_keys(:return) + find_by_testid('project-features-save-button').click + + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests visit project_settings_merge_requests_path(project) @@ -122,7 +130,11 @@ end end - find_by_testid('project-features-save-button').send_keys(:return) + find_by_testid('project-features-save-button').click + + # Waiting for page to load to ensure changes are saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests visit project_settings_merge_requests_path(project) diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index d0372bc7603ba9..9f27a3ab9bab85 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -229,12 +229,8 @@ click_button 'Mirror repository' end - # TODO: The following line is skipped because a toast with - # "An error occurred while loading branch rules. Please try again." - # shows up right after which hides the below message. It is causing flakiness. - # https://gitlab.com/gitlab-org/gitlab/-/issues/383717#note_1185091998 - - # expect(page).to have_content('Mirroring settings were successfully updated') + # Waiting for page to load to ensure mirror changes are saved in the backend + expect(page).to have_content('Mirroring settings were successfully updated') expect(project.reload.remote_mirrors.first.keep_divergent_refs).to eq(true) end @@ -249,12 +245,8 @@ click_button 'Mirror repository' end - # TODO: The following line is skipped because a toast with - # "An error occurred while loading branch rules. Please try again." - # shows up right after which hides the below message. It is causing flakiness. - # https://gitlab.com/gitlab-org/gitlab/-/issues/383717#note_1185091998 - - # expect(page).to have_content('Mirroring settings were successfully updated') + # Waiting for page to load to ensure mirror changes are saved in the backend + expect(page).to have_content('Mirroring settings were successfully updated') expect(page).to have_selector('[title="Copy SSH public key"]') end diff --git a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb index 4c98aace2d8fe0..490e8025d2943c 100644 --- a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb @@ -55,7 +55,11 @@ visit edit_project_path(project) find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click - find_by_testid('project-features-save-button').send_keys(:return) + find_by_testid('project-features-save-button').click + + # Waiting for page to load to ensure MR settings are saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests visit project_settings_merge_requests_path(project) @@ -76,7 +80,11 @@ visit edit_project_path(project) find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .gl-toggle').click - find_by_testid('project-features-save-button').send_keys(:return) + find_by_testid('project-features-save-button').click + + # Waiting for page to load to ensure MR settings are saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests visit project_settings_merge_requests_path(project) @@ -100,9 +108,13 @@ within('.sharing-permissions-form') do find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click - find_by_testid('project-features-save-button').send_keys(:return) + find_by_testid('project-features-save-button').click end + # Waiting for page to load to ensure MR settings are saved in the backend + expect(page).to have_content('successfully updated') + wait_for_requests + visit project_settings_merge_requests_path(project) expect(page).to have_content 'Pipelines must succeed' diff --git a/spec/features/projects/user_creates_project_spec.rb b/spec/features/projects/user_creates_project_spec.rb index d9af43dcf5396f..4e35a3dbe8f7fc 100644 --- a/spec/features/projects/user_creates_project_spec.rb +++ b/spec/features/projects/user_creates_project_spec.rb @@ -29,6 +29,10 @@ click_button('Create project') end + # Waiting for page to load to project is created in the backend + expect(page).to have_content("successfully created") + wait_for_requests + project = Project.last expect(page).to have_current_path(project_path(project), ignore_query: true) @@ -56,6 +60,10 @@ click_button('Create project') end + # Waiting for page to load to project is created in the backend + expect(page).to have_content("successfully created") + wait_for_requests + project = Project.last expect(page).to have_current_path(project_path(project), ignore_query: true) @@ -86,6 +94,10 @@ click_button('Create project') end + # Waiting for page to load to project is created in the backend + expect(page).to have_content("successfully created") + wait_for_requests + project = Project.last expect(page).to have_current_path(project_path(project), ignore_query: true) @@ -127,7 +139,9 @@ click_button('Create project') + # Waiting for page to load to project is created in the backend expect(page).to have_content("Project 'A Subgroup Project' was successfully created") + wait_for_requests project = Project.last @@ -156,7 +170,9 @@ click_button('Create project') end + # Waiting for page to load to project is created in the backend expect(page).to have_content("Project 'a-new-project' was successfully created") + wait_for_requests project = Project.find_by(name: 'a-new-project') expect(project.namespace).to eq(group) @@ -182,10 +198,13 @@ click_button('Create project') end + # Waiting for page to load to project is created in the backend + expect(page).to have_content("Project 'With Default Integration' was successfully created") + wait_for_requests + project = Project.last expect(page).to have_current_path(project_path(project), ignore_query: true) - expect(page).to have_content("Project 'With Default Integration' was successfully created") visit(project_settings_integrations_path(project)) diff --git a/spec/features/snippets/user_creates_snippet_spec.rb b/spec/features/snippets/user_creates_snippet_spec.rb index e49b4707e2ed86..6d151015967674 100644 --- a/spec/features/snippets/user_creates_snippet_spec.rb +++ b/spec/features/snippets/user_creates_snippet_spec.rb @@ -144,11 +144,8 @@ def fill_form # Adds a cache buster for checking if the image exists as Selenium is now handling the cached requests # 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/features/users/login_spec.rb b/spec/features/users/login_spec.rb index c962ef3aa7b91e..cd661354c45f84 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -216,6 +216,8 @@ def enter_code(code, only_two_factor_webauthn_enabled: false) fill_in _('Enter verification code'), with: code click_button _('Verify code') + # In Chrome 138, without this sleep the test immediately proceeds and fails the assertions + sleep 2 end shared_examples_for 'can login with recovery codes' do |only_two_factor_webauthn_enabled: false| @@ -315,9 +317,10 @@ def enter_code(code, only_two_factor_webauthn_enabled: false) expect_single_session_with_authenticated_ttl end - it 'does not allow sign-in if the user password is updated before entering a one-time code' do + # Quarantined with Chrome 138 + it 'does not allow sign-in if the user password is updated before entering a one-time code', + quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/569358' do user.update!(password: User.random_password) - enter_code(user.current_otp) expect(page).to have_content('An error occurred. Please sign in again.') @@ -336,9 +339,7 @@ def enter_code(code, only_two_factor_webauthn_enabled: false) end it 'persists remember_me value via hidden field' do - field = first('input#user_remember_me', visible: false) - - expect(field.value).to eq '1' + expect(page).to have_field('user_remember_me', type: :hidden, with: '1') end it 'blocks login with invalid code' do @@ -467,6 +468,7 @@ def enter_code(code, only_two_factor_webauthn_enabled: false) def sign_in_using_saml! gitlab_sign_in_via('saml', user, 'my-uid', mock_saml_response) + sleep 2 end end end diff --git a/spec/features/work_items/detail/work_item_detail_spec.rb b/spec/features/work_items/detail/work_item_detail_spec.rb index 4cc967c5524162..ece1fbcb092cfe 100644 --- a/spec/features/work_items/detail/work_item_detail_spec.rb +++ b/spec/features/work_items/detail/work_item_detail_spec.rb @@ -8,17 +8,17 @@ let_it_be_with_refind(:user) { create(:user) } let_it_be_with_refind(:user2) { create(:user, name: 'John') } - let_it_be(:group) { create(:group) } - let_it_be(:project) { create(:project, :public, :repository, group: group) } - let_it_be(:label) { create(:label, project: project, title: "testing-label") } - let_it_be(:label2) { create(:label, project: project, title: "another-label") } - let_it_be(:work_item) { create(:work_item, project: project, labels: [label]) } - let_it_be(:task) { create(:work_item, :task, project: project) } - let_it_be(:emoji_upvote) { create(:award_emoji, :upvote, awardable: work_item, user: user2) } - let_it_be(:milestone) { create(:milestone, project: project) } - let_it_be(:milestones) { create_list(:milestone, 10, project: project) } - let_it_be(:note) { create(:note, noteable: work_item, project: work_item.project) } - let_it_be(:contact) { create(:contact, group: group) } + let_it_be_with_refind(:group) { create(:group) } + let_it_be_with_refind(:project) { create(:project, :public, :repository, group: group) } + let_it_be_with_refind(:label) { create(:label, project: project, title: "testing-label") } + let_it_be_with_refind(:label2) { create(:label, project: project, title: "another-label") } + let_it_be_with_refind(:work_item) { create(:work_item, project: project, labels: [label]) } + let_it_be_with_refind(:task) { create(:work_item, :task, project: project) } + let_it_be_with_refind(:emoji_upvote) { create(:award_emoji, :upvote, awardable: work_item, user: user2) } + let_it_be_with_refind(:milestone) { create(:milestone, project: project) } + let_it_be_with_refind(:milestones) { create_list(:milestone, 10, project: project) } + let_it_be_with_refind(:note) { create(:note, noteable: work_item, project: work_item.project) } + let_it_be_with_refind(:contact) { create(:contact, group: group) } let(:contact_name) { "#{contact.first_name} #{contact.last_name}" } let(:list_path) { project_issues_path(project) } let(:work_items_path) { project_work_item_path(project, work_item.iid) } @@ -97,10 +97,10 @@ end context 'for signed in admin' do - let_it_be(:admin) { create(:admin) } + let_it_be_with_refind(:admin) { create(:admin) } context 'with akismet integration' do - let_it_be(:user_agent_detail) { create(:user_agent_detail, subject: work_item) } + let_it_be_with_refind(:user_agent_detail) { create(:user_agent_detail, subject: work_item) } before_all do project.add_maintainer(admin) @@ -135,8 +135,8 @@ end context 'for work item authored by guest user' do - let_it_be(:key_result) { create(:work_item, :key_result, author: user, project: project) } - let_it_be(:note) { create(:note, noteable: key_result, project: key_result.project) } + let_it_be_with_refind(:key_result) { create(:work_item, :key_result, author: user, project: project) } + let_it_be_with_refind(:note) { create(:note, noteable: key_result, project: key_result.project) } before do sign_in(user) @@ -181,7 +181,7 @@ end context 'for development widget' do - let_it_be(:merge_request) do + let_it_be_with_refind(:merge_request) do create( :merge_request, source_project: project, diff --git a/spec/support/shared_examples/features/work_items/rolledup_dates_shared_examples.rb b/spec/support/shared_examples/features/work_items/rolledup_dates_shared_examples.rb index aadb7fc84513d3..483d11d314f31c 100644 --- a/spec/support/shared_examples/features/work_items/rolledup_dates_shared_examples.rb +++ b/spec/support/shared_examples/features/work_items/rolledup_dates_shared_examples.rb @@ -58,6 +58,8 @@ def update_child_date(title:, start_date:, due_date:) fill_in 'Start', with: "" fill_in 'Start', with: start_date fill_in 'Due', with: "" # ensure to reset the input first to avoid wrong date values + # In Chrome 138, we need to briefly wait otherwise due date gets overwritten + sleep 0.1 fill_in 'Due', with: due_date find_by_testid('close-icon').click -- GitLab From b116860c14f57d3da6fd377d1cca4f9d4ed77400 Mon Sep 17 00:00:00 2001 From: Jay McCure Date: Wed, 17 Sep 2025 11:07:27 +1000 Subject: [PATCH 4/4] Feature/specs: quarantine failing specs with Chrome 138 --- .../registrations/email_opt_in_registration_spec.rb | 4 +++- spec/features/issues/related_issues_spec.rb | 3 ++- .../user_sees_discussions_navigation_spec.rb | 3 ++- spec/features/users/login_spec.rb | 2 ++ .../work_items/work_items_shared_examples.rb | 13 +++++++------ 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ee/spec/features/registrations/email_opt_in_registration_spec.rb b/ee/spec/features/registrations/email_opt_in_registration_spec.rb index b7c900f351edb1..1f6c1e8e076bb1 100644 --- a/ee/spec/features/registrations/email_opt_in_registration_spec.rb +++ b/ee/spec/features/registrations/email_opt_in_registration_spec.rb @@ -2,7 +2,9 @@ require 'spec_helper' -RSpec.describe 'Registration with the email opt in value', :js, :saas_registration, :with_current_organization, feature_category: :onboarding do +# Spec quarantined with Chrome 138 +RSpec.describe 'Registration with the email opt in value', :js, :saas_registration, :with_current_organization, + feature_category: :onboarding, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/569358' do shared_examples 'toggles email opt-in checkbox', :with_trial_types do it 'toggles the omniauth form actions' do visit path diff --git a/spec/features/issues/related_issues_spec.rb b/spec/features/issues/related_issues_spec.rb index 9db5dcd9584d5b..0f610efe0b079f 100644 --- a/spec/features/issues/related_issues_spec.rb +++ b/spec/features/issues/related_issues_spec.rb @@ -220,7 +220,8 @@ end end - it 'pressing enter should submit the form' do + # Quarantined with Chrome 138 + it 'pressing enter should submit the form', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/569358' do within_testid('work-item-relationships') do click_button 'Add' fill_in 'Search existing items', with: issue_b.title diff --git a/spec/features/merge_request/user_sees_discussions_navigation_spec.rb b/spec/features/merge_request/user_sees_discussions_navigation_spec.rb index 401888a4538e51..9ea1cde392bb08 100644 --- a/spec/features/merge_request/user_sees_discussions_navigation_spec.rb +++ b/spec/features/merge_request/user_sees_discussions_navigation_spec.rb @@ -60,7 +60,8 @@ expect(page).to have_selector(second_discussion_selector, obscured: false) end - it 'cycles back to the first thread' do + # Quarantined with Chrome 138 + it 'cycles back to the first thread', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/569358' do goto_next_thread goto_next_thread goto_next_thread diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb index cd661354c45f84..62388a6432116e 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -468,6 +468,8 @@ def enter_code(code, only_two_factor_webauthn_enabled: false) def sign_in_using_saml! gitlab_sign_in_via('saml', user, 'my-uid', mock_saml_response) + + # In Chrome 138, without this sleep the test immediately proceeds and fails the assertions sleep 2 end end diff --git a/spec/support/shared_examples/features/work_items/work_items_shared_examples.rb b/spec/support/shared_examples/features/work_items/work_items_shared_examples.rb index a8b97e23347f3a..7ba2ee8a134fa2 100644 --- a/spec/support/shared_examples/features/work_items/work_items_shared_examples.rb +++ b/spec/support/shared_examples/features/work_items/work_items_shared_examples.rb @@ -52,7 +52,7 @@ def set_comment end context 'for work item note actions signed in user with developer role' do - let_it_be(:owner) { create(:user) } + let_it_be_with_refind(:owner) { create(:user) } before do project.add_owner(owner) @@ -301,7 +301,7 @@ def click_reply_and_enter_slash end context 'on conflict' do - let_it_be(:other_user) { create(:user) } + let_it_be_with_refind(:other_user) { create(:user) } let(:expected_warning) { 'Someone edited the description at the same time you did.' } before do @@ -624,8 +624,8 @@ def find_and_click_clear(selector, button_name = 'Clear') RSpec.shared_examples 'work items iteration' do include Features::IterationHelpers let(:work_item_iteration_selector) { '[data-testid="work-item-iteration"]' } - let_it_be(:iteration_cadence) { create(:iterations_cadence, group: group, active: true) } - let_it_be(:iteration) do + let_it_be_with_refind(:iteration_cadence) { create(:iterations_cadence, group: group, active: true) } + let_it_be_with_refind(:iteration) do create( :iteration, iterations_cadence: iteration_cadence, @@ -635,7 +635,7 @@ def find_and_click_clear(selector, button_name = 'Clear') ) end - let_it_be(:iteration2) do + let_it_be_with_refind(:iteration2) do create( :iteration, iterations_cadence: iteration_cadence, @@ -712,7 +712,8 @@ def find_and_click_clear(selector, button_name = 'Clear') expect(page).to have_button 'estimate' end - it 'adds and deletes time entries and view report', :aggregate_failures do + it 'adds and deletes time entries and view report', + quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/570667' do add_time_entry('1d', 'First summary') add_time_entry('2d', 'Second summary') -- GitLab