diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-23 00:10:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-23 00:10:39 +0300 |
commit | 6c68583a42998b0bb15971785f372197bfc55cd7 (patch) | |
tree | 1299dcd6bda4cf7240f85a450fcfddb1f4053320 /qa | |
parent | e5f8220301d524167441f8fac5fd5fcf5fc31e1f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/alert/auto_devops_alert.rb | 13 | ||||
-rw-r--r-- | qa/qa/page/component/visibility_setting.rb | 8 | ||||
-rw-r--r-- | qa/qa/page/search/results.rb | 16 | ||||
-rw-r--r-- | qa/qa/page/user/show.rb | 4 | ||||
-rw-r--r-- | qa/qa/specs/features/api/10_govern/group_access_token_spec.rb | 13 | ||||
-rw-r--r-- | qa/qa/specs/features/api/10_govern/project_access_token_spec.rb | 3 | ||||
-rw-r--r-- | qa/qa/support/helpers/project.rb | 15 |
7 files changed, 36 insertions, 36 deletions
diff --git a/qa/qa/page/alert/auto_devops_alert.rb b/qa/qa/page/alert/auto_devops_alert.rb deleted file mode 100644 index 26801c4996c..00000000000 --- a/qa/qa/page/alert/auto_devops_alert.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module QA - module Page - module Alert - class AutoDevopsAlert < Page::Base - view 'app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml' do - element :auto_devops_banner_content - end - end - end - end -end diff --git a/qa/qa/page/component/visibility_setting.rb b/qa/qa/page/component/visibility_setting.rb index f07b9c1c455..3ea3ad52f10 100644 --- a/qa/qa/page/component/visibility_setting.rb +++ b/qa/qa/page/component/visibility_setting.rb @@ -6,14 +6,6 @@ module QA module VisibilitySetting extend QA::Page::PageConcern - def self.included(base) - super - - base.view 'app/views/shared/_visibility_radios.html.haml' do - element :visibility_radio, 'qa_selector: "#{visibility_level_label(level).downcase}_radio"' # rubocop:disable QA/ElementWithPattern, Lint/InterpolationCheck - end - end - def set_visibility(visibility) find('label', text: visibility.capitalize).click end diff --git a/qa/qa/page/search/results.rb b/qa/qa/page/search/results.rb index 5d856875e0b..aa0a032be01 100644 --- a/qa/qa/page/search/results.rb +++ b/qa/qa/page/search/results.rb @@ -5,9 +5,9 @@ module QA module Search class Results < QA::Page::Base view 'app/views/search/results/_blob_data.html.haml' do - element :result_item_content - element :file_title_content - element :file_text_content + element 'result-item-content' + element 'file-title-content' + element 'file-text-content' end view 'app/views/shared/projects/_project.html.haml' do @@ -23,19 +23,19 @@ module QA end def has_project_in_search_result?(project_name) - has_element?(:result_item_content, text: project_name) + has_element?('result-item-content', text: project_name) end def has_file_in_project?(file_name, project_name) - within_element(:result_item_content, text: project_name) do - has_element?(:file_title_content, text: file_name) + within_element('result-item-content', text: project_name) do + has_element?('file-title-content', text: file_name) end end def has_file_in_project_with_content?(file_text, file_path) - within_element(:result_item_content, + within_element('result-item-content', text: file_path) do - has_element?(:file_text_content, text: file_text) + has_element?('file-text-content', text: file_text) end end diff --git a/qa/qa/page/user/show.rb b/qa/qa/page/user/show.rb index aba79256340..2a73700f991 100644 --- a/qa/qa/page/user/show.rb +++ b/qa/qa/page/user/show.rb @@ -9,7 +9,7 @@ module QA end view 'app/views/shared/users/_user.html.haml' do - element :user_link + element 'user-link' end view 'app/views/users/_overview.html.haml' do @@ -25,7 +25,7 @@ module QA end def click_user_link(username) - click_element(:user_link, username: username) + click_element('user-link', username: username) end def has_activity?(activity) diff --git a/qa/qa/specs/features/api/10_govern/group_access_token_spec.rb b/qa/qa/specs/features/api/10_govern/group_access_token_spec.rb index 3e190608268..5cd78a91d14 100644 --- a/qa/qa/specs/features/api/10_govern/group_access_token_spec.rb +++ b/qa/qa/specs/features/api/10_govern/group_access_token_spec.rb @@ -6,13 +6,20 @@ module QA include QA::Support::Helpers::Project let(:group_access_token) { create(:group_access_token) } - let(:api_client) { Runtime::API::Client.new(:gitlab, personal_access_token: group_access_token.token) } + + let(:api_client_with_group_token) do + Runtime::API::Client.new(:gitlab, personal_access_token: group_access_token.token) + end + let(:project) do create(:project, name: 'project-for-group-access-token', group: group_access_token.group) end before do wait_until_project_is_ready(project) + # Associating a group access token to a project requires a job to be processed in sidekiq + # We need to be sure that this has happened or else we may get flaky test failures + wait_until_token_associated_to_project(project, api_client_with_group_token) end it( @@ -21,7 +28,7 @@ module QA ) do expect do create(:file, - api_client: api_client, + api_client: api_client_with_group_token, project: project, branch: "new_branch_#{SecureRandom.hex(8)}") rescue StandardError => e @@ -36,7 +43,7 @@ module QA ) do expect do create(:commit, - api_client: api_client, + api_client: api_client_with_group_token, project: project, branch: "new_branch_#{SecureRandom.hex(8)}", start_branch: project.default_branch, diff --git a/qa/qa/specs/features/api/10_govern/project_access_token_spec.rb b/qa/qa/specs/features/api/10_govern/project_access_token_spec.rb index 8f4a04ef389..e76160a8bb5 100644 --- a/qa/qa/specs/features/api/10_govern/project_access_token_spec.rb +++ b/qa/qa/specs/features/api/10_govern/project_access_token_spec.rb @@ -11,6 +11,9 @@ module QA before do wait_until_project_is_ready(project) + # Associating an access token to a project requires a job to be processed in sidekiq + # We need to be sure that this has happened or else we may get flaky test failures + wait_until_token_associated_to_project(project, user_api_client) end context 'for the same project' do diff --git a/qa/qa/support/helpers/project.rb b/qa/qa/support/helpers/project.rb index 8909d8338f4..85165f13fe1 100644 --- a/qa/qa/support/helpers/project.rb +++ b/qa/qa/support/helpers/project.rb @@ -6,12 +6,23 @@ module QA module Project def wait_until_project_is_ready(project) # Repository can take a short time to become ready after project is created - Support::Retrier.retry_on_exception(sleep_interval: 5) do + Support::Retrier.retry_on_exception(sleep_interval: 1, max_attempts: 60) do create(:commit, project: project, commit_message: 'Add new file', actions: [ - { action: 'create', file_path: 'new_file', content: '# This is a new file' } + { action: 'create', file_path: SecureRandom.hex(4), content: '# This is a new file' } ]) end end + + def wait_until_token_associated_to_project(project, api_client) + Support::Retrier.retry_on_exception(sleep_interval: 1, max_attempts: 60) do + create( + :commit, + project: project, + actions: [{ action: 'create', file_path: SecureRandom.hex(4) }], + api_client: api_client + ) + end + end end end end |