Commit 04d7e1c5 authored by Tiffany Rea's avatar Tiffany Rea

Refactor specs to help with flakiness

Define child pipeline selector
Add child pipeline verification method
Remove click logic with child verification
parent 405fd65a
......@@ -77,6 +77,7 @@ export default {
ref="linkedPipeline"
class="linked-pipeline build"
:class="{ 'child-pipeline': childPipeline }"
data-qa-selector="child_pipeline"
>
<gl-deprecated-button
:id="buttonId"
......
......@@ -22,6 +22,7 @@ module QA
view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do
element :linked_pipeline_button
element :child_pipeline
end
view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do
......@@ -60,6 +61,10 @@ module QA
end
end
def has_child_pipeline?
has_element? :child_pipeline
end
def click_job(job_name)
click_element(:job_link, text: job_name)
end
......
......@@ -29,12 +29,8 @@ module QA
view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_passed
parent_pipeline.retry_on_exception(sleep_interval: 1.0) do
parent_pipeline.click_linked_job(project.name)
end
expect(parent_pipeline).to have_job("child_job")
end
end
......@@ -43,12 +39,8 @@ module QA
view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_failed
parent_pipeline.retry_on_exception(sleep_interval: 1.0) do
parent_pipeline.click_linked_job(project.name)
end
expect(parent_pipeline).to have_job("child_job")
end
end
......
......@@ -29,12 +29,8 @@ module QA
view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_passed
parent_pipeline.retry_on_exception(reload: true, sleep_interval: 1.0) do
parent_pipeline.click_linked_job(project.name)
end
expect(parent_pipeline).to have_job("child_job")
end
end
......@@ -43,12 +39,8 @@ module QA
view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_passed
parent_pipeline.retry_on_exception(reload: true, sleep_interval: 1.0) do
parent_pipeline.click_linked_job(project.name)
end
expect(parent_pipeline).to have_job("child_job")
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