Skip to content

Commit 2237534

Browse files
authored
Merge pull request #10710 from owncloud/tests-ocm-folder-share
[tests-only][full-ci] add test to share copied folder to remote user
2 parents cdeb025 + fe0da65 commit 2237534

File tree

2 files changed

+98
-2
lines changed

2 files changed

+98
-2
lines changed

tests/acceptance/bootstrap/WebDav.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ public function userCopiesFileUsingTheAPI(
670670
}
671671

672672
/**
673-
* @Given /^user "([^"]*)" has copied file "([^"]*)" to "([^"]*)"$/
673+
* @Given /^user "([^"]*)" has copied (?:file|folder) "([^"]*)" to "([^"]*)"$/
674674
*
675675
* @param string $user
676676
* @param string $fileSource
@@ -686,7 +686,7 @@ public function userHasCopiedFileUsingTheAPI(
686686
$response = $this->copyFile($user, $fileSource, $fileDestination);
687687
$this->theHTTPStatusCodeShouldBe(
688688
["201", "204"],
689-
"HTTP status code was not 201 or 204 while trying to copy file '$fileSource' to '$fileDestination' for user '$user'",
689+
"HTTP status code was not 201 or 204 while trying to copy resource '$fileSource' to '$fileDestination' for user '$user'",
690690
$response
691691
);
692692
}

tests/acceptance/features/apiOcm/share.feature

+96
Original file line numberDiff line numberDiff line change
@@ -814,3 +814,99 @@ Feature: an user shares resources using ScienceMesh application
814814
And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "this is a new content"
815815
And using server "LOCAL"
816816
And for user "Alice" the content of the file "textfile.txt" of the space "Personal" should be "this is a new content"
817+
818+
@issue-10488
819+
Scenario Outline: local user shares a folder copied from an already shared folder to federation user
820+
Given using server "REMOTE"
821+
And "Brian" has created the federation share invitation
822+
And using server "LOCAL"
823+
And "Alice" has accepted invitation
824+
And user "Alice" has created folder "folderToShare"
825+
And user "Alice" has sent the following resource share invitation to federated user:
826+
| resource | folderToShare |
827+
| space | Personal |
828+
| sharee | Brian |
829+
| shareType | user |
830+
| permissionsRole | <permissions-role-1> |
831+
And user "Alice" has copied folder "folderToShare" to "folderToShareCopy"
832+
And user "Alice" has sent the following resource share invitation to federated user:
833+
| resource | folderToShareCopy |
834+
| space | Personal |
835+
| sharee | Brian |
836+
| shareType | user |
837+
| permissionsRole | <permissions-role-2> |
838+
And using server "REMOTE"
839+
When user "Brian" lists the shares shared with him using the Graph API
840+
Then the HTTP status code should be "200"
841+
And the JSON data of the response should match
842+
"""
843+
{
844+
"type": "object",
845+
"required": [
846+
"value"
847+
],
848+
"properties": {
849+
"value": {
850+
"type": "array",
851+
"minItems": 2,
852+
"maxItems": 2,
853+
"uniqueItems": true,
854+
"items": {
855+
"oneOf":[
856+
{
857+
"type": "object",
858+
"required": [
859+
"@UI.Hidden",
860+
"@client.synchronize",
861+
"createdBy",
862+
"eTag",
863+
"folder",
864+
"id",
865+
"lastModifiedDateTime",
866+
"name",
867+
"parentReference",
868+
"remoteItem"
869+
],
870+
"properties": {
871+
"name": {
872+
"const": "folderToShare"
873+
}
874+
}
875+
},
876+
{
877+
"type": "object",
878+
"required": [
879+
"@UI.Hidden",
880+
"@client.synchronize",
881+
"createdBy",
882+
"eTag",
883+
"folder",
884+
"id",
885+
"lastModifiedDateTime",
886+
"name",
887+
"parentReference",
888+
"remoteItem"
889+
],
890+
"properties": {
891+
"name": {
892+
"const": "folderToShareCopy"
893+
}
894+
}
895+
}
896+
]
897+
}
898+
}
899+
}
900+
}
901+
"""
902+
Examples:
903+
| permissions-role-1 | permissions-role-2 |
904+
| Editor | Viewer |
905+
| Editor | Uploader |
906+
| Editor | Editor |
907+
| Uploader | Editor |
908+
| Uploader | Viewer |
909+
| Uploader | Uploader |
910+
| Viewer | Uploader |
911+
| Viewer | Editor |
912+
| Viewer | Viewer |

0 commit comments

Comments
 (0)