Commit ebe20d72 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-shl-fix-prevent-fork-e2e-spec' into 'master'

Fix prevent prevent_forking_outside_group_spec e2e test

See merge request gitlab-org/gitlab!65339
parents e584472b 691c707f
......@@ -9,10 +9,6 @@ module QA
element :fork_namespace_button
end
view 'app/assets/javascripts/pages/projects/forks/new/components/fork_groups_list.vue' do
element :fork_groups_list_search_field
end
view 'app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue' do
element :fork_namespace_dropdown
element :fork_project_button
......@@ -27,8 +23,8 @@ module QA
end
end
def search_for_group(group_name)
find_element(:fork_groups_list_search_field).set(group_name)
def fork_namespace_dropdown_values
find_element(:fork_namespace_dropdown).all(:option).map { |option| option.text.tr("\n", '').strip }
end
end
end
......
......@@ -26,10 +26,13 @@ module QA
end
it 'allows forking outside of group', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1774' do
visit_project_and_search_group_for_fork
project.visit!
Page::Project::Show.perform(&:fork_project)
all_namespaces_for_fork = Page::Project::Fork::New.perform(&:fork_namespace_dropdown_values)
expect(page).to have_text(group_for_fork.path)
expect(page).to have_text('Select a namespace to fork the project')
expect(all_namespaces_for_fork).to include(group_for_fork.path)
end
end
......@@ -39,10 +42,13 @@ module QA
end
it 'does not allow forking outside of group', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1775' do
visit_project_and_search_group_for_fork
project.visit!
Page::Project::Show.perform(&:fork_project)
expect(page).not_to have_text(group_for_fork.path)
expect(page).not_to have_text('Select a namespace to fork the project')
all_namespaces_for_fork = Page::Project::Fork::New.perform(&:fork_namespace_dropdown_values)
expect(all_namespaces_for_fork).not_to include(group_for_fork.path)
end
end
......@@ -60,15 +66,6 @@ module QA
general_setting.send("set_prevent_forking_outside_group_#{enabled_or_disabled}")
end
end
def visit_project_and_search_group_for_fork
project.visit!
Page::Project::Show.perform(&:fork_project)
Page::Project::Fork::New.perform do |fork_new|
fork_new.search_for_group(group_for_fork.path)
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