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
8bc03726
Commit
8bc03726
authored
Feb 23, 2022
by
Valerie Burton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Personal Project Permissions Spec
Adds E2E test for testing permissions related to project owners work
parent
1cb08250
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
208 additions
and
0 deletions
+208
-0
app/assets/javascripts/issues/show/components/header_actions.vue
...ets/javascripts/issues/show/components/header_actions.vue
+2
-0
qa/qa/page/project/issue/show.rb
qa/qa/page/project/issue/show.rb
+15
-0
qa/qa/specs/features/browser_ui/1_manage/project/personal_project_permissions_spec.rb
..._ui/1_manage/project/personal_project_permissions_spec.rb
+191
-0
No files found.
app/assets/javascripts/issues/show/components/header_actions.vue
View file @
8bc03726
...
...
@@ -290,6 +290,7 @@ export default {
class=
"gl-display-none gl-sm-display-inline-flex! gl-ml-3"
icon=
"ellipsis_v"
category=
"tertiary"
data-qa-selector=
"issue_actions_ellipsis_dropdown"
:text=
"dropdownText"
:text-sr-only=
"true"
data-testid=
"desktop-dropdown"
...
...
@@ -323,6 +324,7 @@ export default {
<gl-dropdown-item
v-gl-modal=
"$options.deleteModalId"
variant=
"danger"
data-qa-selector=
"delete_issue_button"
@
click=
"track('click_dropdown')"
>
{{
deleteButtonText
}}
...
...
qa/qa/page/project/issue/show.rb
View file @
8bc03726
...
...
@@ -18,6 +18,8 @@ module QA
view
'app/assets/javascripts/issues/show/components/header_actions.vue'
do
element
:close_issue_button
element
:reopen_issue_button
element
:issue_actions_ellipsis_dropdown
element
:delete_issue_button
end
view
'app/assets/javascripts/related_issues/components/add_issuable_form.vue'
do
...
...
@@ -69,6 +71,19 @@ module QA
def
has_reopen_issue_button?
has_element?
(
:reopen_issue_button
)
end
def
has_delete_issue_button?
click_element
(
:issue_actions_ellipsis_dropdown
)
has_element?
(
:delete_issue_button
)
end
def
delete_issue
click_element
(
:issue_actions_ellipsis_dropdown
)
click_element
(
:delete_issue_button
)
within
(
'.modal-content'
)
{
click_button
'Delete issue'
}
wait_for_requests
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/1_manage/project/personal_project_permissions_spec.rb
0 → 100644
View file @
8bc03726
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Manage'
,
:requires_admin
do
describe
'Personal project permissions'
do
before
(
:context
)
do
@admin_api_client
=
Runtime
::
API
::
Client
.
as_admin
@feature_flag
=
:personal_project_owner_with_owner_access
@feature_flag_state
=
Runtime
::
Feature
.
enabled?
(
@feature_flag
)
end
after
(
:context
)
do
Runtime
::
Feature
.
set
({
@feature_flag
=>
@feature_flag_state
})
if
@feature_flag_state
!=
Runtime
::
Feature
.
enabled?
(
@feature_flag
)
end
shared_examples
'has correct role and Owner permissions'
do
|
role
,
testcase
|
it
"has
#{
role
}
role with Owner permissions"
,
testcase:
testcase
do
Page
::
Dashboard
::
Projects
.
perform
do
|
projects
|
expect
(
projects
).
to
have_project_with_access_role
(
project
.
name
,
role
)
end
issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue
|
issue
.
delete_issue
end
Page
::
Project
::
Issue
::
Index
.
perform
do
|
index
|
expect
(
index
).
not_to
have_issue
(
issue
)
end
end
end
shared_examples
'has correct role and no Owner permissions'
do
|
role
,
testcase
|
it
"has
#{
role
}
role without Owner permissions"
,
testcase:
testcase
do
Page
::
Dashboard
::
Projects
.
perform
do
|
projects
|
expect
(
projects
).
to
have_project_with_access_role
(
project
.
name
,
role
)
end
issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue
|
expect
(
issue
).
not_to
have_delete_issue_button
end
end
end
context
'with personal_project_owner_with_owner_access feature enabled'
do
let
(
:owner
)
do
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
api_client
=
@admin_api_client
end
end
let
(
:owner_api_client
)
{
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
owner
)
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
api_client
=
owner_api_client
project
.
name
=
'qa-owner-as-owner-project'
project
.
personal_namespace
=
owner
.
username
end
end
before
do
Runtime
::
Feature
.
enable
(
@feature_flag
)
project
end
after
do
project
&
.
remove_via_api!
owner
&
.
remove_via_api!
end
context
'when user is added as Owner'
do
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
api_client
=
owner_api_client
issue
.
project
=
project
issue
.
title
=
'Test Owner deletes issue'
end
end
before
do
Flow
::
Login
.
sign_in
(
as:
owner
)
end
it_behaves_like
'has correct role and Owner permissions'
,
'Owner'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/352542'
end
context
'when user is added as Maintainer'
do
let
(
:maintainer
)
do
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
api_client
=
@admin_api_client
end
end
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
api_client
=
owner_api_client
issue
.
project
=
project
issue
.
title
=
'Test Maintainer deletes issue'
end
end
before
do
project
.
add_member
(
maintainer
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
Flow
::
Login
.
sign_in
(
as:
maintainer
)
end
after
do
maintainer
&
.
remove_via_api!
end
it_behaves_like
'has correct role and no Owner permissions'
,
'Maintainer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/352607'
end
end
context
'with personal_project_owner_with_owner_access feature disabled'
do
let
(
:owner
)
do
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
api_client
=
@admin_api_client
end
end
let
(
:owner_api_client
)
{
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
owner
)
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
api_client
=
owner_api_client
project
.
name
=
'qa-owner-as-maintainer-project'
project
.
personal_namespace
=
owner
.
username
end
end
before
do
Runtime
::
Feature
.
disable
(
@feature_flag
)
project
end
after
do
project
&
.
remove_via_api!
owner
&
.
remove_via_api!
end
context
'when user is added as Owner'
do
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
api_client
=
owner_api_client
issue
.
project
=
project
issue
.
title
=
'Test Owner deletes issue'
end
end
before
do
Flow
::
Login
.
sign_in
(
as:
owner
)
end
it_behaves_like
'has correct role and Owner permissions'
,
'Maintainer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/352621'
end
context
'when user is added as Maintainer'
do
let
(
:maintainer
)
do
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
api_client
=
@admin_api_client
end
end
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
api_client
=
owner_api_client
issue
.
project
=
project
issue
.
title
=
'Test Maintainer deletes issue'
end
end
before
do
project
.
add_member
(
maintainer
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
Flow
::
Login
.
sign_in
(
as:
maintainer
)
end
after
do
maintainer
&
.
remove_via_api!
end
it_behaves_like
'has correct role and no Owner permissions'
,
'Maintainer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/352622'
end
end
end
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