Commit ef278f6e authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'ml-update-fork-e2e-tests' into 'master'

Update fork e2e tests for new UI

See merge request gitlab-org/gitlab!58207
parents 91f693bb 86b39915
......@@ -218,6 +218,7 @@ export default {
id="fork-url"
v-model="selectedNamespace"
data-testid="fork-url-input"
data-qa-selector="fork_namespace_dropdown"
required
>
<template slot="first">
......@@ -291,6 +292,7 @@ export default {
category="primary"
variant="confirm"
data-testid="submit-button"
data-qa-selector="fork_project_button"
:loading="isSaving"
>
{{ s__('ForkProject|Fork project') }}
......
......@@ -13,8 +13,18 @@ module QA
element :fork_groups_list_search_field
end
def choose_namespace(namespace = Runtime::Namespace.path)
view 'app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue' do
element :fork_namespace_dropdown
element :fork_project_button
end
def fork_project(namespace = Runtime::Namespace.path)
if has_element?(:fork_namespace_button, wait: 0)
click_element(:fork_namespace_button, name: namespace)
else
select_element(:fork_namespace_dropdown, namespace)
click_element(:fork_project_button)
end
end
def search_for_group(group_name)
......
......@@ -3,6 +3,8 @@
module QA
module Resource
class Fork < Base
attr_accessor :namespace_path
attribute :name do
upstream.name
end
......@@ -31,6 +33,8 @@ module QA
def fabricate!
populate(:upstream, :user)
namespace_path ||= user.name
# Sign out as admin and sign is as the fork user
Page::Main::Menu.perform(&:sign_out)
Runtime::Browser.visit(:gitlab, Page::Main::Login)
......@@ -43,11 +47,11 @@ module QA
Page::Project::Show.perform(&:fork_project)
Page::Project::Fork::New.perform do |fork_new|
fork_new.choose_namespace(user.name)
fork_new.fork_project(namespace_path)
end
Page::Layout::Banner.perform do |banner|
banner.has_notice?('The project was successfully forked.')
Page::Project::Show.perform do |project_page|
raise ResourceFabricationFailedError, "Forking failed!" unless project_page.forked_from?(upstream.name)
end
populate(:project)
......
......@@ -2,14 +2,12 @@
module QA
RSpec.describe 'Create' do
describe 'Merge request creation from fork' do
let!(:merge_request) do
Resource::MergeRequestFromFork.fabricate_via_browser_ui! do |merge_request|
describe 'Merge request creation from fork', :smoke do
it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1701' do
merge_request = Resource::MergeRequestFromFork.fabricate_via_browser_ui! do |merge_request|
merge_request.fork_branch = 'feature-branch'
end
end
it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1701' do
Flow::Login.while_signed_in do
merge_request.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