diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-28 12:07:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-28 12:07:06 +0300 |
commit | b9e30139939a4fe3f75faf149f641477d38d0cd9 (patch) | |
tree | 79c86b8be4a1d1f000de309ee33a04b06e09167f /spec/features | |
parent | c222aa089016e16374c92fa868c920a239278ef5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/clusters/eks_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/clusters/create_agent_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/error_tracking/user_searches_sentry_errors_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/groups/clusters/eks_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/projects/clusters/eks_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/clusters/gcp_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/projects/clusters_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/search/user_searches_for_projects_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/search/user_uses_header_search_field_spec.rb | 38 |
9 files changed, 33 insertions, 29 deletions
diff --git a/spec/features/admin/clusters/eks_spec.rb b/spec/features/admin/clusters/eks_spec.rb index 71d2bba73b1..4667f9c20a1 100644 --- a/spec/features/admin/clusters/eks_spec.rb +++ b/spec/features/admin/clusters/eks_spec.rb @@ -15,8 +15,8 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do before do visit admin_clusters_path - click_button 'Actions' - click_link 'Create a new cluster' + click_button(class: 'dropdown-toggle-split') + click_link 'Create a cluster (deprecated)' end context 'when user creates a cluster on AWS EKS' do diff --git a/spec/features/clusters/create_agent_spec.rb b/spec/features/clusters/create_agent_spec.rb index e03126d344e..db8de24e105 100644 --- a/spec/features/clusters/create_agent_spec.rb +++ b/spec/features/clusters/create_agent_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'Cluster agent registration', :js do end it 'allows the user to select an agent to install, and displays the resulting agent token' do - click_button('Actions') + click_button('Connect a cluster') expect(page).to have_content('Register') click_button('Select an agent') diff --git a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb index 89bf79ebb81..40718deed75 100644 --- a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb +++ b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb @@ -30,7 +30,7 @@ RSpec.describe 'When a user searches for Sentry errors', :js, :use_clean_rails_m expect(results.count).to be(3) end - find('.gl-form-input').set('NotFound').native.send_keys(:return) + find('.filtered-search-input-container .gl-form-input').set('NotFound').native.send_keys(:return) page.within(find('.gl-table')) do results = page.all('.table-row') diff --git a/spec/features/groups/clusters/eks_spec.rb b/spec/features/groups/clusters/eks_spec.rb index 3cca2d0919c..0e64a2faf3e 100644 --- a/spec/features/groups/clusters/eks_spec.rb +++ b/spec/features/groups/clusters/eks_spec.rb @@ -20,8 +20,8 @@ RSpec.describe 'Group AWS EKS Cluster', :js do before do visit group_clusters_path(group) - click_button 'Actions' - click_link 'Create a new cluster' + click_button(class: 'dropdown-toggle-split') + click_link 'Create a cluster (deprecated)' end context 'when user creates a cluster on AWS EKS' do diff --git a/spec/features/projects/clusters/eks_spec.rb b/spec/features/projects/clusters/eks_spec.rb index 0dd6effe551..7e599ff1198 100644 --- a/spec/features/projects/clusters/eks_spec.rb +++ b/spec/features/projects/clusters/eks_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'AWS EKS Cluster', :js do visit project_clusters_path(project) click_button(class: 'dropdown-toggle-split') - click_link 'Create a new cluster' + click_link 'Create a cluster (certificate - deprecated)' end context 'when user creates a cluster on AWS EKS' do diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb index 90d7e2d02e9..28e30a3965d 100644 --- a/spec/features/projects/clusters/gcp_spec.rb +++ b/spec/features/projects/clusters/gcp_spec.rb @@ -135,7 +135,7 @@ RSpec.describe 'Gcp Cluster', :js do visit project_clusters_path(project) click_button(class: 'dropdown-toggle-split') - click_link 'Connect with a certificate' + click_link 'Connect a cluster (certificate - deprecated)' end it 'user sees the "Environment scope" field' do @@ -220,6 +220,6 @@ RSpec.describe 'Gcp Cluster', :js do def visit_create_cluster_page click_button(class: 'dropdown-toggle-split') - click_link 'Create a new cluster' + click_link 'Create a cluster (certificate - deprecated)' end end diff --git a/spec/features/projects/clusters_spec.rb b/spec/features/projects/clusters_spec.rb index b9a544144c3..e85788217d6 100644 --- a/spec/features/projects/clusters_spec.rb +++ b/spec/features/projects/clusters_spec.rb @@ -222,11 +222,11 @@ RSpec.describe 'Clusters', :js do visit project_clusters_path(project) click_button(class: 'dropdown-toggle-split') - click_link 'Create a new cluster' + click_link 'Create a cluster (certificate - deprecated)' end def visit_connect_cluster_page click_button(class: 'dropdown-toggle-split') - click_link 'Connect with a certificate' + click_link 'Connect a cluster (certificate - deprecated)' end end diff --git a/spec/features/search/user_searches_for_projects_spec.rb b/spec/features/search/user_searches_for_projects_spec.rb index c38ad077cd0..562da56275c 100644 --- a/spec/features/search/user_searches_for_projects_spec.rb +++ b/spec/features/search/user_searches_for_projects_spec.rb @@ -8,6 +8,8 @@ RSpec.describe 'User searches for projects', :js do context 'when signed out' do context 'when block_anonymous_global_searches is disabled' do before do + allow(Gitlab::ApplicationRateLimiter).to receive(:threshold).with(:search_rate_limit).and_return(1000) + allow(Gitlab::ApplicationRateLimiter).to receive(:threshold).with(:search_rate_limit_unauthenticated).and_return(1000) stub_feature_flags(block_anonymous_global_searches: false) end diff --git a/spec/features/search/user_uses_header_search_field_spec.rb b/spec/features/search/user_uses_header_search_field_spec.rb index 8736f16b991..7350a54e8df 100644 --- a/spec/features/search/user_uses_header_search_field_spec.rb +++ b/spec/features/search/user_uses_header_search_field_spec.rb @@ -17,12 +17,15 @@ RSpec.describe 'User uses header search field', :js do end before do + allow(Gitlab::ApplicationRateLimiter).to receive(:threshold).with(:search_rate_limit).and_return(1000) + allow(Gitlab::ApplicationRateLimiter).to receive(:threshold).with(:search_rate_limit_unauthenticated).and_return(1000) sign_in(user) end shared_examples 'search field examples' do before do visit(url) + wait_for_all_requests end it 'starts searching by pressing the enter key' do @@ -37,7 +40,6 @@ RSpec.describe 'User uses header search field', :js do before do find('#search') find('body').native.send_keys('s') - wait_for_all_requests end @@ -49,6 +51,7 @@ RSpec.describe 'User uses header search field', :js do context 'when clicking the search field' do before do page.find('#search').click + wait_for_all_requests end it 'shows category search dropdown', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/250285' do @@ -59,7 +62,7 @@ RSpec.describe 'User uses header search field', :js do let!(:issue) { create(:issue, project: project, author: user, assignees: [user]) } it 'shows assigned issues' do - find('.search-input-container .dropdown-menu').click_link('Issues assigned to me') + find('[data-testid="header-search-dropdown-menu"]').click_link('Issues assigned to me') expect(page).to have_selector('.issues-list .issue') expect_tokens([assignee_token(user.name)]) @@ -67,7 +70,7 @@ RSpec.describe 'User uses header search field', :js do end it 'shows created issues' do - find('.search-input-container .dropdown-menu').click_link("Issues I've created") + find('[data-testid="header-search-dropdown-menu"]').click_link("Issues I've created") expect(page).to have_selector('.issues-list .issue') expect_tokens([author_token(user.name)]) @@ -79,7 +82,7 @@ RSpec.describe 'User uses header search field', :js do let!(:merge_request) { create(:merge_request, source_project: project, author: user, assignees: [user]) } it 'shows assigned merge requests' do - find('.search-input-container .dropdown-menu').click_link('Merge requests assigned to me') + find('[data-testid="header-search-dropdown-menu"]').click_link('Merge requests assigned to me') expect(page).to have_selector('.mr-list .merge-request') expect_tokens([assignee_token(user.name)]) @@ -87,7 +90,7 @@ RSpec.describe 'User uses header search field', :js do end it 'shows created merge requests' do - find('.search-input-container .dropdown-menu').click_link("Merge requests I've created") + find('[data-testid="header-search-dropdown-menu"]').click_link("Merge requests I've created") expect(page).to have_selector('.mr-list .merge-request') expect_tokens([author_token(user.name)]) @@ -150,10 +153,9 @@ RSpec.describe 'User uses header search field', :js do it 'displays search options' do fill_in_search('test') - - expect(page).to have_selector(scoped_search_link('test')) - expect(page).to have_selector(scoped_search_link('test', group_id: group.id)) - expect(page).to have_selector(scoped_search_link('test', project_id: project.id, group_id: group.id)) + expect(page).to have_selector(scoped_search_link('test', search_code: true)) + expect(page).to have_selector(scoped_search_link('test', group_id: group.id, search_code: true)) + expect(page).to have_selector(scoped_search_link('test', project_id: project.id, group_id: group.id, search_code: true)) end end @@ -165,10 +167,9 @@ RSpec.describe 'User uses header search field', :js do it 'displays search options' do fill_in_search('test') - - expect(page).to have_selector(scoped_search_link('test')) - expect(page).not_to have_selector(scoped_search_link('test', group_id: project.namespace_id)) - expect(page).to have_selector(scoped_search_link('test', project_id: project.id)) + expect(page).to have_selector(scoped_search_link('test', search_code: true, repository_ref: 'master')) + expect(page).not_to have_selector(scoped_search_link('test', search_code: true, group_id: project.namespace_id, repository_ref: 'master')) + expect(page).to have_selector(scoped_search_link('test', search_code: true, project_id: project.id, repository_ref: 'master')) end it 'displays a link to project merge requests' do @@ -217,7 +218,6 @@ RSpec.describe 'User uses header search field', :js do it 'displays search options' do fill_in_search('test') - expect(page).to have_selector(scoped_search_link('test')) expect(page).to have_selector(scoped_search_link('test', group_id: group.id)) expect(page).not_to have_selector(scoped_search_link('test', project_id: project.id)) @@ -248,18 +248,20 @@ RSpec.describe 'User uses header search field', :js do end end - def scoped_search_link(term, project_id: nil, group_id: nil) + def scoped_search_link(term, project_id: nil, group_id: nil, search_code: nil, repository_ref: nil) # search_path will accept group_id and project_id but the order does not match # what is expected in the href, so the variable must be built manually href = search_path(search: term) + href.concat("&nav_source=navbar") href.concat("&project_id=#{project_id}") if project_id href.concat("&group_id=#{group_id}") if group_id - href.concat("&nav_source=navbar") + href.concat("&search_code=true") if search_code + href.concat("&repository_ref=#{repository_ref}") if repository_ref - ".dropdown a[href='#{href}']" + "[data-testid='header-search-dropdown-menu'] a[href='#{href}']" end def dashboard_search_options_popup_menu - "div[data-testid='dashboard-search-options']" + "[data-testid='header-search-dropdown-menu'] .header-search-dropdown-content" end end |