diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /qa/qa/flow | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'qa/qa/flow')
-rw-r--r-- | qa/qa/flow/pipeline.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/qa/qa/flow/pipeline.rb b/qa/qa/flow/pipeline.rb index 999f352e834..d19b2530bb8 100644 --- a/qa/qa/flow/pipeline.rb +++ b/qa/qa/flow/pipeline.rb @@ -5,17 +5,24 @@ module QA module Pipeline module_function - # In some cases we don't need to wait for anything, blocked, running or pending is acceptable - # Some cases only we do need pipeline to finish with expected condition (completed, succeeded or replicated) - def visit_latest_pipeline(pipeline_condition: nil) + # Acceptable statuses: + # canceled, created, failed, manual, passed + # pending, running, skipped + def visit_latest_pipeline(status: nil, wait: nil, skip_wait: true) Page::Project::Menu.perform(&:click_ci_cd_pipelines) - Page::Project::Pipeline::Index.perform(&:"wait_for_latest_pipeline_#{pipeline_condition}") if pipeline_condition - Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline) + Page::Project::Pipeline::Index.perform do |index| + index.has_any_pipeline?(wait: wait) + index.wait_for_latest_pipeline(status: status, wait: wait) if status || !skip_wait + index.click_on_latest_pipeline + end end - def wait_for_latest_pipeline(pipeline_condition:) + def wait_for_latest_pipeline(status: nil, wait: nil) Page::Project::Menu.perform(&:click_ci_cd_pipelines) - Page::Project::Pipeline::Index.perform(&:"wait_for_latest_pipeline_#{pipeline_condition}") + Page::Project::Pipeline::Index.perform do |index| + index.has_any_pipeline?(wait: wait) + index.wait_for_latest_pipeline(status: status, wait: wait) + end end end end |