Commit cb176f79 authored by Tiffany Rea's avatar Tiffany Rea Committed by Anastasia McDonald

Improve test failure output

parent 246f44a5
...@@ -62,6 +62,12 @@ module QA ...@@ -62,6 +62,12 @@ module QA
has_element? :job_log_content has_element? :job_log_content
end end
def has_status?(status, wait: 30)
wait_until(reload: false, max_duration: wait, sleep_interval: 1) do
status_badge == status
end
end
private private
def loaded?(wait: 60) def loaded?(wait: 60)
......
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
RSpec.describe 'Verify', :runner do RSpec.describe 'Verify', :smoke, :runner do
describe 'Pipeline creation and processing' do describe 'Pipeline creation and processing' do
let(:executor) { "qa-runner-#{Time.now.to_i}" } let(:executor) { "qa-runner-#{Time.now.to_i}" }
let(:max_wait) { 30 }
let(:project) do let(:project) do
Resource::Project.fabricate_via_api! do |project| Resource::Project.fabricate_via_api! do |project|
...@@ -21,11 +20,10 @@ module QA ...@@ -21,11 +20,10 @@ module QA
end end
after do after do
runner.remove_via_api! [runner, project].each(&:remove_via_api!)
end end
it 'users creates a pipeline which gets processed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1601' do it 'users creates a pipeline which gets processed', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1601' do
# TODO: Convert back to :smoke once proved to be stable. Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/300909
Flow::Login.sign_in Flow::Login.sign_in
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
...@@ -68,22 +66,24 @@ module QA ...@@ -68,22 +66,24 @@ module QA
Flow::Pipeline.visit_latest_pipeline Flow::Pipeline.visit_latest_pipeline
aggregate_failures do
{ {
'test-success': :passed, 'test-success': 'passed',
'test-failure': :failed, 'test-failure': 'failed',
'test-tags-mismatch': :pending, 'test-tags-mismatch': 'pending',
'test-artifacts': :passed 'test-artifacts': 'passed'
}.each do |job, status| }.each do |job, status|
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.click_job(job) pipeline.click_job(job)
end end
Page::Project::Job::Show.perform do |show| Page::Project::Job::Show.perform do |show|
expect(show).to public_send("be_#{status}") expect(show).to have_status(status), "Expected job status to be #{status} but got #{show.status_badge} instead."
show.click_element(:pipeline_path, Page::Project::Pipeline::Show) show.click_element(:pipeline_path, Page::Project::Pipeline::Show)
end end
end end
end end
end end
end end
end
end 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