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

[full-ci] [tests-only] Added test for sending share invitation to group with permissions #8047

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
202 changes: 202 additions & 0 deletions tests/acceptance/features/apiSharingNg/shareInvitations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,205 @@ Feature: Send a sharing invitations
| permissions/delete |
| deleted/delete |
| permissions/deny |


Scenario Outline: send share invitation for a file to group with different permissions
Given 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 user "Alice" has uploaded file with content "to share" to "textfile1.txt"
When user "Alice" sends the following share invitation using the Graph API:
| resourceType | file |
| resource | textfile1.txt |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permission | <permission> |
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",
"@libre.graph.permissions.actions",
"grantedToV2"
],
"properties": {
"id": {
"type": "string",
"pattern": "^%share_id_pattern%$"
},
"@libre.graph.permissions.actions": {
"type": "array",
"items": {
"type": "string",
"pattern": "^libre\\.graph\\/driveItem\\/<permission>$"
}
},
"grantedToV2": {
"type": "object",
"required": [
"group"
],
"properties": {
"group": {
"type": "object",
"required": [
"id",
"displayName"
],
"properties": {
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"displayName": {
"type": "string",
"enum": [
"grp1"
]
}
}
}
}
}
}
}
}
}
}
"""
Examples:
| permission |
| permissions/create |
| children/create |
| upload/create |
| path/read |
| quota/read |
| content/read |
| permissions/read |
| children/read |
| versions/read |
| deleted/read |
| basic/read |
| path/update |
| versions/update |
| deleted/update |
| permissions/update |
| standard/delete |
| permissions/delete |
| deleted/delete |
| permissions/deny |


Scenario Outline: send share invitation for a folder to group with different permissions
Given 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 user "Alice" has created folder "FolderToShare"
When user "Alice" sends the following share invitation using the Graph API:
| resourceType | folder |
| resource | FolderToShare |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permission | <permission> |
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",
"@libre.graph.permissions.actions",
"grantedToV2"
],
"properties": {
"id": {
"type": "string",
"pattern": "^%share_id_pattern%$"
},
"@libre.graph.permissions.actions": {
"type": "array",
"items": {
"type": "string",
"pattern": "^libre\\.graph\\/driveItem\\/<permission>$"
}
},
"grantedToV2": {
"type": "object",
"required": [
"group"
],
"properties": {
"group": {
"type": "object",
"required": [
"id",
"displayName"
],
"properties": {
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"displayName": {
"type": "string",
"enum": [
"grp1"
]
}
}
}
}
}
}
}
}
}
}
"""
Examples:
| permission |
| permissions/create |
| children/create |
| upload/create |
| path/read |
| quota/read |
| content/read |
| permissions/read |
| children/read |
| versions/read |
| deleted/read |
| basic/read |
| path/update |
| versions/update |
| deleted/update |
| permissions/update |
| standard/delete |
| permissions/delete |
| deleted/delete |
| permissions/deny |