Commit 66a374df authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-fix-create-and-process-pipeline-spec' into 'master'

Fix failing create_and_process_pipeline_spec

Closes #202218

See merge request gitlab-org/gitlab!24890
parents baf2eb66 4110e5bd
...@@ -5,7 +5,22 @@ module QA ...@@ -5,7 +5,22 @@ module QA
module Component module Component
module CiBadgeLink module CiBadgeLink
COMPLETED_STATUSES = %w[passed failed canceled blocked skipped manual].freeze # excludes created, pending, running COMPLETED_STATUSES = %w[passed failed canceled blocked skipped manual].freeze # excludes created, pending, running
PASSED_STATUS = 'passed'.freeze INCOMPLETE_STATUSES = %w[pending created running].freeze
# e.g. def passed?(timeout: nil); status_badge == 'passed'; end
COMPLETED_STATUSES.map do |status|
define_method "#{status}?" do |timeout: nil|
timeout ? completed?(timeout: timeout) : completed?
status_badge == status
end
end
# e.g. def pending?; status_badge == 'pending'; end
INCOMPLETE_STATUSES.map do |status|
define_method "#{status}?" do
status_badge == status
end
end
def self.included(base) def self.included(base)
base.view 'app/assets/javascripts/vue_shared/components/ci_badge_link.vue' do base.view 'app/assets/javascripts/vue_shared/components/ci_badge_link.vue' do
...@@ -17,12 +32,6 @@ module QA ...@@ -17,12 +32,6 @@ module QA
find_element(:status_badge).text find_element(:status_badge).text
end end
def successful?(timeout: 60)
raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout)
status_badge == PASSED_STATUS
end
private private
def completed?(timeout: 60) def completed?(timeout: 60)
......
...@@ -21,7 +21,7 @@ module QA::Page ...@@ -21,7 +21,7 @@ module QA::Page
raise "Timed out waiting for the build trace to load" unless loaded? 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) raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout)
status_badge == PASSED_STATUS passed?
end end
# Reminder: You may wish to wait for a particular job status before checking output # Reminder: You may wish to wait for a particular job status before checking output
......
...@@ -68,12 +68,20 @@ module QA ...@@ -68,12 +68,20 @@ module QA
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
{
'test-success': :passed,
'test-failure': :failed,
'test-tags': :pending,
'test-artifacts': :passed
}.each do |job, status|
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
expect(pipeline).to be_running(wait: max_wait) pipeline.click_job(job)
expect(pipeline).to have_build('test-success', status: :success, wait: max_wait) end
expect(pipeline).to have_build('test-failure', status: :failed, wait: max_wait)
expect(pipeline).to have_build('test-tags', status: :pending, wait: max_wait) Page::Project::Job::Show.perform do |show|
expect(pipeline).to have_build('test-artifacts', status: :success, wait: max_wait) expect(show).to public_send("be_#{status}")
show.click_element(:pipeline_path, Page::Project::Pipeline::Show)
end
end end
end end
end end
......
...@@ -85,7 +85,7 @@ module QA ...@@ -85,7 +85,7 @@ module QA
end end
Page::Project::Pipeline::Show.perform do |show| Page::Project::Pipeline::Show.perform do |show|
expect(show).to be_successful expect(show).to be_passed
expect(show).to have_no_job("downstream_job") expect(show).to have_no_job("downstream_job")
show.click_linked_job(downstream_project_name) show.click_linked_job(downstream_project_name)
......
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