diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /spec/features | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) | |
download | gitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
8 files changed, 45 insertions, 16 deletions
diff --git a/spec/features/clusters/cluster_detail_page_spec.rb b/spec/features/clusters/cluster_detail_page_spec.rb index 437e7f18c48..28d6c10f04f 100644 --- a/spec/features/clusters/cluster_detail_page_spec.rb +++ b/spec/features/clusters/cluster_detail_page_spec.rb @@ -17,7 +17,7 @@ describe 'Clusterable > Show page' do it 'allow the user to set domain' do visit cluster_path - within '#cluster-integration' do + within '.js-cluster-integration-form' do fill_in('cluster_base_domain', with: 'test.com') click_on 'Save changes' end @@ -34,7 +34,7 @@ describe 'Clusterable > Show page' do end it 'shows help text with the domain as an alternative to custom domain' do - within '#cluster-integration' do + within '.js-cluster-integration-form' do expect(find(cluster_ingress_help_text_selector)).not_to match_css(hide_modifier_selector) end end @@ -44,7 +44,7 @@ describe 'Clusterable > Show page' do it 'alternative to custom domain is not shown' do visit cluster_path - within '#cluster-integration' do + within '.js-cluster-integration-form' do expect(find(cluster_ingress_help_text_selector)).to match_css(hide_modifier_selector) end end @@ -63,7 +63,7 @@ describe 'Clusterable > Show page' do end it 'is not able to edit the name, API url, CA certificate nor token' do - within('#js-cluster-details') do + within('.js-provider-details') do cluster_name_field = find('.cluster-name') api_url_field = find('#cluster_platform_kubernetes_attributes_api_url') ca_certificate_field = find('#cluster_platform_kubernetes_attributes_ca_cert') @@ -77,6 +77,8 @@ describe 'Clusterable > Show page' do end it 'displays GKE information' do + click_link 'Advanced Settings' + within('#advanced-settings-section') do expect(page).to have_content('Google Kubernetes Engine') expect(page).to have_content('Manage your Kubernetes cluster by visiting') @@ -91,7 +93,7 @@ describe 'Clusterable > Show page' do end it 'is able to edit the name, API url, CA certificate and token' do - within('#js-cluster-details') do + within('.js-provider-details') do cluster_name_field = find('#cluster_name') api_url_field = find('#cluster_platform_kubernetes_attributes_api_url') ca_certificate_field = find('#cluster_platform_kubernetes_attributes_ca_cert') @@ -105,6 +107,8 @@ describe 'Clusterable > Show page' do end it 'does not display GKE information' do + click_link 'Advanced Settings' + within('#advanced-settings-section') do expect(page).not_to have_content('Google Kubernetes Engine') expect(page).not_to have_content('Manage your Kubernetes cluster by visiting') diff --git a/spec/features/clusters/installing_applications_shared_examples.rb b/spec/features/clusters/installing_applications_shared_examples.rb index ff44ce46213..8710e05e5cc 100644 --- a/spec/features/clusters/installing_applications_shared_examples.rb +++ b/spec/features/clusters/installing_applications_shared_examples.rb @@ -17,6 +17,12 @@ shared_examples "installing applications on a cluster" do context 'when cluster is created' do let(:cluster) { create(:cluster, :provided_by_gcp, *cluster_factory_args) } + before do + page.within('.js-edit-cluster-form') do + click_link 'Applications' + end + end + it 'user can install applications' do wait_for_requests @@ -29,6 +35,7 @@ shared_examples "installing applications on a cluster" do context 'when user installs Helm' do before do allow(ClusterInstallAppWorker).to receive(:perform_async) + wait_for_requests page.within('.js-cluster-application-row-helm') do page.find(:css, '.js-cluster-application-install-button').click diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb index ceec50e4f58..e9ef66e31a2 100644 --- a/spec/features/groups/clusters/user_spec.rb +++ b/spec/features/groups/clusters/user_spec.rb @@ -34,7 +34,7 @@ describe 'User Cluster', :js do it 'user sees a cluster details page' do subject - expect(page).to have_content('Kubernetes cluster integration') + expect(page).to have_content('GitLab Integration') expect(page.find_field('cluster[name]').value).to eq('dev-cluster') expect(page.find_field('cluster[platform_kubernetes_attributes][api_url]').value) .to have_content('http://example.com') @@ -93,7 +93,7 @@ describe 'User Cluster', :js do context 'when user disables the cluster' do before do page.find(:css, '.js-cluster-enable-toggle-area .js-project-feature-toggle').click - page.within('#cluster-integration') { click_button 'Save changes' } + page.within('.js-cluster-integration-form') { click_button 'Save changes' } end it 'user sees the successful message' do @@ -105,7 +105,7 @@ describe 'User Cluster', :js do before do fill_in 'cluster_name', with: 'my-dev-cluster' fill_in 'cluster_platform_kubernetes_attributes_token', with: 'new-token' - page.within('#js-cluster-details') { click_button 'Save changes' } + page.within('.js-provider-details') { click_button 'Save changes' } end it 'user sees the successful message' do @@ -117,6 +117,7 @@ describe 'User Cluster', :js do context 'when user destroys the cluster' do before do + click_link 'Advanced Settings' click_button 'Remove integration and resources' fill_in 'confirm_cluster_name_input', with: cluster.name click_button 'Remove integration' diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb index 56ee2819bdb..df786cf0818 100644 --- a/spec/features/projects/clusters/gcp_spec.rb +++ b/spec/features/projects/clusters/gcp_spec.rb @@ -119,7 +119,7 @@ describe 'Gcp Cluster', :js, :do_not_mock_admin_mode do context 'when user disables the cluster' do before do page.find(:css, '.js-cluster-enable-toggle-area .js-project-feature-toggle').click - page.within('#cluster-integration') { click_button 'Save changes' } + page.within('.js-cluster-integration-form') { click_button 'Save changes' } end it 'user sees the successful message' do @@ -130,7 +130,7 @@ describe 'Gcp Cluster', :js, :do_not_mock_admin_mode do context 'when user changes cluster parameters' do before do fill_in 'cluster_platform_kubernetes_attributes_namespace', with: 'my-namespace' - page.within('#js-cluster-details') { click_button 'Save changes' } + page.within('.js-provider-details') { click_button 'Save changes' } end it 'user sees the successful message' do @@ -141,6 +141,7 @@ describe 'Gcp Cluster', :js, :do_not_mock_admin_mode do context 'when user destroys the cluster' do before do + click_link 'Advanced Settings' click_button 'Remove integration and resources' fill_in 'confirm_cluster_name_input', with: cluster.name click_button 'Remove integration' diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb index 38efcf758e1..79676927fa2 100644 --- a/spec/features/projects/clusters/user_spec.rb +++ b/spec/features/projects/clusters/user_spec.rb @@ -41,7 +41,7 @@ describe 'User Cluster', :js do it 'user sees a cluster details page' do subject - expect(page).to have_content('Kubernetes cluster integration') + expect(page).to have_content('GitLab Integration') expect(page.find_field('cluster[name]').value).to eq('dev-cluster') expect(page.find_field('cluster[platform_kubernetes_attributes][api_url]').value) .to have_content('http://example.com') @@ -79,7 +79,7 @@ describe 'User Cluster', :js do context 'when user disables the cluster' do before do page.find(:css, '.js-cluster-enable-toggle-area .js-project-feature-toggle').click - page.within('#cluster-integration') { click_button 'Save changes' } + page.within('.js-cluster-integration-form') { click_button 'Save changes' } end it 'user sees the successful message' do @@ -91,7 +91,7 @@ describe 'User Cluster', :js do before do fill_in 'cluster_name', with: 'my-dev-cluster' fill_in 'cluster_platform_kubernetes_attributes_namespace', with: 'my-namespace' - page.within('#js-cluster-details') { click_button 'Save changes' } + page.within('.js-provider-details') { click_button 'Save changes' } end it 'user sees the successful message' do @@ -103,6 +103,7 @@ describe 'User Cluster', :js do context 'when user destroys the cluster' do before do + click_link 'Advanced Settings' click_button 'Remove integration and resources' fill_in 'confirm_cluster_name_input', with: cluster.name click_button 'Remove integration' diff --git a/spec/features/projects/releases/user_views_releases_spec.rb b/spec/features/projects/releases/user_views_releases_spec.rb index 4507d90576b..a4ba81ffeb9 100644 --- a/spec/features/projects/releases/user_views_releases_spec.rb +++ b/spec/features/projects/releases/user_views_releases_spec.rb @@ -24,16 +24,31 @@ describe 'User views releases', :js do context 'when there is a link as an asset' do let!(:release_link) { create(:release_link, release: release, url: url ) } let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } + let(:direct_asset_link) { Gitlab::Routing.url_helpers.project_release_url(project, release) << release_link.filepath } it 'sees the link' do visit project_releases_path(project) page.within('.js-assets-list') do - expect(page).to have_link release_link.name, href: release_link.url + expect(page).to have_link release_link.name, href: direct_asset_link expect(page).not_to have_content('(external source)') end end + context 'when there is a link redirect' do + let!(:release_link) { create(:release_link, release: release, name: 'linux-amd64 binaries', filepath: '/binaries/linux-amd64', url: url) } + let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } + + it 'sees the link' do + visit project_releases_path(project) + + page.within('.js-assets-list') do + expect(page).to have_link release_link.name, href: direct_asset_link + expect(page).not_to have_content('(external source)') + end + end + end + context 'when url points to external resource' do let(:url) { 'http://google.com/download' } diff --git a/spec/features/projects/snippets/user_updates_snippet_spec.rb b/spec/features/projects/snippets/user_updates_snippet_spec.rb index 0c3438575ba..f9628b37089 100644 --- a/spec/features/projects/snippets/user_updates_snippet_spec.rb +++ b/spec/features/projects/snippets/user_updates_snippet_spec.rb @@ -38,7 +38,7 @@ describe 'Projects > Snippets > User updates a snippet' do end it 'renders edit page and displays the error' do - expect(page).to have_content('Error updating the snippet') + expect(page.find('.flash-container span').text).to eq('Error updating the snippet') expect(page).to have_content('Edit Snippet') end end diff --git a/spec/features/snippets/user_edits_snippet_spec.rb b/spec/features/snippets/user_edits_snippet_spec.rb index 706758164b2..b003e50aab7 100644 --- a/spec/features/snippets/user_edits_snippet_spec.rb +++ b/spec/features/snippets/user_edits_snippet_spec.rb @@ -71,7 +71,7 @@ describe 'User edits snippet', :js do end it 'renders edit page and displays the error' do - expect(page).to have_content('Error updating the snippet') + expect(page.find('.flash-container span').text).to eq('Error updating the snippet') expect(page).to have_content('Edit Snippet') end end |