Commit 6d7ab904 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'tomi/250321/revert_change' into 'master'

Reverting a merge request | E2E

See merge request gitlab-org/gitlab!57500
parents f474a677 22e1476d
...@@ -130,6 +130,7 @@ export default { ...@@ -130,6 +130,7 @@ export default {
size="small" size="small"
category="secondary" category="secondary"
variant="warning" variant="warning"
data-qa-selector="revert_button"
@click="openRevertModal" @click="openRevertModal"
> >
{{ revertLabel }} {{ revertLabel }}
......
...@@ -108,6 +108,7 @@ module QA ...@@ -108,6 +108,7 @@ module QA
end end
view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue' do view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue' do
element :revert_button
element :cherry_pick_button element :cherry_pick_button
end end
...@@ -368,6 +369,11 @@ module QA ...@@ -368,6 +369,11 @@ module QA
click_element(:cherry_pick_button, Page::Component::CommitModal) click_element(:cherry_pick_button, Page::Component::CommitModal)
click_element(:submit_commit_button) click_element(:submit_commit_button)
end end
def revert_change!
click_element(:revert_button, Page::Component::CommitModal)
click_element(:submit_commit_button)
end
end end
end end
end end
......
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
describe 'Merged merge request' do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'revert'
end
end
let(:revertable_merge_request) do
Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = project
end
end
before do
Flow::Login.sign_in
end
it 'can be reverted', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1745' do
revertable_merge_request.visit!
Page::MergeRequest::Show.perform do |merge_request|
merge_request.merge!
merge_request.revert_change!
end
Page::MergeRequest::New.perform(&:create_merge_request)
Page::MergeRequest::Show.perform do |merge_request|
merge_request.click_diffs_tab
expect(merge_request).to have_file(revertable_merge_request.file_name)
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