Commit 9211231d authored by Anastasia McDonald's avatar Anastasia McDonald

Merge branch '343987-e2e-dependencies-jobs-are-not-skipped' into 'master'

E2E test - replay all does not leave jobs in skipped state

See merge request gitlab-org/gitlab!73326
parents 88951a24 940b986e
......@@ -59,7 +59,11 @@ export default {
</script>
<template>
<!-- eslint-disable @gitlab/vue-no-data-toggle -->
<div :id="computedJobId" class="ci-job-dropdown-container dropdown dropright">
<div
:id="computedJobId"
class="ci-job-dropdown-container dropdown dropright"
data-qa-selector="job_dropdown_container"
>
<button
type="button"
data-toggle="dropdown"
......@@ -79,7 +83,10 @@ export default {
</div>
</button>
<ul class="dropdown-menu big-pipeline-graph-dropdown-menu js-grouped-pipeline-dropdown">
<ul
class="dropdown-menu big-pipeline-graph-dropdown-menu js-grouped-pipeline-dropdown"
data-qa-selector="jobs_dropdown_menu"
>
<li class="scrollable-menu">
<ul>
<li v-for="job in group.jobs" :key="job.id">
......
......@@ -260,7 +260,7 @@ export default {
:link="status.action.path"
:action-icon="status.action.icon"
class="gl-mr-1"
data-qa-selector="action_button"
data-qa-selector="job_action_button"
@pipelineActionRequestComplete="pipelineActionRequestComplete"
/>
<action-component
......
......@@ -33,6 +33,10 @@ module QA
wait_for_latest_pipeline_status { has_selector?(".ci-status-icon-success") || has_selector?(".ci-status-icon-failed") }
end
def wait_for_latest_pipeline_skipped
wait_for_latest_pipeline_status { has_text?('skipped') }
end
def wait_for_latest_pipeline_status
wait_until(max_duration: 90, reload: true, sleep_interval: 5) { has_pipeline? }
......
......@@ -18,7 +18,7 @@ module QA
view 'app/assets/javascripts/pipelines/components/graph/job_item.vue' do
element :job_item_container
element :job_link
element :action_button
element :job_action_button
end
view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do
......@@ -38,6 +38,11 @@ module QA
element :pipeline_badges
end
view 'app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue' do
element :job_dropdown_container
element :jobs_dropdown_menu
end
def running?(wait: 0)
within_element(:pipeline_header) do
page.has_content?('running', wait: wait)
......@@ -47,7 +52,7 @@ module QA
def has_build?(name, status: :success, wait: nil)
if status
within_element(:job_item_container, text: name) do
has_selector?(".ci-status-icon-#{status}", { wait: wait }.compact)
has_selector?(".ci-status-icon-#{status}", **{ wait: wait }.compact)
end
else
has_element?(:job_item_container, text: name)
......@@ -110,8 +115,22 @@ module QA
end
def click_job_action(job_name)
wait_for_requests
within_element(:job_item_container, text: job_name) do
click_element(:action_button)
click_element(:job_action_button)
end
end
def click_job_dropdown(job_dropdown_name)
click_element(:job_dropdown_container, text: job_dropdown_name)
end
def has_skipped_job_in_group?
within_element(:jobs_dropdown_menu) do
all_elements(:job_item_container, minimum: 1).all? do
has_selector?('.ci-status-icon-skipped')
end
end
end
end
......
# frozen_string_literal: true
module QA
RSpec.describe 'Verify', :runner do
describe 'Run pipeline with manual jobs' do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'pipeline-with-manual-job'
project.description = 'Project for pipeline with manual job'
end
end
let!(:runner) do
Resource::Runner.fabricate! do |runner|
runner.project = project
runner.name = "qa-runner-#{SecureRandom.hex(3)}"
end
end
let!(:ci_file) do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
commit.add_files(
[
{
file_path: '.gitlab-ci.yml',
content: <<~YAML
stages:
- Stage1
- Stage2
- Stage3
Prep:
stage: Stage1
script: exit 0
when: manual
Build:
stage: Stage2
needs: ['Prep']
script: exit 0
parallel: 6
Test:
stage: Stage3
needs: ['Build']
script: exit 0
Deploy:
stage: Stage3
needs: ['Test']
script: exit 0
parallel: 6
YAML
}
]
)
end
end
before do
Flow::Login.sign_in
project.visit!
Flow::Pipeline.visit_latest_pipeline(pipeline_condition: 'skipped')
end
after do
[runner, project].each(&:remove_via_api!)
end
it 'does not leave any job in skipped state', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349158' do
Page::Project::Pipeline::Show.perform do |show|
show.click_job_action('Prep') # Trigger pipeline manually
show.wait_until(max_duration: 120, sleep_interval: 2, reload: false) do
project.pipelines.last[:status] == 'success'
end
aggregate_failures do
expect(show).to have_build('Test', status: :success)
show.click_job_dropdown('Build')
expect(show).not_to have_skipped_job_in_group
show.click_job_dropdown('Build') # Close Build dropdown
show.click_job_dropdown('Deploy')
expect(show).not_to have_skipped_job_in_group
end
end
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