diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2019-02-15 01:25:18 +0000 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2019-02-15 13:38:12 -0600 |
commit | 8cb772bc414269e8c0dccae7c38fab0c58927040 (patch) | |
tree | cd01851690bf1c5da76c5f1c2f2744980917da94 /qa | |
parent | 4a7948ea2ef1836f5b823b1b97d6ae0e8867e9ac (diff) | |
download | gitlab-ce-8cb772bc414269e8c0dccae7c38fab0c58927040.tar.gz |
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 )
Diffstat (limited to 'qa')
3 files changed, 29 insertions, 11 deletions
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 |