[test-only] ApiTest. Disable/enable user (#5639)

This commit is contained in:
Viktor Scharf
2023-03-06 16:52:55 +05:45
committed by GitHub
parent 1c88d445bd
commit 1e1b4379ae
9 changed files with 286 additions and 65 deletions
@@ -16,8 +16,8 @@ Feature: get users
When user "Alice" gets information of user "Brian" using Graph API
Then the HTTP status code should be "200"
And the user retrieve API response should contain the following information:
| displayName | id | mail | onPremisesSamAccountName |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
Scenario: non-admin user tries to get the information of a user
@@ -30,9 +30,19 @@ Feature: get users
When user "Alice" gets all users using the Graph API
Then the HTTP status code should be "200"
And the API response should contain following users with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
Scenario: admin user gets all users include disabled users
Given the user "Alice" has disabled user "Brian" using the Graph API
When user "Alice" gets all users using the Graph API
Then the HTTP status code should be "200"
And the API response should contain following users with the information:
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | false |
Scenario: non-admin user tries to get all users
@@ -45,8 +55,8 @@ Feature: get users
When the user "Alice" gets user "Brian" along with his drive information using Graph API
Then the HTTP status code should be "200"
And the user retrieve API response should contain the following information:
| displayName | id | mail | onPremisesSamAccountName |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
And the user retrieve API response should contain the following drive information:
| driveType | personal |
| driveAlias | personal/brian |
@@ -63,8 +73,8 @@ Feature: get users
When the user "Brian" gets his drive information using Graph API
Then the HTTP status code should be "200"
And the user retrieve API response should contain the following information:
| displayName | id | mail | onPremisesSamAccountName |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
And the user retrieve API response should contain the following drive information:
| driveType | personal |
| driveAlias | personal/brian |
@@ -85,8 +95,8 @@ Feature: get users
When the user "Alice" gets user "Brian" along with his group information using Graph API
Then the HTTP status code should be "200"
And the user retrieve API response should contain the following information:
| displayName | id | mail | onPremisesSamAccountName | memberOf |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | tea-lover, coffee-lover |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled | memberOf |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true | tea-lover, coffee-lover |
Scenario: non-admin user tries to get the group information of a user
@@ -100,6 +110,7 @@ Feature: get users
Scenario: admin user gets all users of certain groups
Given user "Carol" has been created with default attributes and without skeleton files
And the user "Alice" has disabled user "Carol" using the Graph API
And group "tea-lover" has been created
And group "coffee-lover" has been created
And user "Alice" has been added to group "tea-lover"
@@ -108,22 +119,21 @@ Feature: get users
When the user "Alice" gets all users of the group "tea-lover" using the Graph API
Then the HTTP status code should be "200"
And the API response should contain following users with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
But the API response should not contain following user with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Carol King | %uuid_v4% | carol@example.org | Carol |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Carol King | %uuid_v4% | carol@example.org | Carol | false |
When the user "Alice" gets all users of two groups "tea-lover,coffee-lover" using the Graph API
Then the HTTP status code should be "200"
And the API response should contain following user with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
But the API response should not contain following users with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
| Carol King | %uuid_v4% | carol@example.org | Carol |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
Scenario Outline: non admin user tries to get users of certain groups
Given the administrator has given "Brian" the role "<role>" using the settings api
@@ -148,20 +158,20 @@ Feature: get users
When the user "Alice" gets all users with role "Space Admin" using the Graph API
Then the HTTP status code should be "200"
And the API response should contain following users with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| Carol King | %uuid_v4% | carol@example.org | Carol |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
But the API response should not contain following user with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
When the user "Alice" gets all users with role "Space Admin" and member of the group "tea-lover" using the Graph API
Then the HTTP status code should be "200"
And the API response should contain following users with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
But the API response should not contain following user with the information:
| displayName | id | mail | onPremisesSamAccountName |
| Carol King | %uuid_v4% | carol@example.org | Carol |
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
Scenario Outline: non-admin user tries to get users with a certain role