Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2019-02-20 01:14:31 +0300
committerMark Lapierre <mlapierre@gitlab.com>2019-02-20 01:14:31 +0300
commit14b8fd9d8298d99ba61ab9624cbf39093599a5e5 (patch)
tree280bc6da9748be4bf9eef86c4650dd10a6de88c3 /qa
parentb570f53d17f5bc0e72fef9a122b7fe5645db0ea9 (diff)
parent2aea7878f4fc11a589bbc135efa397d6b2075738 (diff)
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')
-rw-r--r--qa/qa/page/project/job/show.rb33
-rw-r--r--qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb2
-rw-r--r--qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb24
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