mirror of
https://github.com/owncloud/ocis.git
synced 2025-04-18 23:44:07 +03:00
Merge pull request #11214 from owncloud/add-test-for-listing-shared-resource-activites
[tests-only][full-ci]Add test cases to validate JSON response for shared resource activity listing (list grant roles)
This commit is contained in:
commit
ffe8b7fc4e
@ -2934,7 +2934,11 @@ class GraphContext implements Context {
|
||||
string $resource,
|
||||
string $spaceName
|
||||
): void {
|
||||
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
|
||||
if ($spaceName === "Shares") {
|
||||
$resourceId = $this->spacesContext->getSharesRemoteItemId($user, $resource);
|
||||
} else {
|
||||
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
|
||||
}
|
||||
$response = GraphHelper::getActivities(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
|
@ -1482,3 +1482,125 @@ Feature: ListGrants role
|
||||
| permissions-role |
|
||||
| Viewer With ListGrants |
|
||||
| File Editor With ListGrants |
|
||||
|
||||
|
||||
Scenario Outline: list activities of folder shared with listGrant roles (Personal space)
|
||||
Given the administrator has enabled the permissions role "<permissions-role>"
|
||||
And using spaces DAV path
|
||||
And using SharingNG
|
||||
And user "Alice" has created folder "folder"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folder |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
And user "Brian" has a share "folder" synced
|
||||
When user "Brian" lists the activities of folder "folder" from space "Shares" 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": 2,
|
||||
"maxItems": 2,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id","template","times"],
|
||||
"properties": {
|
||||
"id": {"pattern": "^%user_id_pattern%$"},
|
||||
"template": {
|
||||
"type": "object",
|
||||
"required": ["message","variables"],
|
||||
"properties": {
|
||||
"message": {"const": "{user} added {resource} to {folder}"},
|
||||
"variables":{
|
||||
"type": "object",
|
||||
"required": ["folder","resource","user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties":{
|
||||
"id": {"const": ""},
|
||||
"name": {"const": "shared-with-me"}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {"name": {"const": "folder"}}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties":{"displayName": {"const": "Alice Hansen"}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id","template","times"],
|
||||
"properties": {
|
||||
"id": {"pattern": "^%user_id_pattern%$"},
|
||||
"template": {
|
||||
"type": "object",
|
||||
"required": ["message","variables"],
|
||||
"properties": {
|
||||
"message": {"const": "{user} shared {resource} with {sharee}"},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder","resource","sharee","user"],
|
||||
"properties": {
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {"name": {"const": "folder"}}
|
||||
},
|
||||
"sharee": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {"displayName": {"const": "Brian"}}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {"displayName": {"const": "Alice Hansen"}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"times": {
|
||||
"type": "object",
|
||||
"required": ["recordedTime"],
|
||||
"properties": {
|
||||
"recordedTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| permissions-role |
|
||||
| Viewer With ListGrants |
|
||||
| Editor With ListGrants |
|
||||
|
Loading…
x
Reference in New Issue
Block a user