mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-02 00:44:53 -05:00
Merge pull request #10618 from owncloud/tests-change-share-activities
[tests-only][full-ci] add tests to check activities of space's resource after updating it's share
This commit is contained in:
@@ -509,16 +509,33 @@ class SharingNgContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user updates the last resource share with the following using the Graph API:
|
||||
* @Given user :user has updated the last resource share with the following properties:
|
||||
*
|
||||
* @param string $user
|
||||
* @param TableNode $table
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userUpdatesTheLastShareWithFollowingUsingGraphApi($user, TableNode $table) {
|
||||
$response = $this->featureContext->shareNgGetLastCreatedUserGroupShare();
|
||||
$permissionID = json_decode($response->getBody()->getContents())->value[0]->id;
|
||||
public function userHasUpdatedTheLastResourceShareWithTheFollowingProperties(string $user, TableNode $table): void {
|
||||
$permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
|
||||
$response = $this->updateResourceShare(
|
||||
$user,
|
||||
$table,
|
||||
$permissionID
|
||||
);
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(200, "Expected response status code should be 200", $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user updates the last resource share with the following properties using the Graph API:
|
||||
*
|
||||
* @param string $user
|
||||
* @param TableNode $table
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userUpdatesTheLastShareWithFollowingPropertiesUsingGraphApi($user, TableNode $table) {
|
||||
$permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
|
||||
$this->featureContext->setResponse(
|
||||
$this->updateResourceShare(
|
||||
$user,
|
||||
@@ -678,7 +695,7 @@ class SharingNgContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^user "([^"]*)" has updated the last resource|space link share with$/
|
||||
* @Given user :user has updated the last resource/space link share with
|
||||
*
|
||||
* @param string $user
|
||||
* @param TableNode $body
|
||||
|
||||
@@ -210,8 +210,8 @@
|
||||
- [apiLocks/unlockFiles.feature:321](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L321)
|
||||
- [apiLocks/unlockFiles.feature:322](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L322)
|
||||
- [apiLocks/unlockFiles.feature:323](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L323)
|
||||
- [apiActivities/shareActivities.feature:1775](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1775)
|
||||
- [apiActivities/shareActivities.feature:1914](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1914)
|
||||
- [apiActivities/shareActivities.feature:1962](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1962)
|
||||
- [apiActivities/shareActivities.feature:2101](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L2101)
|
||||
- [apiAntivirus/antivirus.feature:114](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L114)
|
||||
- [apiAntivirus/antivirus.feature:115](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L115)
|
||||
- [apiAntivirus/antivirus.feature:116](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L116)
|
||||
|
||||
@@ -1350,6 +1350,193 @@ Feature: check share activity
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-10011 @issue-10228
|
||||
Scenario: check share update activities of a folder from a project space
|
||||
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 "new-space" with the default quota using the Graph API
|
||||
And user "Alice" has created a folder "folderToShare" in space "new-space"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folderToShare |
|
||||
| space | new-space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
And user "Alice" has updated the last resource share with the following properties:
|
||||
| permissionsRole | Editor |
|
||||
| expirationDateTime | 2200-07-15T14:00:00.000Z |
|
||||
| space | new-space |
|
||||
| resource | folderToShare |
|
||||
When user "Alice" lists the activities of folder "folderToShare" from space "new-space" 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": 3,
|
||||
"maxItems": 3,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id","template","times"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"template": {
|
||||
"type": "object",
|
||||
"required": ["message","variables"],
|
||||
"properties": {
|
||||
"message": {
|
||||
"const": "{user} added {resource} to {folder}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id","template","times"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"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": "folderToShare"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sharee": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Brian"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id","template","times"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"template": {
|
||||
"type": "object",
|
||||
"required": ["message","variables"],
|
||||
"properties": {
|
||||
"message": {
|
||||
"const": "{user} updated {field} for the {resource}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["field","folder","resource","user"],
|
||||
"properties": {
|
||||
"field": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "expiration date, permission"
|
||||
}
|
||||
}
|
||||
},
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"const": "new-space"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%file_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"const": "folderToShare"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"times": {
|
||||
"type": "object",
|
||||
"required": ["recordedTime"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-10012
|
||||
Scenario: check link share activities of a file from a project space
|
||||
Given using spaces DAV path
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@ Feature: Update permission of a share
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| expirationDateTime | 2025-07-15T14:00:00Z |
|
||||
When user "Alice" updates the last resource share with the following using the Graph API:
|
||||
When user "Alice" updates the last resource share with the following properties using the Graph API:
|
||||
| space | Personal |
|
||||
| resource | testfile.txt |
|
||||
| expirationDateTime | 2200-07-15T14:00:00Z |
|
||||
@@ -92,7 +92,7 @@ Feature: Update permission of a share
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| expirationDateTime | 2025-07-15T14:00:00Z |
|
||||
When user "Alice" updates the last resource share with the following using the Graph API:
|
||||
When user "Alice" updates the last resource share with the following properties using the Graph API:
|
||||
| space | Personal |
|
||||
| resource | <resource> |
|
||||
| expirationDateTime | |
|
||||
@@ -162,7 +162,7 @@ Feature: Update permission of a share
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
When user "Alice" updates the last resource share with the following using the Graph API:
|
||||
When user "Alice" updates the last resource share with the following properties using the Graph API:
|
||||
| permissionsRole | <new-permissions-role> |
|
||||
| space | Personal |
|
||||
| resource | <resource> |
|
||||
@@ -314,7 +314,7 @@ Feature: Update permission of a share
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
When user "Alice" updates the last resource share with the following using the Graph API:
|
||||
When user "Alice" updates the last resource share with the following properties using the Graph API:
|
||||
| permissionsRole | <new-permissions-role> |
|
||||
| space | NewSpace |
|
||||
| resource | <resource> |
|
||||
|
||||
Reference in New Issue
Block a user