Commit 2cae176d authored by Tomislav Nikić's avatar Tomislav Nikić Committed by Mark Lapierre

Fixing a fork based merge request test

parent 4fc1e318
......@@ -14,6 +14,7 @@ module QA
resource.add_name_uuid = false
resource.name = name
resource.path_with_namespace = "#{user.username}/#{name}"
resource.api_client = @api_client
end
end
......@@ -69,6 +70,12 @@ module QA
populate(:project)
end
def remove_via_api!
project.remove_via_api!
upstream.remove_via_api!
user.remove_via_api! unless Specs::Helpers::ContextSelector.dot_com?
end
def api_get_path
"/projects/#{CGI.escape(path_with_namespace)}"
end
......
......@@ -6,7 +6,7 @@ module QA
attr_accessor :fork_branch
attribute :fork do
Fork.fabricate_via_browser_ui!
Fork.fabricate_via_api!
end
attribute :push do
......@@ -23,8 +23,15 @@ module QA
fork.project.visit!
Page::Project::Show.perform(&:new_merge_request)
Page::MergeRequest::New.perform(&:create_merge_request)
mr_url = Flow::Login.while_signed_in(as: fork.user) do
Page::Project::Show.perform(&:new_merge_request)
Page::MergeRequest::New.perform(&:create_merge_request)
current_url
end
Flow::Login.sign_in
visit(mr_url)
end
def fabricate_via_api!
......
# frozen_string_literal: true
module QA
RSpec.describe 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/332588', type: :investigating } do
RSpec.describe 'Create' do
describe 'Merge request creation from fork' do
# TODO: Please add this back to :smoke suite as soon as https://gitlab.com/gitlab-org/gitlab/-/issues/332588 is addressed
it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1305' do
merge_request = Resource::MergeRequestFromFork.fabricate_via_browser_ui! do |merge_request|
let(:merge_request) do
Resource::MergeRequestFromFork.fabricate_via_browser_ui! do |merge_request|
merge_request.fork_branch = 'feature-branch'
end
end
before do
Flow::Login.sign_in
end
Flow::Login.while_signed_in do
merge_request.visit!
after do
merge_request.fork.remove_via_api!
end
it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1305' do
merge_request.visit!
Page::MergeRequest::Show.perform do |merge_request|
merge_request.merge!
Page::MergeRequest::Show.perform do |merge_request|
merge_request.merge!
expect(merge_request).to have_content('The changes were merged')
end
expect(merge_request).to be_merged
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