[full-ci] [tests-only] unassign app role assignment of user (#6030)

* Added scenario to unassign the role of user

* Added scenario,admin tries to unassign the own role

* Addressed reviews

* refactor

---------

Co-authored-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
Prarup Gurung
2023-05-15 14:30:24 +05:45
committed by GitHub
parent d6b4632e1c
commit 4b04870ade
4 changed files with 184 additions and 0 deletions
@@ -0,0 +1,32 @@
@api
Feature: unassign user role
As an admin
I want to unassign the role of user
So that the role of user is set to default
Background:
Given user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: admin user unassigns the role of another user
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has assigned the role "Admin" to user "Alice" using the Graph API
And the administrator has assigned the role "<role>" to user "Brian" using the Graph API
When user "Alice" unassigns the role of user "Brian" using the Graph API
Then the HTTP status code should be "204"
And user "Brian" should not have any role assigned
When user "Brian" uploads file with content "this step will assign the role to default" to "assign-to-default.txt" using the WebDAV API
And user "Brian" should have the role "User" assigned
Examples:
| role |
| Admin |
| Space Admin |
| User |
| Guest |
@issue-6035
Scenario: admin user tries to unassign his/her own role
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
When user "Alice" tries to unassign the role of user "Alice" using the Graph API
Then the HTTP status code should be "403"
And user "Alice" should have the role "Admin" assigned