diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index bfc0b28552..dee2060cd7 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -29,8 +29,8 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSpacesShares/changingFilesShare.feature:12](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/changingFilesShare.feature#L12) ### [copy to overwrite (file and folder) from Personal to Shares Jail behaves differently](https://github.com/owncloud/ocis/issues/4393) -- [apiSpacesShares/copySpaces.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L487) -- [apiSpacesShares/copySpaces.feature:501](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L501) +- [apiSpacesShares/copySpaces.feature:529](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L529) +- [apiSpacesShares/copySpaces.feature:543](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L543) #### [PATCH request for TUS upload with wrong checksum gives incorrect response](https://github.com/owncloud/ocis/issues/1755) - [apiSpacesShares/shareUploadTUS.feature:204](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareUploadTUS.feature#L204) @@ -38,9 +38,9 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSpacesShares/shareUploadTUS.feature:284](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareUploadTUS.feature#L284) ### [Copy or move on an existing resource doesn't create a new version but deletes instead](https://github.com/owncloud/ocis/issues/4797) -- [apiSpacesShares/moveSpaces.feature:306](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L306) -- [apiSpacesShares/copySpaces.feature:710](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L710) -- [apiSpacesShares/copySpaces.feature:751](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L751) +- [apiSpacesShares/moveSpaces.feature:322](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L322) +- [apiSpacesShares/copySpaces.feature:752](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L752) +- [apiSpacesShares/copySpaces.feature:793](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L793) ### [Creating group with empty name returns status code 200](https://github.com/owncloud/ocis/issues/5050) - [apiGraph/createGroup.feature:40](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroup.feature#L40) @@ -79,10 +79,10 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:62](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L62) - [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L63) - [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:64](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L64) -- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L90) -- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L160) -- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L161) -- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:162](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L162) +- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L92) +- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:166](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L166) +- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:167](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L167) +- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:168](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L168) #### [Public cannot download folder via the public link of the folder inside the project space](https://github.com/owncloud/ocis/issues/5229) - [apiSpacesShares/publicLinkDownload.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature#L30) @@ -97,7 +97,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiAsyncUpload/delayPostprocessing.feature:16](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAsyncUpload/delayPostprocessing.feature#L16) #### [Sharing to a group with an expiration date does not work #5442](https://github.com/owncloud/ocis/issues/5442) -- [apiSpacesShares/shareSubItemOfSpace.feature:99](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L99) +- [apiSpacesShares/shareSubItemOfSpace.feature:105](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L105) #### [Space admin should not not be able to change the user quota](https://github.com/owncloud/ocis/issues/5475) - [apiSpaces/spaceManagement.feature:69](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/spaceManagement.feature#L69) diff --git a/tests/acceptance/features/apiContract/propfind.feature b/tests/acceptance/features/apiContract/propfind.feature index 13cebf83fe..f778ab51a7 100644 --- a/tests/acceptance/features/apiContract/propfind.feature +++ b/tests/acceptance/features/apiContract/propfind.feature @@ -27,7 +27,9 @@ Feature: Propfind test Scenario Outline: space member with a different role checks the PROPFIND request of a space Given user "Alice" has uploaded a file inside space "new-space" with content "some content" to "testfile.txt" - And user "Alice" has shared a space "new-space" to user "Brian" with role "" + And user "Alice" has shared a space "new-space" with settings: + | shareWith | Brian | + | role | | When user "Brian" sends PROPFIND request to space "new-space" using the WebDAV API Then the HTTP status code should be "207" And the "PROPFIND" response should contain a space "new-space" with these key and value pairs: diff --git a/tests/acceptance/features/apiSpaces/changeSpaces.feature b/tests/acceptance/features/apiSpaces/changeSpaces.feature index 93fafaa1c6..85be343617 100644 --- a/tests/acceptance/features/apiSpaces/changeSpaces.feature +++ b/tests/acceptance/features/apiSpaces/changeSpaces.feature @@ -14,8 +14,12 @@ Feature: Change data of space | Bob | And the administrator has given "Alice" the role "Space Admin" using the settings api And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20" - And user "Alice" has shared a space "Project Jupiter" to user "Brian" with role "editor" - And user "Alice" has shared a space "Project Jupiter" to user "Bob" with role "viewer" + And user "Alice" has shared a space "Project Jupiter" with settings: + | shareWith | Brian | + | role | editor | + And user "Alice" has shared a space "Project Jupiter" with settings: + | shareWith | Bob | + | role | viewer | And using spaces DAV path diff --git a/tests/acceptance/features/apiSpaces/deleteSpaces.feature b/tests/acceptance/features/apiSpaces/deleteSpaces.feature index 4c387a468b..b5c6a77a2f 100644 --- a/tests/acceptance/features/apiSpaces/deleteSpaces.feature +++ b/tests/acceptance/features/apiSpaces/deleteSpaces.feature @@ -15,8 +15,12 @@ Feature: Disabling and deleting space | Bob | And the administrator has given "Alice" the role "Space Admin" using the settings api And user "Alice" has created a space "Project Moon" with the default quota using the GraphApi - And user "Alice" has shared a space "Project Moon" to user "Brian" with role "editor" - And user "Alice" has shared a space "Project Moon" to user "Bob" with role "viewer" + And user "Alice" has shared a space "Project Moon" with settings: + | shareWith | Brian | + | role | editor | + And user "Alice" has shared a space "Project Moon" with settings: + | shareWith | Bob | + | role | viewer | Scenario Outline: A space admin user can disable a Space via the Graph API diff --git a/tests/acceptance/features/apiSpaces/download.feature b/tests/acceptance/features/apiSpaces/download.feature index af74af5841..80f70c043d 100644 --- a/tests/acceptance/features/apiSpaces/download.feature +++ b/tests/acceptance/features/apiSpaces/download.feature @@ -1,52 +1,56 @@ @api @skipOnOcV10 Feature: Download file in project space - As a user with different role, I want to be able to download files + As a user with different role, I want to be able to download files - Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production - See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839 + Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production + See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839 - Background: - Given these users have been created with default attributes and without skeleton files: - | username | - | Alice | - | Brian | - | Bob | - And using spaces DAV path - And the administrator has given "Alice" the role "Space Admin" using the settings api - And user "Alice" has created a space "download file" with the default quota using the GraphApi - And user "Alice" has uploaded a file inside space "download file" with content "some content" to "file.txt" - And user "Alice" has shared a space "download file" to user "Brian" with role "editor" - And user "Alice" has shared a space "download file" to user "Bob" with role "viewer" + Background: + Given these users have been created with default attributes and without skeleton files: + | username | + | Alice | + | Brian | + | Bob | + And using spaces DAV path + And the administrator has given "Alice" the role "Space Admin" using the settings api + And user "Alice" has created a space "download file" with the default quota using the GraphApi + And user "Alice" has uploaded a file inside space "download file" with content "some content" to "file.txt" + And user "Alice" has shared a space "download file" with settings: + | shareWith | Brian | + | role | editor | + And user "Alice" has shared a space "download file" with settings: + | shareWith | Bob | + | role | viewer | - Scenario Outline: An user downloads a file in the project space - When user "" downloads the file "file.txt" of the space "download file" using the WebDAV API - Then the HTTP status code should be "200" - And the following headers should be set - | header | value | - | Content-Length | 12 | - Examples: - | user | - | Alice | - | Brian | - | Bob | + Scenario Outline: An user downloads a file in the project space + When user "" downloads the file "file.txt" of the space "download file" using the WebDAV API + Then the HTTP status code should be "200" + And the following headers should be set + | header | value | + | Content-Length | 12 | + Examples: + | user | + | Alice | + | Brian | + | Bob | - Scenario Outline: An user downloads an old version of the file in the project space - Given user "Alice" has uploaded a file inside space "download file" with content "new content" to "file.txt" - And user "Alice" has uploaded a file inside space "download file" with content "newest content" to "file.txt" - When user "" downloads version of the file "file.txt" with the index "1" of the space "download file" using the WebDAV API - Then the HTTP status code should be "200" - And the following headers should be set - | header | value | - | Content-Length | 11 | - When user "" downloads version of the file "file.txt" with the index "2" of the space "download file" using the WebDAV API - Then the HTTP status code should be "200" - And the following headers should be set - | header | value | - | Content-Length | 12 | - Examples: - | user | - | Alice | - | Brian | - | Bob | + Scenario Outline: An user downloads an old version of the file in the project space + Given user "Alice" has uploaded a file inside space "download file" with content "new content" to "file.txt" + And user "Alice" has uploaded a file inside space "download file" with content "newest content" to "file.txt" + When user "" downloads version of the file "file.txt" with the index "1" of the space "download file" using the WebDAV API + Then the HTTP status code should be "200" + And the following headers should be set + | header | value | + | Content-Length | 11 | + When user "" downloads version of the file "file.txt" with the index "2" of the space "download file" using the WebDAV API + Then the HTTP status code should be "200" + And the following headers should be set + | header | value | + | Content-Length | 12 | + Examples: + | user | + | Alice | + | Brian | + | Bob | diff --git a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature index e3e6f63f4a..9f3e825b7a 100644 --- a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature +++ b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature @@ -53,7 +53,9 @@ Feature: A manager of the space can edit public link Scenario Outline: All members can see a created public link Given using OCS API version "2" - When user "Alice" shares a space "edit space" to user "Brian" with role "" + When user "Alice" shares a space "edit space" with settings: + | shareWith | Brian | + | role | | Then the HTTP status code should be "200" And the OCS status code should be "200" And for user "Alice" the space "edit space" should contain the last created public link @@ -67,7 +69,9 @@ Feature: A manager of the space can edit public link Scenario Outline: Members of the space try to edit a public link Given using OCS API version "2" - And user "Alice" has shared a space "edit space" to user "Brian" with role "" + And user "Alice" has shared a space "edit space" with settings: + | shareWith | Brian | + | role | | When user "Brian" updates the last public link share using the sharing API with | permissions | 15 | Then the HTTP status code should be "" diff --git a/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature b/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature index 3a679d4ecc..90eecbaf3c 100644 --- a/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature +++ b/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature @@ -21,7 +21,9 @@ Feature: Remove files, folder Scenario Outline: An user deletes a folder with some subfolders in a Space via the webDav API - Given user "Alice" has shared a space "delete objects" to user "Brian" with role "" + Given user "Alice" has shared a space "delete objects" with settings: + | shareWith | Brian | + | role | | When user "" removes the folder "folderForDeleting" from space "delete objects" Then the HTTP status code should be "" And for user "" the space "delete objects" contain these entries: @@ -36,7 +38,9 @@ Feature: Remove files, folder Scenario Outline: An user deletes a subfolder in a Space via the webDav API - Given user "Alice" has shared a space "delete objects" to user "Brian" with role "" + Given user "Alice" has shared a space "delete objects" with settings: + | shareWith | Brian | + | role | | When user "" removes the folder "folderForDeleting/sub1" from space "delete objects" Then the HTTP status code should be "" And for user "" the space "delete objects" should contain these entries: @@ -53,7 +57,9 @@ Feature: Remove files, folder Scenario Outline: An user deletes a file in a Space via the webDav API - Given user "Alice" has shared a space "delete objects" to user "Brian" with role "" + Given user "Alice" has shared a space "delete objects" with settings: + | shareWith | Brian | + | role | | When user "" removes the file "text.txt" from space "delete objects" Then the HTTP status code should be "" And for user "" the space "delete objects" contain these entries: diff --git a/tests/acceptance/features/apiSpaces/restoreSpaceObjects.feature b/tests/acceptance/features/apiSpaces/restoreSpaceObjects.feature index 32671a337c..52cbdf99cb 100644 --- a/tests/acceptance/features/apiSpaces/restoreSpaceObjects.feature +++ b/tests/acceptance/features/apiSpaces/restoreSpaceObjects.feature @@ -22,7 +22,9 @@ Feature: Restore files, folder Scenario Outline: The user with different role can see deleted objects in trash bin of the space via the webDav API - Given user "Alice" has shared a space "restore objects" to user "Brian" with role "" + Given user "Alice" has shared a space "restore objects" with settings: + | shareWith | Brian | + | role | | And user "Alice" has removed the file "newFolder/file.txt" from space "restore objects" And user "Alice" has removed the folder "newFolder" from space "restore objects" When user "" lists all deleted files in the trash bin of the space "restore objects" @@ -37,7 +39,9 @@ Feature: Restore files, folder Scenario Outline: The user can restore a folder with some objects from the trash via the webDav API - Given user "Alice" has shared a space "restore objects" to user "Brian" with role "" + Given user "Alice" has shared a space "restore objects" with settings: + | shareWith | Brian | + | role | | And user "Alice" has removed the folder "newFolder" from space "restore objects" When user "" restores the folder "newFolder" from the trash of the space "restore objects" to "/newFolder" Then the HTTP status code should be "" @@ -53,7 +57,9 @@ Feature: Restore files, folder Scenario Outline: The user can restore a file from the trash via the webDav API - Given user "Alice" has shared a space "restore objects" to user "Brian" with role "" + Given user "Alice" has shared a space "restore objects" with settings: + | shareWith | Brian | + | role | | And user "Alice" has removed the file "newFolder/file.txt" from space "restore objects" When user "" restores the file "file.txt" from the trash of the space "restore objects" to "newFolder/file.txt" Then the HTTP status code should be "" diff --git a/tests/acceptance/features/apiSpaces/restoreSpaces.feature b/tests/acceptance/features/apiSpaces/restoreSpaces.feature index 893f46dadb..c7ab87e5c3 100644 --- a/tests/acceptance/features/apiSpaces/restoreSpaces.feature +++ b/tests/acceptance/features/apiSpaces/restoreSpaces.feature @@ -28,8 +28,12 @@ Feature: Restoring space Scenario: Participants can see the data after the space is restored Given user "Alice" has created a folder "mainFolder" in space "restore a space" And user "Alice" has uploaded a file inside space "restore a space" with content "example" to "test.txt" - And user "Alice" has shared a space "restore a space" to user "Brian" with role "editor" - And user "Alice" has shared a space "restore a space" to user "Bob" with role "viewer" + And user "Alice" has shared a space "restore a space" with settings: + | shareWith | Brian | + | role | editor | + And user "Alice" has shared a space "restore a space" with settings: + | shareWith | Bob | + | role | viewer | And user "Alice" has disabled a space "restore a space" When user "Alice" restores a disabled space "restore a space" Then for user "Alice" the space "restore a space" should contain these entries: @@ -44,7 +48,9 @@ Feature: Restoring space Scenario: Participant can create data in the space after restoring - Given user "Alice" has shared a space "restore a space" to user "Brian" with role "editor" + Given user "Alice" has shared a space "restore a space" with settings: + | shareWith | Brian | + | role | editor | And user "Alice" has disabled a space "restore a space" And user "Alice" has restored a disabled space "restore a space" When user "Brian" creates a folder "mainFolder" in space "restore a space" using the WebDav Api @@ -55,7 +61,9 @@ Feature: Restoring space Scenario Outline: User without space manager role cannot restore space - Given user "Alice" has shared a space "restore a space" to user "Brian" with role "" + Given user "Alice" has shared a space "restore a space" with settings: + | shareWith | Brian | + | role | | And user "Alice" has disabled a space "restore a space" When user "Brian" restores a disabled space "restore a space" owned by user "Alice" Then the HTTP status code should be "404" diff --git a/tests/acceptance/features/apiSpaces/tag.feature b/tests/acceptance/features/apiSpaces/tag.feature index 26f382004c..e9ddd4da24 100644 --- a/tests/acceptance/features/apiSpaces/tag.feature +++ b/tests/acceptance/features/apiSpaces/tag.feature @@ -18,7 +18,9 @@ Feature: Tag Scenario: Alice creates tags for resources in the project space - Given user "Alice" has shared a space "use-tag" to user "Brian" with role "viewer" + Given user "Alice" has shared a space "use-tag" with settings: + | shareWith | Brian | + | role | viewer | When user "Alice" creates the following tags for folder "folderMain" of space "use-tag": | tag level#1 | | tag with symbols @^$#^%$@%!_+) | @@ -81,7 +83,9 @@ Feature: Tag Scenario Outline: Member of the space tries to create tag - Given user "Alice" has shared a space "use-tag" to user "Brian" with role "" + Given user "Alice" has shared a space "use-tag" with settings: + | shareWith | Brian | + | role | | When user "Brian" creates the following tags for folder "folderMain/insideTheFolder.txt" of space "use-tag": | tag level#1 | | tag with symbols @^$#^%$@%!_+) | diff --git a/tests/acceptance/features/apiSpaces/uploadSpaces.feature b/tests/acceptance/features/apiSpaces/uploadSpaces.feature index c987c688d2..b328b7c2d4 100644 --- a/tests/acceptance/features/apiSpaces/uploadSpaces.feature +++ b/tests/acceptance/features/apiSpaces/uploadSpaces.feature @@ -18,7 +18,9 @@ Feature: Upload files into a space Scenario Outline: An user creates a folder in the Space via the Graph API - And user "Alice" has shared a space "Project Ceres" to user "Brian" with role "" + Given user "Alice" has shared a space "Project Ceres" with settings: + | shareWith | Brian | + | role | | When user "Brian" creates a folder "mainFolder" in space "Project Ceres" using the WebDav Api Then the HTTP status code should be "" And for user "Brian" the space "Project Ceres" contain these entries: @@ -31,7 +33,9 @@ Feature: Upload files into a space Scenario Outline: An user uploads a file in shared Space via the Graph API - And user "Alice" has shared a space "Project Ceres" to user "Brian" with role "" + Given user "Alice" has shared a space "Project Ceres" with settings: + | shareWith | Brian | + | role | | When user "Brian" uploads a file inside space "Project Ceres" with content "Test" to "test.txt" using the WebDAV API Then the HTTP status code should be "" And for user "Brian" the space "Project Ceres" contain these entries: diff --git a/tests/acceptance/features/apiSpacesShares/copySpaces.feature b/tests/acceptance/features/apiSpacesShares/copySpaces.feature index ef78faa113..33a12f8289 100644 --- a/tests/acceptance/features/apiSpacesShares/copySpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/copySpaces.feature @@ -17,7 +17,9 @@ Feature: copy file And user "Alice" has created a space "Project" with the default quota using the GraphApi And user "Alice" has created a folder "/newfolder" in space "Project" And user "Alice" has uploaded a file inside space "Project" with content "some content" to "/insideSpace.txt" - And user "Alice" has shared a space "Project" to user "Brian" with role "" + And user "Alice" has shared a space "Project" with settings: + | shareWith | Brian | + | role | | When user "Brian" copies file "/insideSpace.txt" to "/newfolder/insideSpace.txt" inside space "Project" using the WebDAV API Then the HTTP status code should be "201" And for user "Brian" the space "Project" should contain these entries: @@ -34,7 +36,9 @@ Feature: copy file And user "Alice" has created a space "Project" with the default quota using the GraphApi And user "Alice" has created a folder "/newfolder" in space "Project" And user "Alice" has uploaded a file inside space "Project" with content "some content" to "insideSpace.txt" - And user "Alice" has shared a space "Project" to user "Brian" with role "viewer" + And user "Alice" has shared a space "Project" with settings: + | shareWith | Brian | + | role | viewer | When user "Brian" copies file "/insideSpace.txt" to "/newfolder/insideSpace.txt" inside space "Project" using the WebDAV API Then the HTTP status code should be "403" And for user "Brian" the space "Project" should not contain these entries: @@ -46,8 +50,12 @@ Feature: copy file And user "Brian" has created a space "Project1" with the default quota using the GraphApi And user "Brian" has created a space "Project2" with the default quota using the GraphApi And user "Brian" has uploaded a file inside space "Project1" with content "Project1 content" to "/project1.txt" - And user "Brian" has shared a space "Project2" to user "Alice" with role "" - And user "Brian" has shared a space "Project1" to user "Alice" with role "" + And user "Brian" has shared a space "Project2" with settings: + | shareWith | Alice | + | role | | + And user "Brian" has shared a space "Project1" with settings: + | shareWith | Alice | + | role | | When user "Alice" copies file "/project1.txt" from space "Project1" to "/project1.txt" inside space "Project2" using the WebDAV API Then the HTTP status code should be "201" And for user "Alice" the space "Project2" should contain these entries: @@ -66,8 +74,12 @@ Feature: copy file And user "Brian" has created a space "Project1" with the default quota using the GraphApi And user "Brian" has created a space "Project2" with the default quota using the GraphApi And user "Brian" has uploaded a file inside space "Project1" with content "Project1 content" to "/project1.txt" - And user "Brian" has shared a space "Project2" to user "Alice" with role "viewer" - And user "Brian" has shared a space "Project1" to user "Alice" with role "" + And user "Brian" has shared a space "Project2" with settings: + | shareWith | Alice | + | role | viewer | + And user "Brian" has shared a space "Project1" with settings: + | shareWith | Alice | + | role | | When user "Alice" copies file "/project1.txt" from space "Project1" to "/project1.txt" inside space "Project2" using the WebDAV API Then the HTTP status code should be "403" And for user "Alice" the space "Project2" should not contain these entries: @@ -82,7 +94,9 @@ Feature: copy file Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has uploaded a file inside space "Project" with content "Project content" to "/project.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | When user "Alice" copies file "/project.txt" from space "Project" to "/project.txt" inside space "Personal" using the WebDAV API Then the HTTP status code should be "201" And for user "Alice" the space "Personal" should contain these entries: @@ -100,7 +114,9 @@ Feature: copy file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created folder "/testshare" And user "Brian" has uploaded a file inside space "Project" with content "Project content" to "/project.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "31" And user "Alice" has accepted share "/testshare" offered by user "Brian" When user "Alice" copies file "/project.txt" from space "Project" to "/testshare/project.txt" inside space "Shares" using the WebDAV API @@ -120,7 +136,9 @@ Feature: copy file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created folder "/testshare" And user "Brian" has uploaded a file inside space "Project" with content "Project content" to "/project.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "17" And user "Alice" has accepted share "/testshare" offered by user "Brian" When user "Alice" copies file "/project.txt" from space "Project" to "/testshare/project.txt" inside space "Shares" using the WebDAV API @@ -137,7 +155,9 @@ Feature: copy file Scenario Outline: User copies a file from space personal to space project with different role Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Alice" has uploaded file with content "personal space content" to "/personal.txt" When user "Alice" copies file "/personal.txt" from space "Personal" to "/personal.txt" inside space "Project" using the WebDAV API Then the HTTP status code should be "201" @@ -153,7 +173,9 @@ Feature: copy file Scenario: User copies a file from space personal to space project with role viewer Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "viewer" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | viewer | And user "Alice" has uploaded file with content "personal space content" to "/personal.txt" When user "Alice" copies file "/personal.txt" from space "Personal" to "/personal.txt" inside space "Project" using the WebDAV API Then the HTTP status code should be "403" @@ -204,7 +226,9 @@ Feature: copy file Scenario Outline: User copies a file from space Shares with different role to space project with different role Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has created folder "/testshare" And user "Brian" has uploaded file with content "testshare content" to "/testshare/testshare.txt" And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" @@ -225,7 +249,9 @@ Feature: copy file Scenario Outline: User copies a file from space Shares with different role to space project with role viewer Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "viewer" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | viewer | And user "Brian" has created folder "/testshare" And user "Brian" has uploaded file with content "testshare content" to "/testshare/testshare.txt" And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" @@ -288,7 +314,9 @@ Feature: copy file And user "Alice" has created a folder "/folder1" in space "Project" And user "Alice" has created a folder "/folder2" in space "Project" And user "Alice" has uploaded a file inside space "Project" with content "some content" to "/folder2/demo.txt" - And user "Alice" has shared a space "Project" to user "Brian" with role "" + And user "Alice" has shared a space "Project" with settings: + | shareWith | Brian | + | role | | When user "Brian" copies folder "/folder2" to "/folder1/folder2" inside space "Project" using the WebDAV API Then the HTTP status code should be "" And for user "Brian" the space "Project" contain these entries: @@ -306,8 +334,12 @@ Feature: copy file And user "Brian" has created a space "Project2" with the default quota using the GraphApi And user "Brian" has created a folder "/folder1" in space "Project1" And user "Brian" has uploaded a file inside space "Project1" with content "some content" to "/folder1/demo.txt" - And user "Brian" has shared a space "Project2" to user "Alice" with role "" - And user "Brian" has shared a space "Project1" to user "Alice" with role "" + And user "Brian" has shared a space "Project2" with settings: + | shareWith | Alice | + | role | | + And user "Brian" has shared a space "Project1" with settings: + | shareWith | Alice | + | role | | When user "Alice" copies folder "/folder1" from space "Project1" to "/folder1" inside space "Project2" using the WebDAV API Then the HTTP status code should be "" And for user "Alice" the space "Project2" contain these entries: @@ -328,7 +360,9 @@ Feature: copy file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created a folder "/folder1" in space "Project" And user "Brian" has uploaded a file inside space "Project" with content "some content" to "/folder1/demo.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | When user "Alice" copies file "/folder1" from space "Project" to "/folder1" inside space "Personal" using the WebDAV API Then the HTTP status code should be "201" And for user "Alice" the space "Personal" should contain these entries: @@ -346,7 +380,9 @@ Feature: copy file And user "Brian" has created folder "/testshare" And user "Brian" has created a folder "/folder1" in space "Project" And user "Brian" has uploaded a file inside space "Project" with content "some content" to "/folder1/demo.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" And user "Alice" has accepted share "/testshare" offered by user "Brian" When user "Alice" copies folder "/folder1" from space "Project" to "/testshare/folder1" inside space "Shares" using the WebDAV API @@ -366,7 +402,9 @@ Feature: copy file Scenario Outline: User copies a folder from space personal to space project with different role Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Alice" has created folder "/folder1" And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt" When user "Alice" copies folder "/folder1" from space "Personal" to "/folder1" inside space "Project" using the WebDAV API @@ -416,7 +454,9 @@ Feature: copy file Scenario Outline: User copies a folder from space Shares with different role to space project with different role Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has created folder "/testshare" And user "Brian" has created folder "/testshare/folder1" And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt" @@ -437,7 +477,9 @@ Feature: copy file Scenario Outline: User copies a folder from space Shares with different role to space project with role viewer Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "viewer" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | viewer | And user "Brian" has created folder "/testshare" And user "Brian" has created folder "/testshare/folder1" And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt" diff --git a/tests/acceptance/features/apiSpacesShares/moveSpaces.feature b/tests/acceptance/features/apiSpacesShares/moveSpaces.feature index 04b0f44bd9..c56af234a4 100644 --- a/tests/acceptance/features/apiSpacesShares/moveSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/moveSpaces.feature @@ -17,7 +17,9 @@ Feature: move (rename) file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created a folder "newfolder" in space "Project" And user "Brian" has uploaded a file inside space "Project" with content "some content" to "insideSpace.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | When user "Alice" moves file "insideSpace.txt" to "newfolder/insideSpace.txt" in space "Project" using the WebDAV API Then the HTTP status code should be "201" And for user "Alice" the space "Project" should contain these entries: @@ -35,7 +37,9 @@ Feature: move (rename) file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created a folder "newfolder" in space "Project" And user "Brian" has uploaded a file inside space "Project" with content "some content" to "insideSpace.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "viewer" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | viewer | When user "Alice" moves file "insideSpace.txt" to "newfolder/insideSpace.txt" in space "Project" using the WebDAV API Then the HTTP status code should be "403" And for user "Alice" the space "Project" should not contain these entries: @@ -49,8 +53,12 @@ Feature: move (rename) file And user "Brian" has created a space "Project1" with the default quota using the GraphApi And user "Brian" has created a space "Project2" with the default quota using the GraphApi And user "Brian" has uploaded a file inside space "Project1" with content "Project1 content" to "project1.txt" - And user "Brian" has shared a space "Project2" to user "Alice" with role "" - And user "Brian" has shared a space "Project1" to user "Alice" with role "" + And user "Brian" has shared a space "Project2" with settings: + | shareWith | Alice | + | role | | + And user "Brian" has shared a space "Project1" with settings: + | shareWith | Alice | + | role | | When user "Alice" moves file "project1.txt" from space "Project1" to "project1.txt" inside space "Project2" using the WebDAV API Then the HTTP status code should be "" And for user "Alice" the space "Project1" should contain these entries: @@ -74,7 +82,9 @@ Feature: move (rename) file Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has uploaded a file inside space "Project" with content "Project content" to "project.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | When user "Alice" moves file "project.txt" from space "Project" to "project.txt" inside space "Personal" using the WebDAV API Then the HTTP status code should be "" And for user "Alice" the space "Project" should contain these entries: @@ -93,7 +103,9 @@ Feature: move (rename) file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created folder "/testshare" And user "Brian" has uploaded a file inside space "Project" with content "Project content" to "project.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" And user "Alice" has accepted share "/testshare" offered by user "Brian" When user "Alice" moves file "project.txt" from space "Project" to "/testshare/project.txt" inside space "Shares" using the WebDAV API @@ -115,7 +127,9 @@ Feature: move (rename) file Scenario Outline: User moves a file from space personal to space project with different role Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Alice" has uploaded file with content "personal space content" to "/personal.txt" When user "Alice" moves file "personal.txt" from space "Personal" to "personal.txt" inside space "Project" using the WebDAV API Then the HTTP status code should be "" @@ -169,7 +183,9 @@ Feature: move (rename) file Scenario Outline: User moves a file from space Shares with different role (permissions) to space project with different role Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" with settings: + | shareWith | Alice | + | role | | And user "Brian" has created folder "/testshare" And user "Brian" has uploaded file with content "testshare content" to "/testshare/testshare.txt" And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index 239105cf9b..3ce7b96bd3 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -18,7 +18,9 @@ Feature: Share spaces Scenario Outline: A Space Admin can share a space to another user - When user "Alice" shares a space "share space" to user "Brian" with role "" + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | | Then the HTTP status code should be "200" And the OCS status code should be "200" And the OCS status message should be "OK" @@ -35,29 +37,38 @@ Feature: Share spaces Scenario: A user can see who has been granted access - When user "Alice" shares a space "share space" to user "Brian" with role "viewer" + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | viewer | Then the user "Alice" should have a space called "share space" granted to user "Brian" with role "viewer" Scenario: A user can see that the group has been granted access Given group "sales" has been created - When user "Alice" shares a space "share space" to group "sales" with role "viewer" + When user "Alice" shares a space "share space" with settings: + | shareWith | sales | + | shareType | 8 | + | role | viewer | Then the HTTP status code should be "200" And the OCS status code should be "200" And the user "Alice" should have a space called "share space" granted to group "sales" with role "viewer" - - + + Scenario: A user can see a file in a received shared space Given user "Alice" has uploaded a file inside space "share space" with content "Test" to "test.txt" And user "Alice" has created a folder "Folder Main" in space "share space" - When user "Alice" shares a space "share space" to user "Brian" with role "viewer" + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | viewer | Then for user "Brian" the space "share space" should contain these entries: | test.txt | | Folder Main | Scenario: When a user unshares a space, the space becomes unavailable to the receiver - Given user "Alice" has shared a space "share space" to user "Brian" with role "viewer" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | viewer | And the user "Brian" should have a space called "share space" with these key and value pairs: | key | value | | driveType | project | @@ -69,7 +80,9 @@ Feature: Share spaces Scenario Outline: Owner of a space cannot see the space after removing his access to the space - Given user "Alice" has shared a space "share space" to user "Brian" with role "manager" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | manager | When user "" unshares a space "share space" to user "Alice" Then the HTTP status code should be "200" And the user "Brian" should have a space called "share space" owned by "Alice" with these key and value pairs: @@ -86,9 +99,13 @@ Feature: Share spaces Scenario: A user can add another user to the space managers to enable him Given user "Alice" has uploaded a file inside space "share space" with content "Test" to "test.txt" - When user "Alice" shares a space "share space" to user "Brian" with role "manager" + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | manager | Then the user "Brian" should have a space called "share space" granted to "Brian" with role "manager" - When user "Brian" shares a space "share space" to user "Bob" with role "viewer" + When user "Brian" shares a space "share space" with settings: + | shareWith | Bob | + | role | viewer | Then the user "Bob" should have a space called "share space" granted to "Bob" with role "viewer" And for user "Bob" the space "share space" should contain these entries: | test.txt | @@ -96,7 +113,9 @@ Feature: Share spaces Scenario Outline: A user cannot share a disabled space to another user Given user "Alice" has disabled a space "share space" - When user "Alice" shares a space "share space" to user "Brian" with role "" + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | | Then the HTTP status code should be "404" And the OCS status code should be "404" And the OCS status message should be "Wrong path, file/folder doesn't exist" @@ -109,8 +128,12 @@ Feature: Share spaces Scenario Outline: A user with manager role can share a space to another user - Given user "Alice" has shared a space "share space" to user "Brian" with role "manager" - When user "Brian" shares a space "share space" to user "Bob" with role "" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | manager | + When user "Brian" shares a space "share space" with settings: + | shareWith | Bob | + | role | | Then the HTTP status code should be "200" And the OCS status code should be "200" And the OCS status message should be "OK" @@ -127,8 +150,12 @@ Feature: Share spaces Scenario Outline: A user with editor or viewer role cannot share a space to another user - Given user "Alice" has shared a space "share space" to user "Brian" with role "" - When user "Brian" shares a space "share space" to user "Bob" with role "" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" shares a space "share space" with settings: + | shareWith | Bob | + | role | | Then the HTTP status code should be "404" And the OCS status code should be "404" And the OCS status message should be "No share permission" @@ -144,8 +171,12 @@ Feature: Share spaces Scenario Outline: space manager can change the role of space members - Given user "Alice" has shared a space "share space" to user "Brian" with role "" - When user "Alice" updates the space "share space" for user "Brian" changing the role to "" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | | + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | | Then the HTTP status code should be "200" And the OCS status code should be "200" And the user "Alice" should have a space called "share space" granted to "Brian" with role "" @@ -160,9 +191,15 @@ Feature: Share spaces Scenario Outline: user without manager role cannot change the role of space members - Given user "Alice" has shared a space "share space" to user "Brian" with role "" - And user "Alice" has shared a space "share space" to user "Bob" with role "viewer" - When user "Brian" updates the space "share space" for user "Bob" changing the role to "" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | | + And user "Alice" has shared a space "share space" with settings: + | shareWith | Bob | + | role | viewer | + When user "Brian" updates the space "share space" with settings: + | shareWith | Bob | + | role | | Then the HTTP status code should be "404" And the OCS status code should be "404" And the user "Alice" should have a space called "share space" granted to "Bob" with role "viewer" @@ -178,7 +215,10 @@ Feature: Share spaces Given group "group2" has been created And the administrator has added a user "Brian" to the group "group2" using GraphApi And the administrator has added a user "Bob" to the group "group2" using GraphApi - When user "Alice" shares a space "share space" to group "group2" with role "" + When user "Alice" shares a space "share space" with settings: + | shareWith | group2 | + | shareType | 8 | + | role | | Then the HTTP status code should be "200" And the user "Brian" should have a space called "share space" with these key and value pairs: | key | value | @@ -198,7 +238,10 @@ Feature: Share spaces Scenario Outline: The user has no access to the space if access for the group has been removed Given group "group2" has been created And the administrator has added a user "Brian" to the group "group2" using GraphApi - And user "Alice" has shared a space "share space" to group "group2" with role "" + And user "Alice" has shared a space "share space" with settings: + | shareWith | group2 | + | shareType | 8 | + | role | | When user "Alice" unshares a space "share space" to group "group2" Then the HTTP status code should be "200" And the user "Brian" should not have a space called "share space" @@ -213,7 +256,10 @@ Feature: Share spaces Given group "group2" has been created And the administrator has added a user "Brian" to the group "group2" using GraphApi And the administrator has added a user "Bob" to the group "group2" using GraphApi - And user "Alice" has shared a space "share space" to group "group2" with role "editor" + And user "Alice" has shared a space "share space" with settings: + | shareWith | group2 | + | shareType | 8 | + | role | editor | When the administrator removes the following users from the following groups using the Graph API | username | groupname | | Brian | group2 | @@ -229,24 +275,76 @@ Feature: Share spaces Given group "group2" has been created And the administrator has added a user "Brian" to the group "group2" using GraphApi And the administrator has added a user "Bob" to the group "group2" using GraphApi - And user "Alice" has shared a space "share space" to group "group2" with role "editor" + And user "Alice" has shared a space "share space" with settings: + | shareWith | group2 | + | shareType | 8 | + | role | editor | When the administrator deletes group "group2" using the Graph API Then the HTTP status code should be "204" And the user "Brian" should not have a space called "share space" And the user "Bob" should not have a space called "share space" - Scenario Outline: User increases permissions for one member of the group or for the entire group + Scenario: User increases permissions for one member of the group or for the entire group Given group "sales" has been created And the administrator has added a user "Brian" to the group "sales" using GraphApi - And user "Alice" has shared a space "share space" to with role "viewer" + And user "Alice" has shared a space "share space" with settings: + | shareWith | sales | + | shareType | 8 | + | role | viewer | When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API Then the HTTP status code should be "403" - When user "Alice" shares a space "share space" to with role "editor" + When user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | editor | Then the HTTP status code should be "200" When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API Then the HTTP status code should be "201" + + + Scenario: User increases permissions for the group, so the user's permissions are increased + Given group "sales" has been created + And the administrator has added a user "Brian" to the group "sales" using GraphApi + And user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | viewer | + When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API + Then the HTTP status code should be "403" + When user "Alice" has shared a space "share space" with settings: + | shareWith | sales | + | shareType | 8 | + | role | editor | + Then the HTTP status code should be "200" + When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API + Then the HTTP status code should be "201" + + + Scenario Outline: A Space Admin can share a space to the user with an expiration date + When user "Alice" shares a space "share space" with settings: + | shareWith | Brian | + | role | | + | expireDate | 2042-03-25T23:59:59+0100 | + Then the HTTP status code should be "200" + And the user "Brian" should have a space called "share space" granted to user "Brian" with role "" and expiration date "2042-03-25" Examples: - | firstRecipient | secondRecipient | - | group "sales" | user "Brian" | - | user "Brian" | group "sales" | + | role | + | manager | + | editor | + | viewer | + + + Scenario Outline: A Space Admin can share a space to the group with an expiration date + Given group "sales" has been created + And the administrator has added a user "Brian" to the group "sales" using GraphApi + When user "Alice" shares a space "share space" with settings: + | shareWith | sales | + | shareType | 8 | + | role | | + | expireDate | 2042-03-25T23:59:59+0100 | + Then the HTTP status code should be "200" + And the user "Brian" should have a space called "share space" granted to group "sales" with role "" and expiration date "2042-03-25" + Examples: + | role | + | manager | + | editor | + | viewer | \ No newline at end of file diff --git a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature index 7104ba45c1..68f1879213 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature @@ -71,7 +71,9 @@ Feature: Share spaces via link Scenario Outline: An user without manager role cannot share a space to public via link - Given user "Alice" has shared a space "share space" to user "Brian" with role "" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | | When user "Brian" creates a public link share of the space "share space" with settings: | permissions | 1 | Then the HTTP status code should be "404" @@ -85,7 +87,9 @@ Feature: Share spaces via link Scenario: An user with manager role can share a space to public via link - Given user "Alice" has shared a space "share space" to user "Brian" with role "manager" + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | manager | When user "Brian" creates a public link share of the space "share space" with settings: | permissions | 1 | Then the HTTP status code should be "200" diff --git a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature index e1b25aa657..f7f189b578 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature @@ -43,7 +43,9 @@ Feature: Share a file or folder that is inside a space Scenario Outline: A user participant of the project space with manager role can share an entity to another user - Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "manager" + Given user "Alice" has shared a space "share sub-item" with settings: + | shareWith | Brian | + | role | manager | When user "Brian" creates a share inside of space "share sub-item" with settings: | path | | | shareWith | Bob | @@ -65,7 +67,9 @@ Feature: Share a file or folder that is inside a space Scenario Outline: A user participant of the project space without space manager role cannot share an entity to another user - Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "" + Given user "Alice" has shared a space "share sub-item" with settings: + | shareWith | Brian | + | role | | When user "Brian" creates a share inside of space "share sub-item" with settings: | path | | | shareWith | Bob | @@ -82,7 +86,9 @@ Feature: Share a file or folder that is inside a space Scenario Outline: A user participant of the project space can see the created resources share - Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "" + Given user "Alice" has shared a space "share sub-item" with settings: + | shareWith | Brian | + | role | | When user "Alice" creates a share inside of space "share sub-item" with settings: | path | file.txt | | shareWith | Bob | diff --git a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature index cc62dcc820..0f4000e832 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature @@ -1,21 +1,21 @@ @api @skipOnOcV10 Feature: Share a file or folder that is inside a space via public link - As an user with manager space role - I want to be able to share the data inside the space via public link + As an user with manager space role + I want to be able to share the data inside the space via public link - folder permissions: - | role | permissions | - | internal | 0 | - | viewer | 1 | - | uploader | 4 | - | contributor | 5 | - | editor | 15 | + folder permissions: + | role | permissions | + | internal | 0 | + | viewer | 1 | + | uploader | 4 | + | contributor | 5 | + | editor | 15 | - file permissions: - | role | permissions | - | internal | 0 | - | viewer | 1 | - | editor | 3 | + file permissions: + | role | permissions | + | internal | 0 | + | viewer | 1 | + | editor | 3 | Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839 @@ -65,7 +65,9 @@ Feature: Share a file or folder that is inside a space via public link Scenario Outline: An user participant of the project space with space manager role can share an entity inside project space via public link - Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "manager" + Given user "Alice" has shared a space "share sub-item" with settings: + | shareWith | Brian | + | role | manager | When user "Brian" creates a public link share inside of space "share sub-item" with settings: | path | | | shareType | 3 | @@ -91,7 +93,9 @@ Feature: Share a file or folder that is inside a space via public link Scenario Outline: An user participant of the project space without space manager role cannot share an entity inside project space via public link - Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "" + Given user "Alice" has shared a space "share sub-item" with settings: + | shareWith | Brian | + | role | | When user "Brian" creates a public link share inside of space "share sub-item" with settings: | path | | | shareType | 3 | @@ -138,7 +142,9 @@ Feature: Share a file or folder that is inside a space via public link Scenario Outline: An user participant of the project space can see the created public resources link - Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "" + Given user "Alice" has shared a space "share sub-item" with settings: + | shareWith | Brian | + | role | | When user "Alice" creates a public link share inside of space "share sub-item" with settings: | path | folder/file.txt | | shareType | 3 | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index df48b530cd..1d02a42178 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1888,14 +1888,12 @@ class SpacesContext implements Context { } /** - * @When /^user "([^"]*)" shares a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/ - * @When /^user "([^"]*)" shares a space "([^"]*)" to group "([^"]*)" with role "([^"]*)"$/ - * @When /^user "([^"]*)" updates the space "([^"]*)" for user "([^"]*)" changing the role to "([^"]*)"$/ + * @When /^user "([^"]*)" shares a space "([^"]*)" with settings:$/ + * @When /^user "([^"]*)" updates the space "([^"]*)" with settings:$/ * * @param string $user * @param string $spaceName - * @param string $recipient - * @param string $role + * @param TableNode $table * * @return void * @throws GuzzleException @@ -1903,19 +1901,23 @@ class SpacesContext implements Context { public function sendShareSpaceRequest( string $user, string $spaceName, - string $recipient, - string $role + TableNode $table ): void { $space = $this->getSpaceByName($user, $spaceName); $availableRoleToAssignToShareSpace = ['manager', 'editor', 'viewer']; - if (!\in_array(\strtolower($role), $availableRoleToAssignToShareSpace)) { - throw new Error("The Selected " . $role . " Cannot be Found"); + $rows = $table->getRowsHash(); + if (!\in_array(\strtolower($rows['role']), $availableRoleToAssignToShareSpace)) { + throw new Error("The Selected " . $rows['role'] . " Cannot be Found"); } + $rows["shareType"] = \array_key_exists("shareType", $rows) ? $rows["shareType"] : 7; + $rows["expireDate"] = \array_key_exists("expireDate", $rows) ? $rows["expireDate"] : null; + $body = [ - "space_ref" => $space['id'], - "shareType" => 7, - "shareWith" => $recipient, - "role" => $role // role overrides the permissions parameter + "space_ref" => $space["id"], + "shareType" => $rows["shareType"], + "shareWith" => $rows["shareWith"], + "role" => $rows["role"], + "expireDate" => $rows["expireDate"] ]; $fullUrl = $this->baseUrl . $this->ocsApiUrl; @@ -2102,12 +2104,11 @@ class SpacesContext implements Context { } /** - * @Given /^user "([^"]*)" has shared a space "([^"]*)" to (?:user|group) "([^"]*)" with role "([^"]*)"$/ + * @Given /^user "([^"]*)" has shared a space "([^"]*)" with settings:$/ * * @param string $user * @param string $spaceName - * @param string $recipient - * @param string $role + * @param TableNode $tableNode * * @return void * @throws GuzzleException @@ -2115,10 +2116,9 @@ class SpacesContext implements Context { public function userHasSharedSpace( string $user, string $spaceName, - string $recipient, - string $role + TableNode $tableNode ): void { - $this->sendShareSpaceRequest($user, $spaceName, $recipient, $role); + $this->sendShareSpaceRequest($user, $spaceName, $tableNode); $expectedHTTPStatus = "200"; $this->featureContext->theHTTPStatusCodeShouldBe( $expectedHTTPStatus, @@ -3195,12 +3195,14 @@ class SpacesContext implements Context { /** * @Then /^the user "([^"]*)" should have a space called "([^"]*)" granted to (user|group)\s? "([^"]*)" with role "([^"]*)"$/ + * @Then /^the user "([^"]*)" should have a space called "([^"]*)" granted to (user|group)\s? "([^"]*)" with role "([^"]*)" and expiration date "([^"]*)"$/ * * @param string $user * @param string $spaceName * @param string $recipientType * @param string $recipient * @param string $role + * @param string $expirationDate * * @return void * @@ -3212,7 +3214,8 @@ class SpacesContext implements Context { string $spaceName, string $recipientType, string $recipient, - string $role + string $role, + string $expirationDate = null ): void { $this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user); $this->featureContext->theHTTPStatusCodeShouldBe( @@ -3225,6 +3228,10 @@ class SpacesContext implements Context { foreach ($spaceAsArray['root']['permissions'] as $permission) { if (isset($permission['grantedToIdentities'][0][$recipientType]) && $permission['roles'][0] === $role && $permission['grantedToIdentities'][0][$recipientType]['id'] === $recipientId) { $foundRoleInResponse = true; + if ($expirationDate !== null) { + Assert::assertArrayHasKey('expirationDateTime', $permission, 'expirationDateTime key not found in response'); + Assert::assertEquals($expirationDate, (preg_split("/[\sT]+/", $permission['expirationDateTime']))[0], "$expirationDate is different in the response"); + } break; } }