GitLab steht Mittwoch, den 08. Juli, zwischen 09:00 und 13:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit 14b8fd9d authored by Mark Lapierre's avatar Mark Lapierre

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
parents b570f53d 2aea7878
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment