summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/pipeline/show.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/project/pipeline/show.rb')
-rw-r--r--qa/qa/page/project/pipeline/show.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb
index 994b1c02a3d..c5887b84be6 100644
--- a/qa/qa/page/project/pipeline/show.rb
+++ b/qa/qa/page/project/pipeline/show.rb
@@ -68,20 +68,30 @@ module QA
end
end
- def has_child_pipeline?
- has_element? :child_pipeline
+ def has_child_pipeline?(title: nil)
+ title ? find_child_pipeline_by_title(title) : has_element?(:child_pipeline)
end
def has_no_child_pipeline?
- has_no_element? :child_pipeline
+ has_no_element?(:child_pipeline)
end
def click_job(job_name)
click_element(:job_link, Project::Job::Show, text: job_name)
end
- def expand_child_pipeline
- within_element(:child_pipeline) do
+ def child_pipelines
+ all_elements(:child_pipeline, minimum: 1)
+ end
+
+ def find_child_pipeline_by_title(title)
+ child_pipelines.find { |pipeline| pipeline[:title].include?(title) }
+ end
+
+ def expand_child_pipeline(title: nil)
+ child_pipeline = title ? find_child_pipeline_by_title(title) : child_pipelines.first
+
+ within_element_by_index(:child_pipeline, child_pipelines.index(child_pipeline)) do
click_element(:expand_pipeline_button)
end
end