diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 18:10:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 18:10:57 +0300 |
commit | e5c7d631a84940c66e46f1824ba7ce0c7f1d0ea4 (patch) | |
tree | ac1cce129d8c8cdcee6a668e27d8034d2da172e4 /spec/features | |
parent | 0687020509cafe1e24eb0bfa0e0f5c9f6c4799d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/clusters/create_agent_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/projects/cluster_agents_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/projects/clusters/eks_spec.rb | 1 | ||||
-rw-r--r-- | spec/features/projects/clusters/gcp_spec.rb | 14 | ||||
-rw-r--r-- | spec/features/projects/clusters/user_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/clusters_spec.rb | 22 | ||||
-rw-r--r-- | spec/features/projects/infrastructure_registry_spec.rb | 2 |
7 files changed, 30 insertions, 27 deletions
diff --git a/spec/features/clusters/create_agent_spec.rb b/spec/features/clusters/create_agent_spec.rb index a05a3c4df9e..f40932c4750 100644 --- a/spec/features/clusters/create_agent_spec.rb +++ b/spec/features/clusters/create_agent_spec.rb @@ -24,21 +24,21 @@ 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_link('GitLab Agent managed clusters') - - click_button('Connect with a GitLab Agent') + click_button('Actions') expect(page).to have_content('Install new Agent') click_button('Select an Agent') click_button('example-agent-2') - click_button('Next') + click_button('Register Agent') expect(page).to have_content('The token value will not be shown again after you close this window.') expect(page).to have_content('example-agent-token') expect(page).to have_content('docker run --pull=always --rm') - click_button('Done') + within find('.modal-footer') do + click_button('Close') + end + expect(page).to have_link('example-agent-2') - expect(page).to have_no_content('Install new Agent') end end diff --git a/spec/features/projects/cluster_agents_spec.rb b/spec/features/projects/cluster_agents_spec.rb index 4b8f635f432..98ee6ca161f 100644 --- a/spec/features/projects/cluster_agents_spec.rb +++ b/spec/features/projects/cluster_agents_spec.rb @@ -22,8 +22,6 @@ RSpec.describe 'ClusterAgents', :js do end it 'displays empty state', :aggregate_failures do - click_link 'GitLab Agent managed clusters' - expect(page).to have_content('Connect with a GitLab Agent') expect(page).to have_selector('.empty-state') end @@ -36,8 +34,6 @@ RSpec.describe 'ClusterAgents', :js do end it 'displays a table with agent', :aggregate_failures do - click_link 'GitLab Agent managed clusters' - expect(page).to have_content(agent.name) expect(page).to have_selector('[data-testid="cluster-agent-list-table"] tbody tr', count: 1) end diff --git a/spec/features/projects/clusters/eks_spec.rb b/spec/features/projects/clusters/eks_spec.rb index 3cbc71028d1..09c10c0b3a9 100644 --- a/spec/features/projects/clusters/eks_spec.rb +++ b/spec/features/projects/clusters/eks_spec.rb @@ -19,6 +19,7 @@ RSpec.describe 'AWS EKS Cluster', :js do before do visit project_clusters_path(project) + click_link 'Certificate based' click_link 'Connect with a certificate' end diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb index dec71c3c901..e1659cd2fbf 100644 --- a/spec/features/projects/clusters/gcp_spec.rb +++ b/spec/features/projects/clusters/gcp_spec.rb @@ -33,6 +33,7 @@ RSpec.describe 'Gcp Cluster', :js do before do visit project_clusters_path(project) + click_link 'Certificate based' click_link 'Connect with a certificate' click_link 'Create new cluster' click_link 'Google GKE' @@ -143,8 +144,9 @@ RSpec.describe 'Gcp Cluster', :js do before do visit project_clusters_path(project) - click_link 'Connect cluster with certificate' - click_link 'Connect existing cluster' + click_link 'Certificate based' + click_button(class: 'dropdown-toggle-split') + click_link 'Connect with certificate' end it 'user sees the "Environment scope" field' do @@ -158,6 +160,7 @@ RSpec.describe 'Gcp Cluster', :js do click_button 'Remove integration and resources' fill_in 'confirm_cluster_name_input', with: cluster.name click_button 'Remove integration' + click_link 'Certificate based' end it 'user sees creation form with the successful message' do @@ -171,6 +174,7 @@ RSpec.describe 'Gcp Cluster', :js do context 'when user has not dismissed GCP signup offer' do before do visit project_clusters_path(project) + click_link 'Certificate based' end it 'user sees offer on cluster index page' do @@ -187,6 +191,7 @@ RSpec.describe 'Gcp Cluster', :js do context 'when user has dismissed GCP signup offer' do before do visit project_clusters_path(project) + click_link 'Certificate based' end it 'user does not see offer after dismissing' do @@ -202,12 +207,11 @@ RSpec.describe 'Gcp Cluster', :js do end context 'when third party offers are disabled', :clean_gitlab_redis_shared_state do - let(:admin) { create(:admin) } + let(:user) { create(:admin) } before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') - sign_in(admin) - gitlab_enable_admin_mode_sign_in(admin) + gitlab_enable_admin_mode_sign_in(user) visit general_admin_application_settings_path end diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb index 4d663ec5a5a..d3f709bfb53 100644 --- a/spec/features/projects/clusters/user_spec.rb +++ b/spec/features/projects/clusters/user_spec.rb @@ -25,6 +25,7 @@ RSpec.describe 'User Cluster', :js do before do visit project_clusters_path(project) + click_link 'Certificate based' click_link 'Connect with a certificate' click_link 'Connect existing cluster' end @@ -112,6 +113,7 @@ RSpec.describe 'User Cluster', :js do click_button 'Remove integration and resources' fill_in 'confirm_cluster_name_input', with: cluster.name click_button 'Remove integration' + click_link 'Certificate based' end it 'user sees creation form with the successful message' do diff --git a/spec/features/projects/clusters_spec.rb b/spec/features/projects/clusters_spec.rb index 4190b83cfbf..a49fa4c9e31 100644 --- a/spec/features/projects/clusters_spec.rb +++ b/spec/features/projects/clusters_spec.rb @@ -16,6 +16,7 @@ RSpec.describe 'Clusters', :js do context 'when user does not have a cluster and visits cluster index page' do before do visit project_clusters_path(project) + click_link 'Certificate based' end it 'sees empty state' do @@ -33,16 +34,17 @@ RSpec.describe 'Clusters', :js do before do create(:cluster, :provided_by_user, name: 'default-cluster', environment_scope: '*', projects: [project]) visit project_clusters_path(project) + click_link 'Certificate based' + click_button(class: 'dropdown-toggle-split') end it 'user sees an add cluster button' do - expect(page).to have_selector('.js-add-cluster:not(.readonly)') + expect(page).to have_content('Connect with certificate') end context 'when user filled form with environment scope' do before do - click_link 'Connect cluster with certificate' - click_link 'Connect existing cluster' + click_link 'Connect with certificate' fill_in 'cluster_name', with: 'staging-cluster' fill_in 'cluster_environment_scope', with: 'staging/*' click_button 'Add Kubernetes cluster' @@ -70,8 +72,7 @@ RSpec.describe 'Clusters', :js do context 'when user updates duplicated environment scope' do before do - click_link 'Connect cluster with certificate' - click_link 'Connect existing cluster' + click_link 'Connect with certificate' fill_in 'cluster_name', with: 'staging-cluster' fill_in 'cluster_environment_scope', with: '*' fill_in 'cluster_platform_kubernetes_attributes_api_url', with: 'https://0.0.0.0' @@ -108,15 +109,12 @@ RSpec.describe 'Clusters', :js do create(:cluster, :provided_by_gcp, name: 'default-cluster', environment_scope: '*', projects: [project]) visit project_clusters_path(project) - end - - it 'user sees a add cluster button' do - expect(page).to have_selector('.js-add-cluster:not(.readonly)') + click_link 'Certificate based' end context 'when user filled form with environment scope' do before do - click_link 'Connect cluster with certificate' + click_button(class: 'dropdown-toggle-split') click_link 'Create new cluster' click_link 'Google GKE' @@ -161,7 +159,7 @@ RSpec.describe 'Clusters', :js do context 'when user updates duplicated environment scope' do before do - click_link 'Connect cluster with certificate' + click_button(class: 'dropdown-toggle-split') click_link 'Create new cluster' click_link 'Google GKE' @@ -192,6 +190,7 @@ RSpec.describe 'Clusters', :js do before do visit project_clusters_path(project) + click_link 'Certificate based' end it 'user sees a table with one cluster' do @@ -214,6 +213,7 @@ RSpec.describe 'Clusters', :js do before do visit project_clusters_path(project) + click_link 'Certificate based' click_link 'Connect with a certificate' click_link 'Create new cluster' end diff --git a/spec/features/projects/infrastructure_registry_spec.rb b/spec/features/projects/infrastructure_registry_spec.rb index ee35e02b5e8..27d0866bc69 100644 --- a/spec/features/projects/infrastructure_registry_spec.rb +++ b/spec/features/projects/infrastructure_registry_spec.rb @@ -43,7 +43,7 @@ RSpec.describe 'Infrastructure Registry' do expect(page).to have_current_path(project_infrastructure_registry_path(terraform_module.project, terraform_module)) - expect(page).to have_css('.packages-app h1[data-testid="title"]', text: terraform_module.name) + expect(page).to have_css('.packages-app h2[data-testid="title"]', text: terraform_module.name) expect(page).to have_content('Provision instructions') expect(page).to have_content('Registry setup') |