Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 175 additions & 0 deletions tests/acceptance/features/apiSharingNg/shareInvitations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |