Commit 1cdc91a9 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'remove-transfer-group-spec-and-update-group-settings-spec' into 'master'

Remove E2E transfer_group_spec and Update Feature Spec group_settings_spec

See merge request gitlab-org/gitlab!80769
parents 5b29d63a 56fde3e4
......@@ -32,7 +32,6 @@
"qa/specs/features/ee/browser_ui/10_protect/policy_alerts_list_spec.rb": 14.055217947000074,
"qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_with_multiple_files_spec.rb": 14.212461153999811,
"qa/specs/features/ee/api/2_plan/epics_milestone_dates_spec.rb": 14.218627059000028,
"qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb": 14.295524570999987,
"qa/specs/features/api/1_manage/project_access_token_spec.rb": 14.394589879999785,
"qa/specs/features/ee/browser_ui/2_plan/multiple_assignees_for_issues/four_assignees_spec.rb": 14.505683429000328,
"qa/specs/features/browser_ui/2_plan/related_issues/related_issues_spec.rb": 14.804579386000114,
......
......@@ -102,16 +102,6 @@ module QA
click_element(:save_permissions_changes_button)
end
def transfer_group(target_group, source_group)
expand_content :advanced_settings_content
select_namespace(target_group)
click_element(:transfer_button)
fill_confirmation_text(source_group)
confirm_transfer
end
end
end
end
......
# frozen_string_literal: true
module QA
RSpec.describe 'Manage' do
describe 'Subgroup transfer' do
let(:source_group) do
Resource::Group.fabricate_via_api! do |group|
group.path = "source-group-for-transfer_#{SecureRandom.hex(8)}"
end
end
let!(:target_group) do
Resource::Group.fabricate_via_api! do |group|
group.path = "target-group-for-transfer_#{SecureRandom.hex(8)}"
end
end
let(:sub_group_for_transfer) do
Resource::Group.fabricate_via_api! do |group|
group.path = "subgroup-for-transfer_#{SecureRandom.hex(8)}"
group.sandbox = source_group
end
end
before do
Flow::Login.sign_in
sub_group_for_transfer.visit!
end
it 'transfers a subgroup to another group',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347692' do
Page::Group::Menu.perform(&:click_group_general_settings_item)
Page::Group::Settings::General.perform do |general|
general.transfer_group(target_group.path, sub_group_for_transfer.path)
sub_group_for_transfer.sandbox = target_group
sub_group_for_transfer.reload!
end
expect(page).to have_text("Group '#{sub_group_for_transfer.path}' was successfully transferred.")
expect(page.driver.current_url).to include(sub_group_for_transfer.full_path)
end
after do
source_group&.remove_via_api!
target_group&.remove_via_api!
sub_group_for_transfer&.remove_via_api!
end
end
end
end
......@@ -154,34 +154,52 @@ RSpec.describe 'Edit group settings' do
namespace_select.find('button').click
namespace_select.find('.dropdown-menu p', text: target_group_name, match: :first).click
click_button "Transfer group"
click_button 'Transfer group'
end
page.within(confirm_modal) do
expect(page).to have_text "You are going to transfer #{selected_group.name} to another namespace. Are you ABSOLUTELY sure? "
expect(page).to have_text "You are going to transfer #{selected_group.name} to another namespace. Are you ABSOLUTELY sure?"
fill_in "confirm_name_input", with: selected_group.name
click_button "Confirm"
fill_in 'confirm_name_input', with: selected_group.name
click_button 'Confirm'
end
expect(page).to have_text "Group '#{selected_group.name}' was successfully transferred."
expect(current_url).to include(selected_group.reload.full_path)
end
end
context 'with a sub group' do
context 'from a subgroup' do
let(:selected_group) { create(:group, path: 'foo-subgroup', parent: group) }
let(:target_group_name) { "No parent group" }
context 'to no parent group' do
let(:target_group_name) { 'No parent group' }
it_behaves_like 'can transfer the group'
end
context 'with a root group' do
context 'to a different parent group' do
let(:target_group) { create(:group, path: 'foo-parentgroup') }
let(:target_group_name) { target_group.name }
before do
target_group.add_owner(user)
end
it_behaves_like 'can transfer the group'
end
end
context 'from a root group' do
let(:selected_group) { create(:group, path: 'foo-rootgroup') }
context 'to a parent group' do
let(:target_group_name) { group.name }
it_behaves_like 'can transfer the group'
end
end
end
context 'disable email notifications' do
it 'is visible' do
......
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