Commit 446756b7 authored by Mark Lapierre's avatar Mark Lapierre

Update merge results/trains pipelines QA test

Handles the new popup that appears when merging immediately.

Uses a unique branch name so that retries don't try to reuse the same
branch. Reusing the same branch causes git errors like "Updates were
rejected because the tip of your current branch is behind its remote
counterpart."

Unquarantines the test.
parent 40d7fc1c
......@@ -62,9 +62,12 @@ export default {
<p>{{ __('Are you sure you want to merge immediately?') }}</p>
<template v-slot:modal-footer>
<gl-button ref="cancelButton" @click="cancel">{{ __('Cancel') }}</gl-button>
<gl-button variant="danger" @click="mergeImmediately">{{
__('Merge immediately')
}}</gl-button>
<gl-button
variant="danger"
data-qa-selector="merge_immediately_button"
@click="mergeImmediately"
>{{ __('Merge immediately') }}</gl-button
>
</template>
</gl-modal>
</template>
......@@ -59,6 +59,10 @@ module QA
element :approvals_summary_content
end
view 'ee/app/assets/javascripts/vue_merge_request_widget/components/merge_immediately_confirmation_dialog.vue' do
element :merge_immediately_button
end
view 'ee/app/assets/javascripts/vue_shared/security_reports/components/modal.vue' do
element :vulnerability_modal_content
end
......@@ -252,6 +256,16 @@ module QA
approvals_content.match(/Requires (\d+) more approvals/)[1].to_i
end
def merge_merge_train_immediately
click_element :merge_moment_dropdown
click_element :merge_immediately_option
# Wait for the warning modal dialog to appear
wait_for_animated_element :merge_immediately_button
click_element :merge_immediately_button
end
def merge_via_merge_train
raise ElementNotFound, "Not ready to merge" unless ready_to_merge?
......
# frozen_string_literal: true
require 'securerandom'
module QA
# Failure issue: https://gitlab.com/gitlab-org/gitlab/issues/36824
context 'Release', :docker, :quarantine do
context 'Release', :docker do
describe 'Pipelines for merged results and merge trains' do
before(:context) do
@project = Resource::Project.fabricate_via_api! do |project|
......@@ -49,17 +50,19 @@ module QA
end
it 'creates a pipeline with merged results' do
branch_name = "merged-results-#{SecureRandom.hex(8)}"
# Create a branch that will be merged into master
Resource::Repository::ProjectPush.fabricate! do |project_push|
project_push.project = @project
project_push.new_branch = true
project_push.branch_name = 'merged-results'
project_push.branch_name = branch_name
end
# Create a merge request to merge the branch we just created
Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = @project
merge_request.source_branch = 'merged-results'
merge_request.source_branch = branch_name
merge_request.no_preparation = true
end.visit!
......@@ -72,7 +75,7 @@ module QA
# The default option is to merge via merge train,
# but that will be covered by another test
show.merge_immediately
show.merge_merge_train_immediately
end
merged = Page::MergeRequest::Show.perform(&:merged?)
......@@ -81,11 +84,13 @@ module QA
end
it 'merges via a merge train' do
branch_name = "merge-train-#{SecureRandom.hex(8)}"
# Create a branch that will be merged into master
Resource::Repository::ProjectPush.fabricate! do |project_push|
project_push.project = @project
project_push.new_branch = true
project_push.branch_name = 'merge-train'
project_push.branch_name = branch_name
project_push.file_name = "another_file.txt"
project_push.file_content = "merge me"
end
......@@ -93,7 +98,7 @@ module QA
# Create a merge request to merge the branch we just created
Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = @project
merge_request.source_branch = 'merge-train'
merge_request.source_branch = branch_name
merge_request.no_preparation = true
end.visit!
......
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