diff options
author | Mark Lapierre <mlapierre@gitlab.com> | 2019-02-19 22:14:31 +0000 |
---|---|---|
committer | Mark Lapierre <mlapierre@gitlab.com> | 2019-02-19 22:14:31 +0000 |
commit | 14b8fd9d8298d99ba61ab9624cbf39093599a5e5 (patch) | |
tree | 280bc6da9748be4bf9eef86c4650dd10a6de88c3 /qa | |
parent | b570f53d17f5bc0e72fef9a122b7fe5645db0ea9 (diff) | |
parent | 2aea7878f4fc11a589bbc135efa397d6b2075738 (diff) | |
download | gitlab-ce-14b8fd9d8298d99ba61ab9624cbf39093599a5e5.tar.gz |
Merge branch '57921-qa-auto-devops-improvements' into 'master'
Refactor/simplify Auto DevOps QA spec
Closes #57921
See merge request gitlab-org/gitlab-ce!25401
Diffstat (limited to 'qa')
3 files changed, 19 insertions, 40 deletions
diff --git a/qa/qa/page/project/job/show.rb b/qa/qa/page/project/job/show.rb index d9e789d7793..9c218f4ed8b 100644 --- a/qa/qa/page/project/job/show.rb +++ b/qa/qa/page/project/job/show.rb @@ -4,10 +4,6 @@ module QA::Page COMPLETED_STATUSES = %w[passed failed canceled blocked skipped manual].freeze # excludes created, pending, running PASSED_STATUS = 'passed'.freeze - view 'app/assets/javascripts/jobs/components/job_app.vue' do - element :loading_animation - end - view 'app/assets/javascripts/jobs/components/job_log.vue' do element :build_trace end @@ -20,26 +16,13 @@ module QA::Page element :pipeline_path end - def loaded?(wait: 60) - has_element?(:build_trace, wait: wait) - end - - # Reminder: You should check #loaded? first - def completed?(timeout: 60) - wait(reload: false, max: timeout) do - COMPLETED_STATUSES.include?(status_badge) - end - end + def successful?(timeout: 60) + raise "Timed out waiting for the build trace to load" unless loaded? + raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout) - # Reminder: You should check #completed? and #loaded? first - def successful? status_badge == PASSED_STATUS end - def trace_loading? - has_element?(:loading_animation) - end - # Reminder: You may wish to wait for a particular job status before checking output def output find_element(:build_trace).text @@ -47,6 +30,16 @@ module QA::Page private + def loaded?(wait: 60) + has_element?(:build_trace, wait: wait) + end + + def completed?(timeout: 60) + wait(reload: false, max: timeout) do + COMPLETED_STATUSES.include?(status_badge) + end + end + def status_badge find_element(:status_badge).text 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 2f885b330d3..3f65eabc756 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,8 +95,6 @@ module QA Page::Project::Pipeline::Show.perform(&:go_to_first_job) Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed expect(job).to be_successful expect(job.output).to include(sha1sum) 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 bb333561f28..8b165a04382 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,9 +73,7 @@ module QA pipeline.go_to_job('build') end Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed(timeout: 600) - expect(job).to be_successful + expect(job).to be_successful(timeout: 600) job.click_element(:pipeline_path) end @@ -84,9 +82,7 @@ module QA pipeline.go_to_job('test') end Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed(timeout: 600) - expect(job).to be_successful + expect(job).to be_successful(timeout: 600) job.click_element(:pipeline_path) end @@ -95,9 +91,7 @@ module QA pipeline.go_to_job('production') end Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed(timeout: 1200) - expect(job).to be_successful + expect(job).to be_successful(timeout: 1200) job.click_element(:pipeline_path) end @@ -140,9 +134,7 @@ module QA pipeline.go_to_job('build') end Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed(timeout: 600) - expect(job).to be_successful + expect(job).to be_successful(timeout: 600) job.click_element(:pipeline_path) end @@ -151,9 +143,7 @@ module QA pipeline.go_to_job('test') end Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed(timeout: 600) - expect(job).to be_successful + expect(job).to be_successful(timeout: 600) job.click_element(:pipeline_path) end @@ -162,9 +152,7 @@ module QA pipeline.go_to_job('production') end Page::Project::Job::Show.perform do |job| - expect(job).to be_loaded - expect(job).to be_completed(timeout: 1200) - expect(job).to be_successful + expect(job).to be_successful(timeout: 1200) job.click_element(:pipeline_path) end |