Commit 22e1476d authored by Tomislav Nikić's avatar Tomislav Nikić Committed by Sanad Liaquat

Reverting a merge request E2E test

parent 3821a02c
......@@ -130,6 +130,7 @@ export default {
size="small"
category="secondary"
variant="warning"
data-qa-selector="revert_button"
@click="openRevertModal"
>
{{ revertLabel }}
......
......@@ -108,6 +108,7 @@ module QA
end
view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue' do
element :revert_button
element :cherry_pick_button
end
......@@ -368,6 +369,11 @@ module QA
click_element(:cherry_pick_button, Page::Component::CommitModal)
click_element(:submit_commit_button)
end
def revert_change!
click_element(:revert_button, Page::Component::CommitModal)
click_element(:submit_commit_button)
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