Commit 55d69076 authored by Tiffany Rea's avatar Tiffany Rea Committed by Sanad Liaquat

E2E can merge MR when pipeline is blocked

parent c1b3a888
......@@ -218,6 +218,11 @@ module QA
raise "Merge did not appear to be successful" unless merged?
end
def merge_immediately!
click_element(:merge_moment_dropdown)
click_element(:merge_immediately_option)
end
def merged?
has_element?(:merged_status_content, text: 'The changes were merged into', wait: 60)
end
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
context 'When pipeline is blocked' do
let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(8)}" }
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-blocked-pipeline'
end
end
let!(:runner) do
Resource::Runner.fabricate! do |runner|
runner.project = project
runner.name = executor
runner.tags = [executor]
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
test_blocked_pipeline:
stage: build
tags: [#{executor}]
script: echo 'OK!'
manual_job:
stage: test
needs: [test_blocked_pipeline]
script: echo do not click me
when: manual
dummy_job:
stage: deploy
needs: [manual_job]
script: echo nothing
YAML
]
)
end
end
let(:merge_request) do
Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = project
merge_request.description = Faker::Lorem.sentence
merge_request.target_new_branch = false
merge_request.file_name = 'custom_file.txt'
merge_request.file_content = Faker::Lorem.sentence
end
end
before do
Flow::Login.sign_in
merge_request.visit!
end
after do
runner.remove_via_api!
end
it 'can still merge MR successfully', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/971' do
Page::MergeRequest::Show.perform do |show|
show.wait_until(reload: false) { show.has_pipeline_status?('running') }
show.merge_immediately!
expect(show).to be_merged
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