Commit 6514b893 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'acunskis-import-members-validation' into 'master'

E2E: Validate members are imported for bulk group import

See merge request gitlab-org/gitlab!72101
parents 0e555862 1098a3ba
......@@ -78,6 +78,22 @@ module QA
end
end
# Get group members
#
# @return [Array<QA::Resource::User>]
def members
parse_body(api_get_from("#{api_get_path}/members")).map do |member|
User.init do |resource|
resource.api_client = api_client
resource.id = member[:id]
resource.name = member[:name]
resource.username = member[:username]
resource.email = member[:email]
resource.access_level = member[:access_level]
end
end
end
# API get path
#
# @return [String]
......
......@@ -7,13 +7,18 @@ module QA
attr_reader :unique_id
attr_writer :username, :password
attr_accessor :admin, :provider, :extern_uid, :expect_fabrication_success, :hard_delete_on_api_removal
attribute :id
attribute :name
attribute :first_name
attribute :last_name
attribute :email
attr_accessor :admin,
:provider,
:extern_uid,
:expect_fabrication_success,
:hard_delete_on_api_removal,
:access_level
attributes :id,
:name,
:first_name,
:last_name,
:email
def initialize
@admin = false
......
......@@ -126,6 +126,33 @@ module QA
end
end
context 'with group members' do
let(:member) do
Resource::User.fabricate_via_api! do |usr|
usr.api_client = admin_api_client
usr.hard_delete_on_api_removal = true
end
end
before do
member.set_public_email
source_group.add_member(member, Resource::Members::AccessLevel::DEVELOPER)
end
after do
member.remove_via_api!
end
it 'adds members for imported group' do
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
imported_member = imported_group.reload!.members.find { |usr| usr.username == member.username }
expect(imported_member).not_to be_nil
expect(imported_member.access_level).to eq(Resource::Members::AccessLevel::DEVELOPER)
end
end
after do
user.remove_via_api!
ensure
......
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