Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8acbce17
Commit
8acbce17
authored
Jan 10, 2022
by
Valerie Burton
Committed by
Ramya Authappan
Jan 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and Refactor invite_group Method and Update invite_group_to_project_spec
parent
bf05ea0d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
26 deletions
+32
-26
qa/qa/page/component/invite_members_modal.rb
qa/qa/page/component/invite_members_modal.rb
+24
-21
qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb
...owser_ui/1_manage/project/invite_group_to_project_spec.rb
+8
-5
No files found.
qa/qa/page/component/invite_members_modal.rb
View file @
8acbce17
...
...
@@ -47,26 +47,16 @@ module QA
fill_element
:members_token_select_input
,
username
Support
::
WaitForRequests
.
wait_for_requests
click_button
username
# Guest option is selected by default, skipping these steps if desired option is 'Guest'
unless
access_level
==
'Guest'
click_element
:access_level_dropdown
click_button
access_level
end
click_element
:invite_button
set_access_level
(
access_level
)
end
Support
::
WaitForRequests
.
wait_for_requests
page
.
refresh
send_invite
end
def
invite_group
(
group_name
,
group_access
=
Resource
::
Members
::
AccessLevel
::
GUEST
)
def
invite_group
(
group_name
,
access_level
=
'Guest'
)
open_invite_group_modal
fill_element
:access_level_dropdown
,
with:
group_access
within_element
(
:invite_members_modal_content
)
do
click_button
'Select a group'
# Helps stabilize race condition with concurrent group API calls while searching
...
...
@@ -74,13 +64,26 @@ module QA
send_keys_to_element
(
:group_select_dropdown_search_field
,
group_name
)
Support
::
WaitForRequests
.
wait_for_requests
click_button
group_name
set_access_level
(
access_level
)
end
click_element
:invite_button
send_invite
end
Support
::
WaitForRequests
.
wait_for_requests
private
def
set_access_level
(
access_level
)
# Guest option is selected by default, skipping these steps if desired option is 'Guest'
unless
access_level
==
'Guest'
click_element
:access_level_dropdown
click_button
access_level
end
end
def
send_invite
click_element
:invite_button
Support
::
WaitForRequests
.
wait_for_requests
page
.
refresh
end
end
...
...
qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb
View file @
8acbce17
...
...
@@ -5,10 +5,10 @@ module QA
RSpec
.
describe
'Manage'
,
:requires_admin
,
:transient
,
issue:
'https://gitlab.com/gitlab-org/gitlab/-/issues/349379'
do
describe
'Invite group'
do
shared_examples
'invites group to project'
do
it
'verifies group is added and members can access project'
do
it
'verifies group is added and members can access project
with correct access level
'
do
Page
::
Project
::
Menu
.
perform
(
&
:click_members
)
Page
::
Project
::
Members
.
perform
do
|
project_members
|
project_members
.
invite_group
(
group
.
path
)
project_members
.
invite_group
(
group
.
path
,
'Developer'
)
expect
(
project_members
).
to
have_group
(
group
.
path
)
end
...
...
@@ -16,7 +16,7 @@ module QA
Flow
::
Login
.
sign_in
(
as:
@user
)
Page
::
Dashboard
::
Projects
.
perform
do
|
projects
|
expect
(
projects
).
to
have_project_with_access_role
(
project
.
name
,
'
Guest
'
)
expect
(
projects
).
to
have_project_with_access_role
(
project
.
name
,
'
Developer
'
)
end
project
.
visit!
...
...
@@ -28,13 +28,13 @@ module QA
end
before
(
:context
)
do
Runtime
::
Feature
.
enable
(
:invite_members_group_modal
)
@user
=
Resource
::
User
.
fabricate_or_use
(
Runtime
::
Env
.
gitlab_qa_username_1
,
Runtime
::
Env
.
gitlab_qa_password_1
)
end
before
do
Runtime
::
Feature
.
enable
(
:invite_members_group_modal
)
Flow
::
Login
.
sign_in
group
.
add_member
(
@user
,
Resource
::
Members
::
AccessLevel
::
GUEST
)
group
.
add_member
(
@user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
project
.
visit!
end
...
...
@@ -78,6 +78,9 @@ module QA
after
do
project
&
.
remove_via_api!
group
&
.
remove_via_api!
end
after
(
:context
)
do
Runtime
::
Feature
.
disable
(
:invite_members_group_modal
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment