[tests-only] Add test to share resource inside of space (#8327)

* Added test to send share invitation with user for resource inside of project space

* Added test to send share invitation with group for resource inside of project space

* Addressed reviews
This commit is contained in:
Prarup Gurung
2024-02-01 16:40:45 +05:45
committed by GitHub
parent 94a7f189e0
commit fbe1b4288b

View File

@@ -2039,3 +2039,178 @@ Feature: Send a sharing invitations
}
}
"""
Scenario Outline: send share invitation for project space resource to user with different roles
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "NewSpace" with content "share space items" to "textfile1.txt"
And user "Alice" has created a folder "FolderToShare" in space "NewSpace"
When user "Alice" sends the following share invitation for space using the Graph API:
| resource | <path> |
| space | NewSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
Then the HTTP status code should be "200"
And for user "Brian" the space Shares should contain these entries:
| <path> |
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"items": {
"type": "object",
"required": [
"grantedToV2",
"roles"
],
"properties": {
"grantedToV2": {
"type": "object",
"required": [
"user"
],
"properties": {
"user": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"type": "string",
"enum": [
"Brian Murphy"
]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"roles": {
"type": "array",
"items": {
"type": "string",
"pattern": "^%role_id_pattern%$"
}
}
}
}
}
}
}
"""
Examples:
| permissions-role | path |
| Viewer | textfile1.txt |
| File Editor | textfile1.txt |
| Viewer | FolderToShare |
| Editor | FolderToShare |
| Uploader | FolderToShare |
Scenario Outline: send share invitation for project space resource to group with different roles
Given using spaces DAV path
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | grp1 |
| Carol | grp1 |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "NewSpace" with content "share space items" to "textfile1.txt"
And user "Alice" has created a folder "FolderToShare" in space "NewSpace"
When user "Alice" sends the following share invitation for space using the Graph API:
| resource | <path> |
| space | NewSpace |
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
Then the HTTP status code should be "200"
And for user "Brian" the space Shares should contain these entries:
| <path> |
And for user "Carol" the space Shares should contain these entries:
| <path> |
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": [
"group"
],
"properties": {
"group": {
"type": "object",
"required": [
"id",
"displayName"
],
"properties": {
"id": {
"type": "string",
"pattern": "^%group_id_pattern%$"
},
"displayName": {
"type": "string",
"enum": [
"grp1"
]
}
}
}
}
}
}
}
}
}
}
"""
Examples:
| permissions-role | path |
| Viewer | textfile1.txt |
| File Editor | textfile1.txt |
| Viewer | FolderToShare |
| Editor | FolderToShare |
| Uploader | FolderToShare |