From 4a7948ea2ef1836f5b823b1b97d6ae0e8867e9ac Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 15 Feb 2019 01:24:33 +0000 Subject: Fix setting domain in QA Auto DevOps specs The domain name setting was not doing anything (as far as I could tell). Now we set the input and save the form. This was a regression introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24580/diffs --- qa/qa/page/project/operations/kubernetes/show.rb | 13 +++++++++++++ qa/qa/resource/kubernetes_cluster.rb | 10 ++++++---- .../auto_devops/create_project_with_auto_devops_spec.rb | 5 +---- 3 files changed, 20 insertions(+), 8 deletions(-) (limited to 'qa') diff --git a/qa/qa/page/project/operations/kubernetes/show.rb b/qa/qa/page/project/operations/kubernetes/show.rb index 98ac5c32d91..d4e1679b6bf 100644 --- a/qa/qa/page/project/operations/kubernetes/show.rb +++ b/qa/qa/page/project/operations/kubernetes/show.rb @@ -14,6 +14,11 @@ module QA element :ingress_ip_address, 'id="ingress-ip-address"' # rubocop:disable QA/ElementWithPattern end + view 'app/views/clusters/clusters/_form.html.haml' do + element :base_domain + element :save_domain + end + def install!(application_name) within(".js-cluster-application-row-#{application_name}") do page.has_button?('Install', wait: 30) @@ -32,6 +37,14 @@ module QA # ip address is assigned for the ingress controller page.find('#ingress-ip-address', wait: 1200).value end + + def set_domain(domain) + fill_element :base_domain, domain + end + + def save_domain + click_element :save_domain + end end end end diff --git a/qa/qa/resource/kubernetes_cluster.rb b/qa/qa/resource/kubernetes_cluster.rb index 986b31da528..93a06be6818 100644 --- a/qa/qa/resource/kubernetes_cluster.rb +++ b/qa/qa/resource/kubernetes_cluster.rb @@ -12,10 +12,6 @@ module QA Page::Project::Operations::Kubernetes::Show.perform(&:ingress_ip) end - attribute :domain do - "#{ingress_ip}.nip.io" - end - def fabricate! @project.visit! @@ -53,6 +49,12 @@ module QA page.await_installed(:ingress) if @install_ingress page.await_installed(:prometheus) if @install_prometheus page.await_installed(:runner) if @install_runner + + if @install_ingress + populate(:ingress_ip) + page.set_domain("#{ingress_ip}.nip.io") + page.save_domain + end end end end diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb index 8cd353fa250..13e1a8bc38e 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb @@ -40,7 +40,7 @@ module QA # Create and connect K8s cluster @cluster = Service::KubernetesCluster.new(rbac: rbac).create! - kubernetes_cluster = Resource::KubernetesCluster.fabricate! do |cluster| + Resource::KubernetesCluster.fabricate! do |cluster| cluster.project = @project cluster.cluster = @cluster cluster.install_helm_tiller = true @@ -49,14 +49,11 @@ module QA cluster.install_runner = true end - kubernetes_cluster.populate(:ingress_ip) @project.visit! Page::Project::Menu.perform(&:click_ci_cd_settings) Page::Project::Settings::CICD.perform do |p| p.enable_auto_devops end - - kubernetes_cluster.populate(:domain) end after(:all) do -- cgit v1.2.1 From 8cb772bc414269e8c0dccae7c38fab0c58927040 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 15 Feb 2019 01:25:18 +0000 Subject: Fix waiting for spec failures in QA Build specs The waiting logic on the build page was flaky or just not really working. Waiting for the spinner to not be present seemed to not work and we were regularly still seeing the spinner in our build failure screenshots (eg. https://gitlab.com/gitlab-org/gitlab-qa/-/jobs/161759351 ) --- qa/qa/page/project/job/show.rb | 12 +++++++---- .../deploy_key/clone_using_deploy_key_spec.rb | 4 +++- .../create_project_with_auto_devops_spec.rb | 24 ++++++++++++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) (limited to 'qa') diff --git a/qa/qa/page/project/job/show.rb b/qa/qa/page/project/job/show.rb index 49c676c01f2..d9e789d7793 100644 --- a/qa/qa/page/project/job/show.rb +++ b/qa/qa/page/project/job/show.rb @@ -20,15 +20,19 @@ module QA::Page element :pipeline_path end - def completed? - COMPLETED_STATUSES.include?(status_badge) + def loaded?(wait: 60) + has_element?(:build_trace, wait: wait) end - def successful?(timeout: 60) + # Reminder: You should check #loaded? first + def completed?(timeout: 60) wait(reload: false, max: timeout) do - completed? && !trace_loading? + COMPLETED_STATUSES.include?(status_badge) end + end + # Reminder: You should check #completed? and #loaded? first + def successful? status_badge == PASSED_STATUS end diff --git a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb index 2375aa4ce91..2f885b330d3 100644 --- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb @@ -95,7 +95,9 @@ module QA Page::Project::Pipeline::Show.perform(&:go_to_first_job) Page::Project::Job::Show.perform do |job| - expect(job).to be_successful, "Job status did not become \"passed\"." + expect(job).to be_loaded + expect(job).to be_completed + expect(job).to be_successful expect(job.output).to include(sha1sum) end end diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb index 13e1a8bc38e..bb333561f28 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb @@ -73,7 +73,9 @@ module QA pipeline.go_to_job('build') end Page::Project::Job::Show.perform do |job| - expect(job).to be_sucessful(timeout: 600), "Job did not pass" + expect(job).to be_loaded + expect(job).to be_completed(timeout: 600) + expect(job).to be_successful job.click_element(:pipeline_path) end @@ -82,7 +84,9 @@ module QA pipeline.go_to_job('test') end Page::Project::Job::Show.perform do |job| - expect(job).to be_sucessful(timeout: 600), "Job did not pass" + expect(job).to be_loaded + expect(job).to be_completed(timeout: 600) + expect(job).to be_successful job.click_element(:pipeline_path) end @@ -91,7 +95,9 @@ module QA pipeline.go_to_job('production') end Page::Project::Job::Show.perform do |job| - expect(job).to be_sucessful(timeout: 1200), "Job did not pass" + expect(job).to be_loaded + expect(job).to be_completed(timeout: 1200) + expect(job).to be_successful job.click_element(:pipeline_path) end @@ -134,7 +140,9 @@ module QA pipeline.go_to_job('build') end Page::Project::Job::Show.perform do |job| - expect(job).to be_sucessful(timeout: 600), "Job did not pass" + expect(job).to be_loaded + expect(job).to be_completed(timeout: 600) + expect(job).to be_successful job.click_element(:pipeline_path) end @@ -143,7 +151,9 @@ module QA pipeline.go_to_job('test') end Page::Project::Job::Show.perform do |job| - expect(job).to be_sucessful(timeout: 600), "Job did not pass" + expect(job).to be_loaded + expect(job).to be_completed(timeout: 600) + expect(job).to be_successful job.click_element(:pipeline_path) end @@ -152,7 +162,9 @@ module QA pipeline.go_to_job('production') end Page::Project::Job::Show.perform do |job| - expect(job).to be_sucessful(timeout: 1200), "Job did not pass" + expect(job).to be_loaded + expect(job).to be_completed(timeout: 1200) + expect(job).to be_successful job.click_element(:pipeline_path) end -- cgit v1.2.1