Commit 2f8f6bab authored by Dan Davison's avatar Dan Davison

Merge branch 'tomi/090321/cherry_picking_test' into 'master'

Cherry picking from a merge request | E2E

See merge request gitlab-org/gitlab!56662
parents 1dd6db14 43685720
......@@ -47,6 +47,7 @@ export default {
{ variant: 'success' },
{ category: 'primary' },
{ 'data-testid': 'submit-commit' },
{ 'data-qa-selector': 'submit_commit_button' },
],
},
actionCancel: {
......
......@@ -151,6 +151,7 @@ export default {
v-gl-tooltip.hover
:title="cherryPickTitle"
size="small"
data-qa-selector="cherry_pick_button"
@click="openCherryPickModal"
>
{{ cherryPickLabel }}
......
......@@ -500,6 +500,7 @@ module QA
autoload :Wiki, 'qa/page/component/wiki'
autoload :WikiSidebar, 'qa/page/component/wiki_sidebar'
autoload :WikiPageForm, 'qa/page/component/wiki_page_form'
autoload :CommitModal, 'qa/page/component/commit_modal'
module Issuable
autoload :Common, 'qa/page/component/issuable/common'
......
# frozen_string_literal: true
module QA
module Page
module Component
class CommitModal < Page::Base
view 'app/assets/javascripts/projects/commit/components/form_modal.vue' do
element :submit_commit_button, required: true
end
end
end
end
end
......@@ -107,6 +107,10 @@ module QA
element :suggestion_button
end
view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue' do
element :cherry_pick_button
end
def start_review
click_element(:start_review_button)
......@@ -359,6 +363,11 @@ module QA
def apply_suggestions_batch
all_elements(:apply_suggestions_batch_button, minimum: 1).first.click
end
def cherry_pick!
click_element(:cherry_pick_button, Page::Component::CommitModal)
click_element(:submit_commit_button)
end
end
end
end
......
......@@ -35,7 +35,7 @@ module QA
attribute :target do
Repository::ProjectPush.fabricate! do |resource|
resource.project = project
resource.branch_name = project.default_branch
resource.branch_name = target_branch
resource.new_branch = @target_new_branch
resource.remote_branch = target_branch
end
......@@ -62,6 +62,7 @@ module QA
@labels = []
@file_name = "added_file-#{SecureRandom.hex(8)}.txt"
@file_content = "File Added"
@target_branch = "master"
@target_new_branch = true
@no_preparation = false
@wait_for_merge = true
......
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
describe 'Cherry picking from a merge request' do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project'
project.initialize_with_readme = true
end
end
let(:feature_mr) do
Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = project
merge_request.target_branch = 'development'
merge_request.target_new_branch = true
end
end
before do
Flow::Login.sign_in
end
it 'cherry picks a basic merge request', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1616' do
feature_mr.visit!
Page::MergeRequest::Show.perform do |merge_request|
merge_request.merge!
merge_request.cherry_pick!
end
Page::MergeRequest::New.perform do |merge_request|
expect(merge_request).to have_content('The merge request has been successfully cherry-picked')
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