Commit b7820848 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'refactor-parent-child-pipelines-spec' into 'master'

Refactor specs to help with flakiness

See merge request gitlab-org/gitlab!34776
parents 53883f9a 04d7e1c5
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
ref="linkedPipeline" ref="linkedPipeline"
class="linked-pipeline build" class="linked-pipeline build"
:class="{ 'child-pipeline': childPipeline }" :class="{ 'child-pipeline': childPipeline }"
data-qa-selector="child_pipeline"
> >
<gl-deprecated-button <gl-deprecated-button
:id="buttonId" :id="buttonId"
......
...@@ -22,6 +22,7 @@ module QA ...@@ -22,6 +22,7 @@ module QA
view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do
element :linked_pipeline_button element :linked_pipeline_button
element :child_pipeline
end end
view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do
...@@ -60,6 +61,10 @@ module QA ...@@ -60,6 +61,10 @@ module QA
end end
end end
def has_child_pipeline?
has_element? :child_pipeline
end
def click_job(job_name) def click_job(job_name)
click_element(:job_link, text: job_name) click_element(:job_link, text: job_name)
end end
......
...@@ -29,12 +29,8 @@ module QA ...@@ -29,12 +29,8 @@ module QA
view_pipelines view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline| Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_passed 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
end end
...@@ -43,12 +39,8 @@ module QA ...@@ -43,12 +39,8 @@ module QA
view_pipelines view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline| Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_failed 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
end end
......
...@@ -29,12 +29,8 @@ module QA ...@@ -29,12 +29,8 @@ module QA
view_pipelines view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline| Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_passed 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
end end
...@@ -43,12 +39,8 @@ module QA ...@@ -43,12 +39,8 @@ module QA
view_pipelines view_pipelines
Page::Project::Pipeline::Show.perform do |parent_pipeline| Page::Project::Pipeline::Show.perform do |parent_pipeline|
expect(parent_pipeline).to have_child_pipeline
expect(parent_pipeline).to have_passed 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
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