diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index a5f191d9552..98181dba5c8 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -35,15 +35,19 @@ _ocdav: double-check the webdav property parsing when custom namespaces are used #### [file versions do not report the version author](https://github.com/owncloud/ocis/issues/2914) -- [coreApiVersions/fileVersionAuthor.feature:14](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L14) -- [coreApiVersions/fileVersionAuthor.feature:37](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L37) -- [coreApiVersions/fileVersionAuthor.feature:58](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L58) -- [coreApiVersions/fileVersionAuthor.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L78) -- [coreApiVersions/fileVersionAuthor.feature:104](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L104) -- [coreApiVersions/fileVersionAuthor.feature:129](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L129) -- [coreApiVersions/fileVersionAuthor.feature:154](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L154) -- [coreApiVersions/fileVersionAuthor.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L180) +- [coreApiVersions/fileVersionAuthor.feature:13](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L13) +- [coreApiVersions/fileVersionAuthor.feature:44](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L44) +- [coreApiVersions/fileVersionAuthor.feature:71](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L71) +- [coreApiVersions/fileVersionAuthor.feature:97](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L97) +- [coreApiVersions/fileVersionAuthor.feature:130](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L130) +- [coreApiVersions/fileVersionAuthor.feature:157](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L157) +- [coreApiVersions/fileVersionAuthor.feature:188](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L188) - [coreApiVersions/fileVersionAuthor.feature:223](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L223) +- [coreApiVersions/fileVersionAuthor.feature:275](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L275) +- [coreApiVersions/fileVersionAuthor.feature:324](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L324) +- [coreApiVersions/fileVersionAuthor.feature:345](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L345) +- [coreApiVersions/fileVersionAuthor.feature:365](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L365) +- [coreApiVersions/fileVersionAuthor.feature:390](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L390) ### Sync @@ -307,8 +311,6 @@ cannot share a folder with create permission - [coreApiShareOperationsToShares1/changingFilesShare.feature:131](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L131) - [coreApiShareOperationsToShares1/changingFilesShare.feature:132](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L132) - [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:538](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L538) -- [coreApiVersions/fileVersionsSharingToShares.feature:220](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature#L220) -- [coreApiVersions/fileVersionsSharingToShares.feature:221](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature#L221) - [coreApiWebdavMove2/moveShareOnOcis.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L30) - [coreApiWebdavMove2/moveShareOnOcis.feature:32](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L32) - [coreApiWebdavMove2/moveShareOnOcis.feature:98](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L98) @@ -465,7 +467,7 @@ cannot share a folder with create permission #### [user can access version metadata of a received share before accepting it](https://github.com/owncloud/ocis/issues/760) -- [coreApiVersions/fileVersionsSharingToShares.feature:283](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature#L283) +- [coreApiVersions/fileVersions.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L487) #### [Share lists deleted user as 'user'](https://github.com/owncloud/ocis/issues/903) diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index d966840cd86..af9a0b1212c 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -5497,13 +5497,23 @@ public function theAuthorOfEditedVersionFile(string $index, string $expectedUser } // the username should be in oc:meta-version-edited-by - $xmlPart = $resXml->xpath("//oc:meta-version-edited-by//text()"); - if (!isset($xmlPart[$index - 1])) { + $xmlPart = $resXml->xpath("//oc:meta-version-edited-by"); + $authors = []; + foreach ($xmlPart as $idx => $author) { + // The first element is the root path element which is not a version + // So skipping it + if ($idx !== 0) { + $authors[] = $author->__toString(); + } + } + // reverse the array to get the latest version first + \array_reverse($authors); + if (!isset($authors[$index - 1])) { Assert::fail( 'could not find version with index "' . $index . '" for oc:meta-version-edited-by property in response to user "' . $this->responseUser . '"' ); } - $actualUser = $xmlPart[$index - 1][0]; + $actualUser = $authors[$index - 1]; Assert::assertEquals( $expectedUsername, $actualUser, @@ -5511,17 +5521,27 @@ public function theAuthorOfEditedVersionFile(string $index, string $expectedUser ); // the user's display name should be in oc:meta-version-edited-by-name - $xmlPart = $resXml->xpath("//oc:meta-version-edited-by-name//text()"); - if (!isset($xmlPart[$index - 1])) { + $xmlPart = $resXml->xpath("//oc:meta-version-edited-by-name"); + $displaynames = []; + foreach ($xmlPart as $idx => $displayname) { + // The first element is the root path element which is not a version + // So skipping it + if ($idx !== 0) { + $displaynames[] = $displayname->__toString(); + } + } + // reverse the array to get the latest version first + \array_reverse($displaynames); + if (!isset($displaynames[$index - 1])) { Assert::fail( 'could not find version with index "' . $index . '" for oc:meta-version-edited-by-name property in response to user "' . $this->responseUser . '"' ); } - $actualUserDisplayName = $xmlPart[$index - 1][0]; + $actualUserDisplayName = $displaynames[$index - 1]; Assert::assertEquals( $expectedUserDisplayName, $actualUserDisplayName, - "Expected display name of version with index $index in response to user '$this->responseUser' was '$expectedUsername', but got '$actualUser'" + "Expected display name of version with index $index in response to user '$this->responseUser' was '$expectedUserDisplayName', but got '$actualUserDisplayName'" ); } } diff --git a/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature b/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature index dd04dbbaecc..d04ffcbf743 100644 --- a/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature +++ b/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature @@ -1,5 +1,4 @@ -@api @files_versions-app-required @issue-ocis-reva-275 - +@api @issue-2914 Feature: file versions remember the author of each version Background: @@ -10,30 +9,38 @@ Feature: file versions remember the author of each version And user "Carol" has been created with default attributes and without skeleton files And the administrator has enabled the file version storage feature - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes from multiple users Given user "David" has been created with default attributes and without skeleton files And user "Alice" has created folder "/test" And user "Alice" has shared folder "/test" with user "Brian" with permissions "all" + And user "Brian" has accepted share "/test" offered by user "Alice" And user "Alice" has shared folder "/test" with user "Carol" with permissions "all" + And user "Carol" has accepted share "/test" offered by user "Alice" And user "Alice" has shared folder "/test" with user "David" with permissions "all" + And user "David" has accepted share "/test" offered by user "Alice" And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" - And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt" - And user "David" has uploaded file with content "uploaded content david" to "/test/textfile0.txt" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt" + And user "David" has uploaded file with content "uploaded content david" to "/Shares/test/textfile0.txt" When user "Alice" gets the number of versions of file "/test/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "3" And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol" And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,Brian,Carol,David" the authors of the versions of file "/test/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Brian | + | 3 | Alice | + And as users "Brian,Carol,David" the authors of the versions of file "/Shares/test/textfile0.txt" should be: | index | author | | 1 | Carol | | 2 | Brian | | 3 | Alice | - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes from multiple users for shared folder in the group Given user "Alice" has created folder "/test" And group "grp1" has been created @@ -41,20 +48,26 @@ Feature: file versions remember the author of each version And user "Brian" has been added to group "grp1" And user "Carol" has been added to group "grp1" And user "Alice" has shared folder "/test" with group "grp1" + And user "Brian" has accepted share "/test" offered by user "Alice" + And user "Carol" has accepted share "/test" offered by user "Alice" And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" - And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt" When user "Alice" gets the number of versions of file "/test/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "2" And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,Brian,Carol" the authors of the versions of file "/test/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be: + | index | author | + | 1 | Brian | + | 2 | Alice | + And as users "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be: | index | author | | 1 | Brian | | 2 | Alice | - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes from multiple users for shared file in the group Given group "grp1" has been created And user "Alice" has been added to group "grp1" @@ -62,19 +75,25 @@ Feature: file versions remember the author of each version And user "Carol" has been added to group "grp1" And user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt" And user "Alice" has shared file "/textfile0.txt" with group "grp1" - And user "Brian" has uploaded file with content "uploaded content brian" to "/textfile0.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/textfile0.txt" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Carol" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/textfile0.txt" When user "Alice" gets the number of versions of file "textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "2" And the content of version index "1" of file "/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "2" of file "/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,Brian,Carol" the authors of the versions of file "/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/textfile0.txt" should be: | index | author | | 1 | Brian | | 2 | Alice | + And as users "Brian,Carol" the authors of the versions of file "/Shares/textfile0.txt" should be: + | index | author | + | 1 | Brian | + | 2 | Alice | + - @skip_on_objectstore @skipOnEncryption @issue-encryption-321 Scenario: enable file versioning and check the history of changes from multiple users while moving file in/out of a subfolder Given user "Alice" has created folder "/test" And group "grp1" has been created @@ -82,25 +101,32 @@ Feature: file versions remember the author of each version And user "Brian" has been added to group "grp1" And user "Carol" has been added to group "grp1" And user "Alice" has shared folder "/test" with group "grp1" + And user "Brian" has accepted share "/test" offered by user "Alice" + And user "Carol" has accepted share "/test" offered by user "Alice" And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" - And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt" - And user "Brian" has moved file "/test/textfile0.txt" to "/textfile0.txt" - And user "Brian" has uploaded file with content "uploaded content brian after moving file outside subfolder" to "/textfile0.txt" - And user "Brian" has moved file "/textfile0.txt" to "/test/textfile0.txt" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt" + And user "Alice" has moved file "/test/textfile0.txt" to "/textfile0.txt" + And user "Alice" has uploaded file with content "uploaded content alice after moving file outside subfolder" to "/textfile0.txt" + And user "Alice" has moved file "/textfile0.txt" to "/test/textfile0.txt" When user "Alice" gets the number of versions of file "/test/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "3" And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol" And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,Brian,Carol" the authors of the versions of file "/test/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be: | index | author | | 1 | Carol | | 2 | Brian | | 3 | Alice | + And as users "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Brian | + | 3 | Alice | + - @skip_on_objectstore Scenario: enable file versioning and check the history of changes from multiple users after renaming file by sharer Given group "grp1" has been created And user "Alice" has been added to group "grp1" @@ -108,8 +134,10 @@ Feature: file versions remember the author of each version And user "Carol" has been added to group "grp1" And user "Alice" has uploaded file with content "uploaded content alice" to "/exist.txt" And user "Alice" has shared file "/exist.txt" with group "grp1" - And user "Brian" has uploaded file with content "uploaded content brian" to "/exist.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/exist.txt" + And user "Brian" has accepted share "/exist.txt" offered by user "Alice" + And user "Carol" has accepted share "/exist.txt" offered by user "Alice" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/exist.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/exist.txt" And user "Alice" has moved file "/exist.txt" to "/textfile0.txt" When user "Alice" gets the number of versions of file "textfile0.txt" Then the HTTP status code should be "207" @@ -120,12 +148,12 @@ Feature: file versions remember the author of each version | index | author | | 1 | Brian | | 2 | Alice | - And as users "Brian,Carol" the authors of the versions of file "/exist.txt" should be: + And as users "Brian,Carol" the authors of the versions of file "/Shares/exist.txt" should be: | index | author | | 1 | Brian | | 2 | Alice | - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes in sharer after renaming file by sharee Given group "grp1" has been created And user "Alice" has been added to group "grp1" @@ -133,24 +161,30 @@ Feature: file versions remember the author of each version And user "Carol" has been added to group "grp1" And user "Alice" has uploaded file with content "uploaded content alice" to "/exist.txt" And user "Alice" has shared file "/exist.txt" with group "grp1" - And user "Brian" has uploaded file with content "uploaded content brian" to "/exist.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/exist.txt" - And user "Brian" has moved file "/exist.txt" to "/textfile0.txt" + And user "Brian" has accepted share "/exist.txt" offered by user "Alice" + And user "Carol" has accepted share "/exist.txt" offered by user "Alice" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/exist.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/exist.txt" + And user "Brian" has moved file "/Shares/exist.txt" to "/Shares/textfile0.txt" When user "Alice" gets the number of versions of file "exist.txt" Then the HTTP status code should be "207" And the number of versions should be "2" And the content of version index "1" of file "/exist.txt" for user "Alice" should be "uploaded content brian" And the content of version index "2" of file "/exist.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,Carol" the authors of the versions of file "/exist.txt" should be: + And as users "Alice" the authors of the versions of file "/exist.txt" should be: | index | author | | 1 | Brian | | 2 | Alice | - And as user "Brian" the authors of the versions of file "/textfile0.txt" should be: + And as users "Carol" the authors of the versions of file "/Shares/exist.txt" should be: + | index | author | + | 1 | Brian | + | 2 | Alice | + And as user "Brian" the authors of the versions of file "/Shares/textfile0.txt" should be: | index | author | | 1 | Brian | | 2 | Alice | - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes from multiple users when reshared after unshared by sharer Given user "Alice" has created folder "/test" And group "grp1" has been created @@ -158,52 +192,70 @@ Feature: file versions remember the author of each version And user "Brian" has been added to group "grp1" And user "Carol" has been added to group "grp1" And user "Alice" has shared folder "/test" with group "grp1" + And user "Brian" has accepted share "/test" offered by user "Alice" + And user "Carol" has accepted share "/test" offered by user "Alice" And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" - And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt" And user "Alice" has deleted the last share And user "Alice" has uploaded file with content "uploaded content alice after unshared folder" to "/test/textfile0.txt" And user "Alice" has shared folder "/test" with group "grp1" + And user "Brian" has accepted share "/test" offered by user "Alice" + And user "Carol" has accepted share "/test" offered by user "Alice" When user "Alice" gets the number of versions of file "/test/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "3" And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol" And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,Brian,Carol" the authors of the versions of file "/test/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Brian | + | 3 | Alice | + And as users "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be: | index | author | | 1 | Carol | | 2 | Brian | | 3 | Alice | - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes from multiple users who have a matching folder/file Given user "David" has been created with default attributes and without skeleton files And user "Brian" has created folder "/test" And user "Brian" has uploaded file with content "duplicate brian" to "/test/textfile0.txt" And user "Brian" has uploaded file with content "overwrite brian" to "/test/textfile0.txt" + And user "Brian" has shared folder "/test" with user "Carol" with permissions "all" + And user "Carol" has accepted share "/test" offered by user "Brian" + And user "Brian" has shared folder "/test" with user "David" with permissions "all" + And user "David" has accepted share "/test" offered by user "Brian" And user "Carol" has created folder "/test" And user "Carol" has uploaded file with content "duplicate carol" to "/test/textfile0.txt" + And user "Carol" has shared folder "/test" with user "Brian" with permissions "all" + And user "Brian" has accepted share "/test" offered by user "Carol" And user "Alice" has created folder "/test" And user "Alice" has shared folder "/test" with user "Brian" with permissions "all" + And user "Brian" has accepted share "/test" offered by user "Alice" And user "Alice" has shared folder "/test" with user "Carol" with permissions "all" + And user "Carol" has accepted share "/test" offered by user "Alice" And user "Alice" has shared folder "/test" with user "David" with permissions "all" + And user "David" has accepted share "/test" offered by user "Alice" And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" - And user "Brian" has uploaded file with content "uploaded content brian" to "/test (2)/textfile0.txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/test (2)/textfile0.txt" - And user "David" has uploaded file with content "uploaded content david" to "/test/textfile0.txt" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test (1)/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test (1)/textfile0.txt" + And user "David" has uploaded file with content "uploaded content david" to "/Shares/test (1)/textfile0.txt" When user "Alice" gets the number of versions of file "/test/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "3" And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol" And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,David" the authors of the versions of file "/test/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be: | index | author | | 1 | Carol | | 2 | Brian | | 3 | Alice | - And as users "Brian,Carol" the authors of the versions of file "/test (2)/textfile0.txt" should be: + And as users "Brian,Carol,David" the authors of the versions of file "/Shares/test (1)/textfile0.txt" should be: | index | author | | 1 | Carol | | 2 | Brian | @@ -219,31 +271,40 @@ Feature: file versions remember the author of each version Then the HTTP status code should be "207" And the number of versions should be "0" - @skip_on_objectstore + Scenario: enable file versioning and check the history of changes from multiple users who have a matching file Given user "David" has been created with default attributes and without skeleton files And user "Brian" has uploaded file with content "duplicate brian" to "/textfile0.txt" And user "Brian" has uploaded file with content "overwrite brian" to "/textfile0.txt" + And user "Brian" has shared file "/textfile0.txt" with user "Carol" + And user "Carol" has accepted share "/textfile0.txt" offered by user "Brian" + And user "Brian" has shared file "/textfile0.txt" with user "David" + And user "David" has accepted share "/textfile0.txt" offered by user "Brian" And user "Carol" has uploaded file with content "duplicate carol" to "/textfile0.txt" + And user "Carol" has shared file "/textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Carol" And user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt" And user "Alice" has shared file "/textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" And user "Alice" has shared file "/textfile0.txt" with user "Carol" + And user "Carol" has accepted share "/textfile0.txt" offered by user "Alice" And user "Alice" has shared file "/textfile0.txt" with user "David" - And user "Brian" has uploaded file with content "uploaded content brian" to "/textfile0 (2).txt" - And user "Carol" has uploaded file with content "uploaded content carol" to "/textfile0 (2).txt" - And user "David" has uploaded file with content "uploaded content david" to "/textfile0.txt" + And user "David" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0 (1).txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/textfile0 (1).txt" + And user "David" has uploaded file with content "uploaded content david" to "/Shares/textfile0 (1).txt" When user "Alice" gets the number of versions of file "/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "3" And the content of version index "1" of file "/textfile0.txt" for user "Alice" should be "uploaded content carol" And the content of version index "2" of file "/textfile0.txt" for user "Alice" should be "uploaded content brian" And the content of version index "3" of file "/textfile0.txt" for user "Alice" should be "uploaded content alice" - And as users "Alice,David" the authors of the versions of file "/textfile0.txt" should be: + And as users "Alice" the authors of the versions of file "/textfile0.txt" should be: | index | author | | 1 | Carol | | 2 | Brian | | 3 | Alice | - And as users "Brian,Carol" the authors of the versions of file "/textfile0 (2).txt" should be: + And as users "Brian,Carol,David" the authors of the versions of file "/Shares/textfile0 (1).txt" should be: | index | author | | 1 | Carol | | 2 | Brian | @@ -258,3 +319,95 @@ Feature: file versions remember the author of each version When user "Carol" gets the number of versions of file "/textfile0.txt" Then the HTTP status code should be "207" And the number of versions should be "0" + + + Scenario: enable file versioning and check the version author after restoring a version of a file inside a folder + Given user "Alice" has created folder "/test" + And user "Alice" has shared folder "/test" with user "Brian" with permissions "all" + And user "Brian" has accepted share "/test" offered by user "Alice" + And user "Alice" has shared folder "/test" with user "Carol" with permissions "all" + And user "Carol" has accepted share "/test" offered by user "Alice" + And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt" + When user "Brian" restores version index "1" of file "/Shares/test/textfile0.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as user "Alice" the authors of the versions of file "/test/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Alice | + And as user "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Alice | + + + Scenario: enable file versioning and check the version author after restoring a version of a file + Given user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Alice" has shared file "/textfile0.txt" with user "Carol" + And user "Carol" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0.txt" + And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/textfile0.txt" + When user "Brian" restores version index "1" of file "/Shares/textfile0.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as user "Alice" the authors of the versions of file "/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Alice | + And as user "Brian,Carol" the authors of the versions of file "/Shares/textfile0.txt" should be: + | index | author | + | 1 | Carol | + | 2 | Alice | + + + Scenario: check the author of the file version which was created before enabling the version storage + Given the administrator has disabled the file version storage feature + And user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt" + And user "Alice" has shared folder "/textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + And the administrator has enabled the file version storage feature + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0.txt" + When user "Brian" restores version index "1" of file "/Shares/textfile0.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as user "Alice" the authors of the versions of file "/textfile0.txt" should be: + | index | author | + | 1 | Brian | + And as user "Brian" the authors of the versions of file "/Shares/textfile0.txt" should be: + | index | author | + | 1 | Brian | + When user "Brian" restores version index "1" of file "/Shares/textfile0.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as user "Alice" the authors of the versions of file "/textfile0.txt" should be: + | index | author | + | 1 | | + And as user "Brian" the authors of the versions of file "/Shares/textfile0.txt" should be: + | index | author | + | 1 | | + + + Scenario: check the author of the file version (inside a folder) which was created before enabling the version storage + Given user "Alice" has created folder "/test" + And the administrator has disabled the file version storage feature + And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt" + And user "Alice" has shared folder "/test" with user "Brian" with permissions "all" + And user "Brian" has accepted share "/test" offered by user "Alice" + And the administrator has enabled the file version storage feature + And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt" + When user "Brian" restores version index "1" of file "/Shares/test/textfile0.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as user "Alice" the authors of the versions of file "/test/textfile0.txt" should be: + | index | author | + | 1 | Brian | + And as user "Brian" the authors of the versions of file "/Shares/test/textfile0.txt" should be: + | index | author | + | 1 | Brian | + When user "Brian" restores version index "1" of file "/Shares/test/textfile0.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as user "Alice" the authors of the versions of file "/test/textfile0.txt" should be: + | index | author | + | 1 | | + And as user "Brian" the authors of the versions of file "/Shares/test/textfile0.txt" should be: + | index | author | + | 1 | | \ No newline at end of file diff --git a/tests/acceptance/features/coreApiVersions/fileVersions.feature b/tests/acceptance/features/coreApiVersions/fileVersions.feature index 38a5ef2a7aa..4d4f84ea667 100644 --- a/tests/acceptance/features/coreApiVersions/fileVersions.feature +++ b/tests/acceptance/features/coreApiVersions/fileVersions.feature @@ -21,19 +21,6 @@ Feature: dav-versions And the version folder of file "/davtest.txt-newdav-regular" for user "Alice" should contain "0" elements And the version folder of file "/davtest.txt-olddav-oldchunking" for user "Alice" should contain "0" elements - @issue-ocis-reva-17 @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321 - Scenario: Upload file and no version is available using new chunking - When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API - Then the HTTP status code should be "201" - And the version folder of file "/davtest.txt" for user "Alice" should contain "0" elements - - @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321 - Scenario: Upload file and no version is available using async upload - Given the administrator has enabled async operations - When user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 3 chunks with new chunking and using the WebDAV API - Then the HTTP status code should be "202" - And the version folder of file "/davtest.txt" for user "Alice" should contain "0" elements - @smokeTest Scenario: Upload a file twice and versions are available When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" using the WebDAV API @@ -51,21 +38,6 @@ Feature: dav-versions And the version folder of file "/davtest.txt-newdav-regular" for user "Alice" should contain "1" element And the version folder of file "/davtest.txt-olddav-oldchunking" for user "Alice" should contain "1" element - @issue-ocis-reva-17 @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321 - Scenario: Upload a file twice and versions are available using new chunking - When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API - And user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API - Then the HTTP status code of responses on each endpoint should be "201, 204" respectively - And the version folder of file "/davtest.txt" for user "Alice" should contain "1" element - - @issue-ocis-reva-17 @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321 - Scenario: Upload a file twice and versions are available using async upload - Given the administrator has enabled async operations - When user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API - And user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 3 chunks with new chunking and using the WebDAV API - Then the HTTP status code of responses on all endpoints should be "202" - And the version folder of file "/davtest.txt" for user "Alice" should contain "1" element - @smokeTest Scenario: Remove a file Given user "Alice" has uploaded file "filesForUpload/davtest.txt" to "/davtest.txt" @@ -109,21 +81,6 @@ Feature: dav-versions Examples: | dav-path | status-code | | old | 201 | - @notToImplementOnOCIS @newChunking @issue-ocis-1321 - Examples: - | dav-path | status-code | - | new | 204 | - - @skipOnStorage:ceph @files_primary_s3-issue-161 @notToImplementOnOCIS @newChunking @issue-ocis-1321 @issue-ocis-reva-17 @issue-ocis-reva-56 @skipOnStorage:scality - Scenario: Uploading a file asynchronously does create the correct version that can be restored - Given the administrator has enabled async operations - And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" - When user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "textfile0.txt" in 2 chunks using the WebDAV API - And user "Alice" uploads file "filesForUpload/lorem.txt" asynchronously to "textfile0.txt" in 2 chunks using the WebDAV API - And user "Alice" restores version index "1" of file "/textfile0.txt" using the WebDAV API - Then the HTTP status code of responses on all endpoints should be "202" - And the version folder of file "/textfile0.txt" for user "Alice" should contain "2" elements - And the content of file "/textfile0.txt" for user "Alice" should be "Dav-Test" @skipOnStorage:ceph @skipOnStorage:scality @files_primary_s3-issue-156 Scenario: Restore a file and check, if the content and correct checksum is now in the current file @@ -143,246 +100,6 @@ Feature: dav-versions When user "Brian" sends HTTP method "PROPFIND" to URL "/remote.php/dav/meta/<>" Then the HTTP status code should be "400" or "404" - @files_sharing-app-required @notToImplementOnOCIS - Scenario: User can access meta folder of a file which is owned by somebody else but shared with that user - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "123" to "/davtest.txt" - And user "Alice" has uploaded file with content "456789" to "/davtest.txt" - And we save it into "FILEID" - When user "Alice" creates a share using the sharing API with settings - | path | /davtest.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read | - Then the HTTP status code should be "200" - And the version folder of fileId "<>" for user "Brian" should contain "1" element - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharer of a file can see the old version information when the sharee changes the content of the file - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "First content" to "sharefile.txt" - And user "Alice" has shared file "sharefile.txt" with user "Brian" - When user "Brian" has uploaded file with content "Second content" to "/sharefile.txt" - Then the HTTP status code should be "204" - And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharer of a file can restore the original content of a shared file after the file has been modified by the sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "First content" to "sharefile.txt" - And user "Alice" has shared file "sharefile.txt" with user "Brian" - And user "Brian" has uploaded file with content "Second content" to "/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharer can restore a file inside a shared folder modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a file inside a shared folder modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - When user "Brian" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a file inside a shared folder created by sharee and modified by sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - When user "Brian" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - When user "Brian" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer, when the folder has been moved by the sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - And user "Brian" has created folder "/received" - And user "Brian" has moved folder "/sharingfolder" to "/received/sharingfolder" - When user "Brian" restores version index "1" of file "/received/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/received/sharingfolder/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is at the top level of the sharer) - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "old content" to "/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharefile.txt" - And user "Alice" has shared file "/sharefile.txt" with user "Brian" - And user "Brian" has created folder "/received" - And user "Brian" has moved file "/sharefile.txt" to "/received/sharefile.txt" - When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/received/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is inside a folder of the sharer) - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - And user "Alice" has shared file "/sharingfolder/sharefile.txt" with user "Brian" - And user "Brian" has created folder "/received" - And user "Brian" has moved file "/sharefile.txt" to "/received/sharefile.txt" - When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/received/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @issue-ocis-1289 @issue-ocis-1321 @notToImplementOnOCIS - Scenario: sharer can restore a file inside a group shared folder modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Carol" has been created with default attributes and without skeleton files - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Carol" has been added to group "grp1" - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with group "grp1" - And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - And user "Carol" has uploaded file with content "Third content" to "/sharingfolder/sharefile.txt" - When user "Alice" restores version index "2" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - And the content of file "/sharingfolder/sharefile.txt" for user "Carol" should be "First content" - - @files_sharing-app-required @notToImplementOnOCIS @issue-ocis-1238 - Scenario Outline: Moving a file (with versions) into a shared folder as the sharee and as the sharer - Given using DAV path - And user "Brian" has been created with default attributes and without skeleton files - And user "Brian" has created folder "/testshare" - And user "Brian" has created a share with settings - | path | testshare | - | shareType | user | - | permissions | change | - | shareWith | Alice | - And user "" has uploaded file with content "test data 1" to "/testfile.txt" - And user "" has uploaded file with content "test data 2" to "/testfile.txt" - And user "" has uploaded file with content "test data 3" to "/testfile.txt" - When user "" moves file "/testfile.txt" to "/testshare/testfile.txt" using the WebDAV API - Then the HTTP status code should be "201" - And the content of file "/testshare/testfile.txt" for user "Alice" should be "test data 3" - And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data 3" - And as "" file "/testfile.txt" should not exist - And the version folder of file "/testshare/testfile.txt" for user "Alice" should contain "2" elements - And the version folder of file "/testshare/testfile.txt" for user "Brian" should contain "2" elements - Examples: - | dav_version | mover | - | old | Alice | - | new | Alice | - | old | Brian | - | new | Brian | - - @files_sharing-app-required @notToImplementOnOCIS @issue-ocis-1238 - Scenario Outline: Moving a file (with versions) out of a shared folder as the sharee and as the sharer - Given using DAV path - And user "Brian" has been created with default attributes and without skeleton files - And user "Brian" has created folder "/testshare" - And user "Brian" has uploaded file with content "test data 1" to "/testshare/testfile.txt" - And user "Brian" has uploaded file with content "test data 2" to "/testshare/testfile.txt" - And user "Brian" has uploaded file with content "test data 3" to "/testshare/testfile.txt" - And user "Brian" has created a share with settings - | path | testshare | - | shareType | user | - | permissions | change | - | shareWith | Alice | - When user "" moves file "/testshare/testfile.txt" to "/testfile.txt" using the WebDAV API - Then the HTTP status code should be "201" - And the content of file "/testfile.txt" for user "" should be "test data 3" - And as "Alice" file "/testshare/testfile.txt" should not exist - And as "Brian" file "/testshare/testfile.txt" should not exist - And the version folder of file "/testfile.txt" for user "" should contain "2" elements - Examples: - | dav_version | mover | - | old | Alice | - | new | Alice | - | old | Brian | - | new | Brian | - - @files_sharing-app-required @issue-ocis-1238 @notToImplementOnOCIS - Scenario: Receiver tries to get file versions of unshared file from the sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" - And user "Alice" has uploaded file with content "textfile1" to "textfile1.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" - When user "Brian" tries to get versions of file "textfile1.txt" from "Alice" - Then the HTTP status code should be "404" - And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound" - - @skipOnStorage:ceph @files_primary_s3-issue-161 @files_sharing-app-required @notToImplementOnOCIS - Scenario: Receiver tries get file versions of shared file from the sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 3" to "textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" - When user "Brian" tries to get versions of file "textfile0.txt" from "Alice" - Then the HTTP status code should be "207" - And the number of versions should be "3" - Scenario: User cannot access meta folder of a file which does not exist Given user "Brian" has been created with default attributes and without skeleton files @@ -553,4 +270,259 @@ Feature: dav-versions And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API When user "Alice" restores version index "1" of file "/file.txt" using the WebDAV API Then the HTTP status code should be "204" - And the version folder of file "/file.txt" for user "Alice" should contain "0" element \ No newline at end of file + And the version folder of file "/file.txt" for user "Alice" should contain "0" element + + @files_sharing-app-required + Scenario: User can access meta folder of a file which is owned by somebody else but shared with that user + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "123" to "/davtest.txt" + And user "Alice" has uploaded file with content "456789" to "/davtest.txt" + And we save it into "FILEID" + And user "Alice" has created a share with settings + | path | /davtest.txt | + | shareType | user | + | shareWith | Brian | + | permissions | read | + When user "Brian" accepts share "/davtest.txt" offered by user "Alice" using the sharing API + Then the HTTP status code should be "200" + And the version folder of fileId "<>" for user "Brian" should contain "1" element + + @files_sharing-app-required + Scenario: sharer of a file can see the old version information when the sharee changes the content of the file + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "First content" to "sharefile.txt" + And user "Alice" has shared file "sharefile.txt" with user "Brian" + And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" + When user "Brian" uploads file with content "Second content" to "/Shares/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element + And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element + + @files_sharing-app-required + Scenario: sharer of a file can restore the original content of a shared file after the file has been modified by the sharee + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "First content" to "sharefile.txt" + And user "Alice" has shared file "sharefile.txt" with user "Brian" + And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" + And user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt" + When user "Alice" restores version index "1" of file "/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharefile.txt" for user "Alice" should be "First content" + And the content of file "/Shares/sharefile.txt" for user "Brian" should be "First content" + + @files_sharing-app-required + Scenario: sharer can restore a file inside a shared folder modified by sharee + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with user "Brian" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" + And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt" + When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" + + @files_sharing-app-required + Scenario: sharee can restore a file inside a shared folder modified by sharee + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with user "Brian" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" + And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt" + When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" + + @files_sharing-app-required + Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharer + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with user "Brian" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt" + And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" + When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" + + @files_sharing-app-required + Scenario: sharee can restore a file inside a shared folder created by sharee and modified by sharer + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with user "Brian" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt" + And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" + When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" + + @files_sharing-app-required + Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharee + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with user "Brian" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Brian" has uploaded file with content "old content" to "/Shares/sharingfolder/sharefile.txt" + And user "Brian" has uploaded file with content "new content" to "/Shares/sharingfolder/sharefile.txt" + When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content" + + @files_sharing-app-required + Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with user "Brian" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" + And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" + When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content" + + @files_sharing-app-required @issue-ocis-reva-34 + Scenario: sharer can restore a file inside a group shared folder modified by sharee + Given user "Brian" has been created with default attributes and without skeleton files + And user "Carol" has been created with default attributes and without skeleton files + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Carol" has been added to group "grp1" + And user "Alice" has created folder "/sharingfolder" + And user "Alice" has shared folder "/sharingfolder" with group "grp1" + And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" + And user "Carol" has accepted share "/sharingfolder" offered by user "Alice" + And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" + And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt" + And user "Carol" has uploaded file with content "Third content" to "/Shares/sharingfolder/sharefile.txt" + When user "Alice" restores version index "2" of file "/sharingfolder/sharefile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" + And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Carol" should be "First content" + + @files_sharing-app-required @issue-ocis-reva-386 + Scenario Outline: Moving a file (with versions) into a shared folder as the sharee and as the sharer + Given using DAV path + And user "Brian" has been created with default attributes and without skeleton files + And user "Brian" has created folder "/testshare" + And user "Brian" has created a share with settings + | path | testshare | + | shareType | user | + | permissions | change | + | shareWith | Alice | + And user "Alice" has accepted share "/testshare" offered by user "Brian" + And user "" has uploaded file with content "test data 1" to "/testfile.txt" + And user "" has uploaded file with content "test data 2" to "/testfile.txt" + And user "" has uploaded file with content "test data 3" to "/testfile.txt" + When user "" moves file "/testfile.txt" to "/testfile.txt" using the WebDAV API + Then the HTTP status code should be "201" + And the content of file "/Shares/testshare/testfile.txt" for user "Alice" should be "test data 3" + And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data 3" + And as "" file "/testfile.txt" should not exist + And the version folder of file "/Shares/testshare/testfile.txt" for user "Alice" should contain "2" elements + And the version folder of file "/testshare/testfile.txt" for user "Brian" should contain "2" elements + Examples: + | dav_version | mover | dst-folder | + | old | Brian | /testshare | + | new | Brian | /testshare | + + @files_sharing-app-required @issue-ocis-reva-386 + Scenario Outline: Moving a file (with versions) out of a shared folder as the sharee and as the sharer + Given using DAV path + And user "Brian" has been created with default attributes and without skeleton files + And user "Brian" has created folder "/testshare" + And user "Brian" has uploaded file with content "test data 1" to "/testshare/testfile.txt" + And user "Brian" has uploaded file with content "test data 2" to "/testshare/testfile.txt" + And user "Brian" has uploaded file with content "test data 3" to "/testshare/testfile.txt" + And user "Brian" has created a share with settings + | path | testshare | + | shareType | user | + | permissions | change | + | shareWith | Alice | + And user "Alice" has accepted share "/testshare" offered by user "Brian" + When user "" moves file "/testfile.txt" to "/testfile.txt" using the WebDAV API + Then the HTTP status code should be "201" + And the content of file "/testfile.txt" for user "" should be "test data 3" + And as "Alice" file "/Shares/testshare/testfile.txt" should not exist + And as "Brian" file "/testshare/testfile.txt" should not exist + And the version folder of file "/testfile.txt" for user "" should contain "2" elements + Examples: + | dav_version | mover | src-folder | + | old | Brian | /testshare | + | new | Brian | /testshare | + + @files_sharing-app-required + Scenario: Receiver tries to get file versions of unshared file from the sharer + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" + And user "Alice" has uploaded file with content "textfile1" to "textfile1.txt" + And user "Alice" has shared file "textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" tries to get versions of file "textfile1.txt" from "Alice" + Then the HTTP status code should be "404" + And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound" + + @skipOnStorage:ceph @files_primary_s3-issue-161 @files_sharing-app-required + Scenario: Receiver tries get file versions of shared file from the sharer + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 3" to "textfile0.txt" + And user "Alice" has shared file "textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" tries to get versions of file "textfile0.txt" from "Alice" + Then the HTTP status code should be "207" + And the number of versions should be "3" + + @issue-760 + Scenario: Receiver tries get file versions of shared file before receiving it + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" + And we save it into "FILEID" + And user "Alice" has shared file "textfile0.txt" with user "Brian" + When user "Brian" tries to get versions of file "textfile0.txt" from "Alice" + Then the HTTP status code should be "404" + And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound" + + + Scenario: sharer tries get file versions of shared file when the sharee changes the content of the file + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "First content" to "sharefile.txt" + And user "Alice" has shared file "sharefile.txt" with user "Brian" + And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" + When user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt" + Then the HTTP status code should be "204" + And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element + And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element + + + Scenario: download old versions of a shared file as share receiver + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "uploaded content" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" + And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" + And user "Alice" has shared file "textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "1" + Then the HTTP status code should be "200" + And the following headers should be set + | header | value | + | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" | + And the downloaded content should be "version 1" + When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "2" + Then the HTTP status code should be "200" + And the following headers should be set + | header | value | + | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" | + And the downloaded content should be "uploaded content" \ No newline at end of file diff --git a/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature b/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature deleted file mode 100644 index c53de028988..00000000000 --- a/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature +++ /dev/null @@ -1,324 +0,0 @@ -@api @files_versions-app-required @issue-ocis-reva-275 - -Feature: dav-versions - - Background: - Given using OCS API version "2" - And using new DAV path - And the administrator has set the default folder for received shares to "Shares" - And auto-accept shares has been disabled - And user "Alice" has been created with default attributes and without skeleton files - - - Scenario: Upload file and no version is available - When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" using the WebDAV API - Then the version folder of file "/davtest.txt" for user "Alice" should contain "0" elements - - @files_sharing-app-required - Scenario: User can access meta folder of a file which is owned by somebody else but shared with that user - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "123" to "/davtest.txt" - And user "Alice" has uploaded file with content "456789" to "/davtest.txt" - And we save it into "FILEID" - And user "Alice" has created a share with settings - | path | /davtest.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read | - When user "Brian" accepts share "/davtest.txt" offered by user "Alice" using the sharing API - Then the HTTP status code should be "200" - And the version folder of fileId "<>" for user "Brian" should contain "1" element - - @files_sharing-app-required - Scenario: sharer of a file can see the old version information when the sharee changes the content of the file - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "First content" to "sharefile.txt" - And user "Alice" has shared file "sharefile.txt" with user "Brian" - And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" - When user "Brian" uploads file with content "Second content" to "/Shares/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element - And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element - - @files_sharing-app-required - Scenario: sharer of a file can restore the original content of a shared file after the file has been modified by the sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "First content" to "sharefile.txt" - And user "Alice" has shared file "sharefile.txt" with user "Brian" - And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" - And user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/Shares/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required - Scenario: sharer can restore a file inside a shared folder modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required - Scenario: sharee can restore a file inside a shared folder modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt" - When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required - Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required - Scenario: sharee can restore a file inside a shared folder created by sharee and modified by sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt" - When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - - @files_sharing-app-required - Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Brian" has uploaded file with content "old content" to "/Shares/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "new content" to "/Shares/sharingfolder/sharefile.txt" - When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required - Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer, when the folder has been moved by the sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with user "Brian" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - And user "Brian" has created folder "/received" - And user "Brian" has moved folder "/Shares/sharingfolder" to "/received/sharingfolder" - When user "Brian" restores version index "1" of file "/received/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/received/sharingfolder/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is at the top level of the sharer) - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "old content" to "/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharefile.txt" - And user "Alice" has shared file "/sharefile.txt" with user "Brian" - And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" - And user "Brian" has created folder "/received" - And user "Brian" has moved file "/Shares/sharefile.txt" to "/received/sharefile.txt" - When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/received/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @notToImplementOnOCIS - Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is inside a folder of the sharer) - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt" - And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt" - And user "Alice" has shared file "/sharingfolder/sharefile.txt" with user "Brian" - And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" - And user "Brian" has created folder "/received" - And user "Brian" has moved file "/Shares/sharefile.txt" to "/received/sharefile.txt" - When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content" - And the content of file "/received/sharefile.txt" for user "Brian" should be "old content" - - @files_sharing-app-required @issue-ocis-reva-34 - Scenario: sharer can restore a file inside a group shared folder modified by sharee - Given user "Brian" has been created with default attributes and without skeleton files - And user "Carol" has been created with default attributes and without skeleton files - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Carol" has been added to group "grp1" - And user "Alice" has created folder "/sharingfolder" - And user "Alice" has shared folder "/sharingfolder" with group "grp1" - And user "Brian" has accepted share "/sharingfolder" offered by user "Alice" - And user "Carol" has accepted share "/sharingfolder" offered by user "Alice" - And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt" - And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt" - And user "Carol" has uploaded file with content "Third content" to "/Shares/sharingfolder/sharefile.txt" - When user "Alice" restores version index "2" of file "/sharingfolder/sharefile.txt" using the WebDAV API - Then the HTTP status code should be "204" - And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content" - And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Carol" should be "First content" - - @files_sharing-app-required @issue-ocis-reva-386 - Scenario Outline: Moving a file (with versions) into a shared folder as the sharee and as the sharer - Given using DAV path - And user "Brian" has been created with default attributes and without skeleton files - And user "Brian" has created folder "/testshare" - And user "Brian" has created a share with settings - | path | testshare | - | shareType | user | - | permissions | change | - | shareWith | Alice | - And user "Alice" has accepted share "/testshare" offered by user "Brian" - And user "" has uploaded file with content "test data 1" to "/testfile.txt" - And user "" has uploaded file with content "test data 2" to "/testfile.txt" - And user "" has uploaded file with content "test data 3" to "/testfile.txt" - When user "" moves file "/testfile.txt" to "/testfile.txt" using the WebDAV API - Then the HTTP status code should be "201" - And the content of file "/Shares/testshare/testfile.txt" for user "Alice" should be "test data 3" - And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data 3" - And as "" file "/testfile.txt" should not exist - And the version folder of file "/Shares/testshare/testfile.txt" for user "Alice" should contain "2" elements - And the version folder of file "/testshare/testfile.txt" for user "Brian" should contain "2" elements - Examples: - | dav_version | mover | dst-folder | - | old | Alice | /Shares/testshare | - | new | Alice | /Shares/testshare | - | old | Brian | /testshare | - | new | Brian | /testshare | - - @files_sharing-app-required @issue-ocis-reva-386 - Scenario Outline: Moving a file (with versions) out of a shared folder as the sharee and as the sharer - Given using DAV path - And user "Brian" has been created with default attributes and without skeleton files - And user "Brian" has created folder "/testshare" - And user "Brian" has uploaded file with content "test data 1" to "/testshare/testfile.txt" - And user "Brian" has uploaded file with content "test data 2" to "/testshare/testfile.txt" - And user "Brian" has uploaded file with content "test data 3" to "/testshare/testfile.txt" - And user "Brian" has created a share with settings - | path | testshare | - | shareType | user | - | permissions | change | - | shareWith | Alice | - And user "Alice" has accepted share "/testshare" offered by user "Brian" - When user "" moves file "/testfile.txt" to "/testfile.txt" using the WebDAV API - Then the HTTP status code should be "201" - And the content of file "/testfile.txt" for user "" should be "test data 3" - And as "Alice" file "/Shares/testshare/testfile.txt" should not exist - And as "Brian" file "/testshare/testfile.txt" should not exist - And the version folder of file "/testfile.txt" for user "" should contain "2" elements - - @notToImplementOnOCIS - Examples: - | dav_version | mover | src-folder | - | old | Alice | /Shares/testshare | - | new | Alice | /Shares/testshare | - - - Examples: - | dav_version | mover | src-folder | - | old | Brian | /testshare | - | new | Brian | /testshare | - - @files_sharing-app-required - Scenario: Receiver tries to get file versions of unshared file from the sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" - And user "Alice" has uploaded file with content "textfile1" to "textfile1.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When user "Brian" tries to get versions of file "textfile1.txt" from "Alice" - Then the HTTP status code should be "404" - And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound" - - @skipOnStorage:ceph @files_primary_s3-issue-161 @files_sharing-app-required - Scenario: Receiver tries get file versions of shared file from the sharer - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 3" to "textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When user "Brian" tries to get versions of file "textfile0.txt" from "Alice" - Then the HTTP status code should be "207" - And the number of versions should be "3" - - - Scenario: Receiver tries get file versions of shared file before receiving it - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" - And we save it into "FILEID" - And user "Alice" has shared file "textfile0.txt" with user "Brian" - When user "Brian" tries to get versions of file "textfile0.txt" from "Alice" - Then the HTTP status code should be "404" - And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound" - - - Scenario: sharer tries get file versions of shared file when the sharee changes the content of the file - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "First content" to "sharefile.txt" - And user "Alice" has shared file "sharefile.txt" with user "Brian" - And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" - When user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt" - Then the HTTP status code should be "204" - And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element - And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element - - - Scenario: download old versions of a shared file as share receiver - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "uploaded content" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 1" to "textfile0.txt" - And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "1" - Then the HTTP status code should be "200" - And the following headers should be set - | header | value | - | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" | - And the downloaded content should be "version 1" - When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "2" - Then the HTTP status code should be "200" - And the following headers should be set - | header | value | - | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" | - And the downloaded content should be "uploaded content"