mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-27 10:34:42 -05:00
test(guest-link): check share types of resources shared with a guest (#4128)
* test(guest-link): check share types of resources shared with a guest * test(guest-link): rename the share types scenarios as suggested in the review Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
1 parent
67d63d608e
commit
ce5643786e
4 files changed
+156
-3
No files matched your search
@@ -30,7 +30,6 @@ use Psr\Http\Message\ResponseInterface;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
use TestHelpers\WaitHelper;
|
||||
use Behat\Step\Given;
|
||||
@@ -249,8 +248,7 @@ class SpacesContext implements Context {
|
||||
$this->featureContext->getStepLineRef(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$this->featureContext->getAttributeOfCreatedUser($user, 'id'),
|
||||
$this->featureContext->getStepLineRef()
|
||||
$this->featureContext->getAttributeOfCreatedUser($user, 'id')
|
||||
);
|
||||
|
||||
$space = json_decode($resource->getBody()->getContents(), true);
|
||||
|
||||
@@ -201,6 +201,7 @@ default:
|
||||
- NotificationContext:
|
||||
- GuestLinkContext:
|
||||
- OcConfigContext:
|
||||
- WebDavPropertiesContext:
|
||||
|
||||
apiAntivirus:
|
||||
paths:
|
||||
|
||||
@@ -136,6 +136,83 @@ Feature: share a resource with a guest via email address
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario: sharer lists the permissions of a resource shared with a guest
|
||||
Given user "Alice" has sent the following resource share invitation:
|
||||
| resource | textfile.txt |
|
||||
| space | Personal |
|
||||
| sharee | guest@example.org |
|
||||
| shareType | guest |
|
||||
| permissionsRole | Viewer |
|
||||
When user "Alice" gets permissions list for file "textfile.txt" of the space "Personal" using the Graph API
|
||||
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",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "roles", "grantedToV2", "invitation"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%permissions_id_pattern%$"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": { "const": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" }
|
||||
},
|
||||
"grantedToV2": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["@libre.graph.userType", "displayName", "id"],
|
||||
"properties": {
|
||||
"@libre.graph.userType": { "const": "Guest" },
|
||||
"displayName": { "const": "guest@example.org" },
|
||||
"id": { "const": "guest@example.org" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"invitation": {
|
||||
"type": "object",
|
||||
"required": ["invitedBy"],
|
||||
"properties": {
|
||||
"invitedBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["@libre.graph.userType", "displayName", "id"],
|
||||
"properties": {
|
||||
"@libre.graph.userType": { "const": "Member" },
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "type": "string", "pattern": "^%user_id_pattern%$" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@email
|
||||
Scenario: guest receives an email with a guest link
|
||||
When user "Alice" sends the following resource share invitation using the Graph API:
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
@email
|
||||
Feature: share types of resources shared with a guest
|
||||
As a user
|
||||
I want to see which of my resources are shared with a guest
|
||||
So that I know who has access to them
|
||||
|
||||
Background:
|
||||
Given using SharingNG
|
||||
And user "Alice" has been created with default attributes
|
||||
And user "Alice" has created folder "parent"
|
||||
And user "Alice" has created folder "parent/folderToShare"
|
||||
And user "Alice" has uploaded file with content "to share" to "parent/textfile.txt"
|
||||
|
||||
|
||||
Scenario Outline: check the share-types property of a resource shared with a guest
|
||||
Given user "Alice" has sent the following resource share invitation:
|
||||
| resource | <resource> |
|
||||
| space | Personal |
|
||||
| sharee | guest@example.org |
|
||||
| shareType | guest |
|
||||
| permissionsRole | Viewer |
|
||||
When user "Alice" gets the following properties of resource "<resource>" inside space "Personal" using the WebDAV API
|
||||
| propertyName |
|
||||
| oc:share-types |
|
||||
Then the HTTP status code should be "207"
|
||||
And the response should contain a share-types property with
|
||||
| 4 |
|
||||
Examples:
|
||||
| resource |
|
||||
| parent/textfile.txt |
|
||||
| parent/folderToShare |
|
||||
|
||||
|
||||
Scenario: check the share-types property of a resource shared with a user, a group and a guest
|
||||
Given user "Brian" has been created with default attributes
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | parent/textfile.txt |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
And group "grp1" has been created
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | parent/textfile.txt |
|
||||
| space | Personal |
|
||||
| sharee | grp1 |
|
||||
| shareType | group |
|
||||
| permissionsRole | Viewer |
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | parent/textfile.txt |
|
||||
| space | Personal |
|
||||
| sharee | guest@example.org |
|
||||
| shareType | guest |
|
||||
| permissionsRole | Viewer |
|
||||
When user "Alice" gets the following properties of resource "parent/textfile.txt" inside space "Personal" using the WebDAV API
|
||||
| propertyName |
|
||||
| oc:share-types |
|
||||
Then the HTTP status code should be "207"
|
||||
And the response should contain a share-types property with
|
||||
| 0 |
|
||||
| 1 |
|
||||
| 4 |
|
||||
|
||||
|
||||
Scenario: check the share-types property of a resource after the guest share is removed
|
||||
Given user "Alice" has sent the following resource share invitation:
|
||||
| resource | parent/textfile.txt |
|
||||
| space | Personal |
|
||||
| sharee | guest@example.org |
|
||||
| shareType | guest |
|
||||
| permissionsRole | Viewer |
|
||||
And user "Alice" has removed the access of guest "guest@example.org" from resource "parent/textfile.txt" of space "Personal"
|
||||
When user "Alice" gets the following properties of resource "parent/textfile.txt" inside space "Personal" using the WebDAV API
|
||||
| propertyName |
|
||||
| oc:share-types |
|
||||
Then the HTTP status code should be "207"
|
||||
And the response should contain an empty property "oc:share-types"
|
||||
Reference in new issue
Block a user