Commit 8cb772bc authored by Dylan Griffith's avatar Dylan Griffith

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 )
parent 4a7948ea
......@@ -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
......
......@@ -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
......
......@@ -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
......
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