Added test for sending share invitation to disabled user
This commit is contained in:
@@ -276,7 +276,7 @@ Feature: add users to group
|
|||||||
Given these groups have been created:
|
Given these groups have been created:
|
||||||
| groupname | comment |
|
| groupname | comment |
|
||||||
| sales | normal group |
|
| sales | normal group |
|
||||||
And the user "Admin" has disabled user "Alice" using the Graph API
|
And the user "Admin" has disabled user "Alice"
|
||||||
When the administrator adds the following users to the following groups using the Graph API
|
When the administrator adds the following users to the following groups using the Graph API
|
||||||
| username | groupname |
|
| username | groupname |
|
||||||
| Alice | sales |
|
| Alice | sales |
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Feature: create user
|
|||||||
Scenario: user cannot be created with the name of the disabled user
|
Scenario: user cannot be created with the name of the disabled user
|
||||||
Given user "Brian" has been created with default attributes and without skeleton files
|
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 "Admin" to user "Alice" using the Graph API
|
||||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
And the user "Alice" has disabled user "Brian"
|
||||||
When the user "Alice" creates a new user with the following attributes using the Graph API:
|
When the user "Alice" creates a new user with the following attributes using the Graph API:
|
||||||
| userName | Brian |
|
| userName | Brian |
|
||||||
| displayName | This is another Brian |
|
| displayName | This is another Brian |
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ Feature: delete user
|
|||||||
Scenario: admin user deletes a disabled user
|
Scenario: admin user deletes a disabled user
|
||||||
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
||||||
And user "Brian" has been created with default attributes and without skeleton files
|
And user "Brian" has been created with default attributes and without skeleton files
|
||||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
And the user "Alice" has disabled user "Brian"
|
||||||
When the user "Alice" deletes a user "Brian" using the Graph API
|
When the user "Alice" deletes a user "Brian" using the Graph API
|
||||||
Then the HTTP status code should be "204"
|
Then the HTTP status code should be "204"
|
||||||
And user "Brian" should not exist
|
And user "Brian" should not exist
|
||||||
@@ -124,7 +124,7 @@ Feature: delete user
|
|||||||
And user "Carol" has been created with default attributes and without skeleton files
|
And user "Carol" has been created with default attributes and without skeleton files
|
||||||
And the administrator has assigned the role "<role>" to user "Brian" using the Graph API
|
And the administrator has assigned the role "<role>" to user "Brian" using the Graph API
|
||||||
And the administrator has assigned the role "<userRole>" to user "Carol" using the Graph API
|
And the administrator has assigned the role "<userRole>" to user "Carol" using the Graph API
|
||||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
And the user "Alice" has disabled user "Brian"
|
||||||
When the user "Carol" deletes a user "Brian" using the Graph API
|
When the user "Carol" deletes a user "Brian" using the Graph API
|
||||||
Then the HTTP status code should be "401"
|
Then the HTTP status code should be "401"
|
||||||
And user "Brian" should exist
|
And user "Brian" should exist
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ Feature: edit user
|
|||||||
| displayName | sam |
|
| displayName | sam |
|
||||||
| email | sam@example.com |
|
| email | sam@example.com |
|
||||||
| password | 1234 |
|
| password | 1234 |
|
||||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
And the user "Alice" has disabled user "Brian"
|
||||||
When the user "Alice" changes the user name of user "sam" to "Brian" using the Graph API
|
When the user "Alice" changes the user name of user "sam" to "Brian" using the Graph API
|
||||||
Then the HTTP status code should be "409"
|
Then the HTTP status code should be "409"
|
||||||
And the user information of "sam" should match this JSON schema
|
And the user information of "sam" should match this JSON schema
|
||||||
@@ -410,7 +410,7 @@ Feature: edit user
|
|||||||
|
|
||||||
|
|
||||||
Scenario: admin user enables disabled user
|
Scenario: admin user enables disabled user
|
||||||
Given the user "Alice" has disabled user "Brian" using the Graph API
|
Given the user "Alice" has disabled user "Brian"
|
||||||
When the user "Alice" enables user "Brian" using the Graph API
|
When the user "Alice" enables user "Brian" using the Graph API
|
||||||
Then the HTTP status code should be "200"
|
Then the HTTP status code should be "200"
|
||||||
When user "Alice" gets information of user "Brian" using Graph API
|
When user "Alice" gets information of user "Brian" using Graph API
|
||||||
@@ -454,7 +454,7 @@ Feature: edit user
|
|||||||
|
|
||||||
Scenario Outline: normal user should not be able to enable another user
|
Scenario Outline: normal user should not be able to enable another user
|
||||||
Given user "Carol" has been created with default attributes and without skeleton files
|
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 the user "Alice" has disabled user "Carol"
|
||||||
And the administrator has assigned the role "<role>" to user "Brian" using the Graph API
|
And the administrator has assigned the role "<role>" to user "Brian" using the Graph API
|
||||||
When the user "Brian" tries to enable user "Carol" using the Graph API
|
When the user "Brian" tries to enable user "Carol" using the Graph API
|
||||||
Then the HTTP status code should be "401"
|
Then the HTTP status code should be "401"
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ Feature: get users
|
|||||||
|
|
||||||
Scenario: admin user gets all users include disabled users
|
Scenario: admin user gets all users include disabled users
|
||||||
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
||||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
And the user "Alice" has disabled user "Brian"
|
||||||
When user "Alice" gets all users using the Graph API
|
When user "Alice" gets all users using the Graph API
|
||||||
Then the HTTP status code should be "200"
|
Then the HTTP status code should be "200"
|
||||||
And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match
|
And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match
|
||||||
@@ -656,7 +656,7 @@ Feature: get users
|
|||||||
Scenario: admin user gets all users of certain groups
|
Scenario: admin user gets all users of certain groups
|
||||||
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
||||||
And user "Carol" has been created with default attributes and without skeleton files
|
And 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 the user "Alice" has disabled user "Carol"
|
||||||
And group "tea-lover" has been created
|
And group "tea-lover" has been created
|
||||||
And group "coffee-lover" has been created
|
And group "coffee-lover" has been created
|
||||||
And user "Alice" has been added to group "tea-lover"
|
And user "Alice" has been added to group "tea-lover"
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ Feature: remove a user from a group
|
|||||||
And the following users have been added to the following groups
|
And the following users have been added to the following groups
|
||||||
| username | groupname |
|
| username | groupname |
|
||||||
| Alice | brand-new-group |
|
| Alice | brand-new-group |
|
||||||
And the user "Admin" has disabled user "Alice" using the Graph API
|
And the user "Admin" has disabled user "Alice"
|
||||||
When the administrator removes the following users from the following groups using the Graph API
|
When the administrator removes the following users from the following groups using the Graph API
|
||||||
| username | groupname |
|
| username | groupname |
|
||||||
| Alice | brand-new-group |
|
| Alice | brand-new-group |
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ Feature: Send a sharing invitations
|
|||||||
Given user "Alice" has uploaded file with content "to share" to "/textfile1.txt"
|
Given user "Alice" has uploaded file with content "to share" to "/textfile1.txt"
|
||||||
And user "Alice" has created folder "FolderToShare"
|
And user "Alice" has created folder "FolderToShare"
|
||||||
When user "Alice" sends the following share invitation using the Graph API:
|
When user "Alice" sends the following share invitation using the Graph API:
|
||||||
| resourceType | <resource-type> |
|
| resourceType | <resource-type> |
|
||||||
| resource | <path> |
|
| resource | <path> |
|
||||||
| space | Personal |
|
| space | Personal |
|
||||||
| sharee | Brian |
|
| sharee | Brian |
|
||||||
| shareType | user |
|
| shareType | user |
|
||||||
| permissionsRole | <permissionsRole> |
|
| permissionsRole | <permissions-role> |
|
||||||
Then the HTTP status code should be "200"
|
Then the HTTP status code should be "200"
|
||||||
And the JSON data of the response should match
|
And the JSON data of the response should match
|
||||||
"""
|
"""
|
||||||
@@ -86,16 +86,16 @@ Feature: Send a sharing invitations
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
Examples:
|
Examples:
|
||||||
| permissionsRole | resource-type | path |
|
| permissions-role | resource-type | path |
|
||||||
| Viewer | file | /textfile1.txt |
|
| Viewer | file | /textfile1.txt |
|
||||||
| File Editor | file | /textfile1.txt |
|
| File Editor | file | /textfile1.txt |
|
||||||
| Co Owner | file | /textfile1.txt |
|
| Co Owner | file | /textfile1.txt |
|
||||||
| Manager | file | /textfile1.txt |
|
| Manager | file | /textfile1.txt |
|
||||||
| Viewer | folder | FolderToShare |
|
| Viewer | folder | FolderToShare |
|
||||||
| Editor | folder | FolderToShare |
|
| Editor | folder | FolderToShare |
|
||||||
| Co Owner | folder | FolderToShare |
|
| Co Owner | folder | FolderToShare |
|
||||||
| Uploader | folder | FolderToShare |
|
| Uploader | folder | FolderToShare |
|
||||||
| Manager | folder | FolderToShare |
|
| Manager | folder | FolderToShare |
|
||||||
|
|
||||||
|
|
||||||
Scenario Outline: send share invitation to group with different roles
|
Scenario Outline: send share invitation to group with different roles
|
||||||
@@ -108,12 +108,12 @@ Feature: Send a sharing invitations
|
|||||||
And user "Alice" has uploaded file with content "to share" to "/textfile1.txt"
|
And user "Alice" has uploaded file with content "to share" to "/textfile1.txt"
|
||||||
And user "Alice" has created folder "FolderToShare"
|
And user "Alice" has created folder "FolderToShare"
|
||||||
When user "Alice" sends the following share invitation using the Graph API:
|
When user "Alice" sends the following share invitation using the Graph API:
|
||||||
| resourceType | <resource-type> |
|
| resourceType | <resource-type> |
|
||||||
| resource | <path> |
|
| resource | <path> |
|
||||||
| space | Personal |
|
| space | Personal |
|
||||||
| sharee | grp1 |
|
| sharee | grp1 |
|
||||||
| shareType | group |
|
| shareType | group |
|
||||||
| permissionsRole | <permissionsRole> |
|
| permissionsRole | <permissions-role> |
|
||||||
Then the HTTP status code should be "200"
|
Then the HTTP status code should be "200"
|
||||||
And the JSON data of the response should match
|
And the JSON data of the response should match
|
||||||
"""
|
"""
|
||||||
@@ -178,16 +178,16 @@ Feature: Send a sharing invitations
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
Examples:
|
Examples:
|
||||||
| permissionsRole | resource-type | path |
|
| permissions-role | resource-type | path |
|
||||||
| Viewer | file | /textfile1.txt |
|
| Viewer | file | /textfile1.txt |
|
||||||
| File Editor | file | /textfile1.txt |
|
| File Editor | file | /textfile1.txt |
|
||||||
| Co Owner | file | /textfile1.txt |
|
| Co Owner | file | /textfile1.txt |
|
||||||
| Manager | file | /textfile1.txt |
|
| Manager | file | /textfile1.txt |
|
||||||
| Viewer | folder | FolderToShare |
|
| Viewer | folder | FolderToShare |
|
||||||
| Editor | folder | FolderToShare |
|
| Editor | folder | FolderToShare |
|
||||||
| Co Owner | folder | FolderToShare |
|
| Co Owner | folder | FolderToShare |
|
||||||
| Uploader | folder | FolderToShare |
|
| Uploader | folder | FolderToShare |
|
||||||
| Manager | folder | FolderToShare |
|
| Manager | folder | FolderToShare |
|
||||||
|
|
||||||
|
|
||||||
Scenario Outline: send share invitation for a file to user with different permissions
|
Scenario Outline: send share invitation for a file to user with different permissions
|
||||||
@@ -591,7 +591,7 @@ Feature: Send a sharing invitations
|
|||||||
| space | Personal |
|
| space | Personal |
|
||||||
| sharee | Brian |
|
| sharee | Brian |
|
||||||
| shareType | user |
|
| shareType | user |
|
||||||
| permissionsRole | <permissionsRole> |
|
| permissionsRole | <permissions-role> |
|
||||||
| expireDate | 2043-07-15T14:00:00.000Z |
|
| expireDate | 2043-07-15T14:00:00.000Z |
|
||||||
Then the HTTP status code should be "200"
|
Then the HTTP status code should be "200"
|
||||||
And the JSON data of the response should match
|
And the JSON data of the response should match
|
||||||
@@ -664,16 +664,16 @@ Feature: Send a sharing invitations
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
Examples:
|
Examples:
|
||||||
| permissionsRole | resource-type | path |
|
| permissions-role | resource-type | path |
|
||||||
| Viewer | file | /textfile1.txt |
|
| Viewer | file | /textfile1.txt |
|
||||||
| File Editor | file | /textfile1.txt |
|
| File Editor | file | /textfile1.txt |
|
||||||
| Co Owner | file | /textfile1.txt |
|
| Co Owner | file | /textfile1.txt |
|
||||||
| Manager | file | /textfile1.txt |
|
| Manager | file | /textfile1.txt |
|
||||||
| Viewer | folder | FolderToShare |
|
| Viewer | folder | FolderToShare |
|
||||||
| Editor | folder | FolderToShare |
|
| Editor | folder | FolderToShare |
|
||||||
| Co Owner | folder | FolderToShare |
|
| Co Owner | folder | FolderToShare |
|
||||||
| Uploader | folder | FolderToShare |
|
| Uploader | folder | FolderToShare |
|
||||||
| Manager | folder | FolderToShare |
|
| Manager | folder | FolderToShare |
|
||||||
|
|
||||||
|
|
||||||
Scenario Outline: send share invitation with expiration date to group with different roles
|
Scenario Outline: send share invitation with expiration date to group with different roles
|
||||||
@@ -691,7 +691,7 @@ Feature: Send a sharing invitations
|
|||||||
| space | Personal |
|
| space | Personal |
|
||||||
| sharee | grp1 |
|
| sharee | grp1 |
|
||||||
| shareType | group |
|
| shareType | group |
|
||||||
| permissionsRole | <permissionsRole> |
|
| permissionsRole | <permissions-role> |
|
||||||
| expireDate | 2043-07-15T14:00:00.000Z |
|
| expireDate | 2043-07-15T14:00:00.000Z |
|
||||||
Then the HTTP status code should be "200"
|
Then the HTTP status code should be "200"
|
||||||
And the JSON data of the response should match
|
And the JSON data of the response should match
|
||||||
@@ -764,13 +764,100 @@ Feature: Send a sharing invitations
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
Examples:
|
Examples:
|
||||||
| permissionsRole | resource-type | path |
|
| permissions-role | resource-type | path |
|
||||||
| Viewer | file | /textfile1.txt |
|
| Viewer | file | /textfile1.txt |
|
||||||
| File Editor | file | /textfile1.txt |
|
| File Editor | file | /textfile1.txt |
|
||||||
| Co Owner | file | /textfile1.txt |
|
| Co Owner | file | /textfile1.txt |
|
||||||
| Manager | file | /textfile1.txt |
|
| Manager | file | /textfile1.txt |
|
||||||
| Viewer | folder | FolderToShare |
|
| Viewer | folder | FolderToShare |
|
||||||
| Editor | folder | FolderToShare |
|
| Editor | folder | FolderToShare |
|
||||||
| Co Owner | folder | FolderToShare |
|
| Co Owner | folder | FolderToShare |
|
||||||
| Uploader | folder | FolderToShare |
|
| Uploader | folder | FolderToShare |
|
||||||
| Manager | folder | FolderToShare |
|
| Manager | folder | FolderToShare |
|
||||||
|
|
||||||
|
@issue-7962
|
||||||
|
Scenario Outline: send share invitation to disabled user
|
||||||
|
Given user "Alice" has uploaded file with content "to share" to "/textfile1.txt"
|
||||||
|
And user "Alice" has created folder "FolderToShare"
|
||||||
|
And the user "Admin" has disabled user "Brian"
|
||||||
|
When user "Alice" sends the following share invitation using the Graph API:
|
||||||
|
| resourceType | <resource-type> |
|
||||||
|
| resource | <path> |
|
||||||
|
| space | Personal |
|
||||||
|
| sharee | Brian |
|
||||||
|
| shareType | user |
|
||||||
|
| permissionsRole | <permissions-role> |
|
||||||
|
Then the HTTP status code should be "200"
|
||||||
|
And the JSON data of the response should match
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"value": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"roles",
|
||||||
|
"grantedToV2"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^%permissions_id_pattern%$"
|
||||||
|
},
|
||||||
|
"roles": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^%role_id_pattern%$"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"grantedToV2": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"user"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"user": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"displayName"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^%user_id_pattern%$"
|
||||||
|
},
|
||||||
|
"displayName": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Brian Murphy"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
Examples:
|
||||||
|
| permissions-role | resource-type | path |
|
||||||
|
| Viewer | file | /textfile1.txt |
|
||||||
|
| File Editor | file | /textfile1.txt |
|
||||||
|
| Co Owner | file | /textfile1.txt |
|
||||||
|
| Manager | file | /textfile1.txt |
|
||||||
|
| Viewer | folder | FolderToShare |
|
||||||
|
| Editor | folder | FolderToShare |
|
||||||
|
| Co Owner | folder | FolderToShare |
|
||||||
|
| Uploader | folder | FolderToShare |
|
||||||
|
| Manager | folder | FolderToShare |
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class GraphContext implements Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Given /^the user "([^"]*)" has disabled user "([^"]*)" using the Graph API$/
|
* @Given /^the user "([^"]*)" has disabled user "([^"]*)"$/
|
||||||
*
|
*
|
||||||
* @param string $byUser
|
* @param string $byUser
|
||||||
* @param string $user
|
* @param string $user
|
||||||
@@ -172,7 +172,7 @@ class GraphContext implements Context {
|
|||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function theUserHasDisabledUserToUsingTheGraphApi(string $byUser, string $user): void {
|
public function theUserHasDisabledUser(string $byUser, string $user): void {
|
||||||
$this->theUserDisablesUserToUsingTheGraphApi($byUser, $user);
|
$this->theUserDisablesUserToUsingTheGraphApi($byUser, $user);
|
||||||
$this->featureContext->thenTheHTTPStatusCodeShouldBe(200);
|
$this->featureContext->thenTheHTTPStatusCodeShouldBe(200);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user