From 5b165e3209fb663c979c6019de4987fbd6d90085 Mon Sep 17 00:00:00 2001 From: nirajacharya2 <122071597+nirajacharya2@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:11:45 +0545 Subject: [PATCH] adding test for getting versions of a file after moving it (#8013) --- .../expected-failures-API-on-OCIS-storage.md | 5 --- .../fileVersionByFileID.feature | 32 +++++++++++++++++++ .../coreApiVersions/fileVersions.feature | 12 +++---- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 64a10814f7..ae683c30be 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -45,11 +45,6 @@ _ocdav: double-check the webdav property parsing when custom namespaces are used - [coreApiVersions/fileVersionAuthor.feature:297](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L297) - [coreApiVersions/fileVersionAuthor.feature:316](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L316) -#### [moving a file into a shared folder as the sharee and as the sharer](https://github.com/owncloud/ocis/issues/1287) - -- [coreApiVersions/fileVersions.feature:382](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L382) Scenario: moving a file (with versions) into a shared folder as the sharee and as the sharer -- [coreApiVersions/fileVersions.feature:383](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L383) Scenario: moving a file (with versions) into a shared folder as the sharee and as the sharer - ### Sync Synchronization features like etag propagation, setting mtime and locking files diff --git a/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature b/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature index a75c105ac7..3484b83d78 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature @@ -58,3 +58,35 @@ Feature: checking file versions using file id And using new DAV path When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<>/v" Then the HTTP status code should be "403" + + + Scenario Outline: check the versions of a file after moving to a shared folder inside a project space as editor/viewer + Given user "Alice" has created a folder "testFolder" in space "Project1" + And user "Alice" has created a share inside of space "Project1" with settings: + | path | testFolder | + | shareWith | Brian | + | role | | + And user "Alice" has moved file "text.txt" to "/testFolder/movedText.txt" in space "Project1" + And using new DAV path + When user "Alice" gets the number of versions of file "/testFolder/movedText.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "207" + And the number of versions should be "1" + When user "Brian" tries to get the number of versions of file "/Shares/testFolder/movedText.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "403" + Examples: + | role | + | editor | + | viewer | + + + Scenario: check the versions of a file after moving it to a shared folder of a project space shared with all permissions + Given user "Alice" has created a folder "testFolder" in space "Project1" + And user "Alice" has created a share inside of space "Project1" with settings: + | path | testFolder | + | shareWith | Brian | + | role | all | + And user "Alice" has moved file "text.txt" to "/testFolder/movedText.txt" in space "Project1" + And using new DAV path + When user "Brian" gets the number of versions of file "/text.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "207" + And the number of versions should be "1" diff --git a/tests/acceptance/features/coreApiVersions/fileVersions.feature b/tests/acceptance/features/coreApiVersions/fileVersions.feature index 745a3ae5fb..5c4bdd6bec 100644 --- a/tests/acceptance/features/coreApiVersions/fileVersions.feature +++ b/tests/acceptance/features/coreApiVersions/fileVersions.feature @@ -359,8 +359,8 @@ Feature: dav-versions And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Carol" should be "First content" @skipOnReva - Scenario Outline: moving a file (with versions) into a shared folder as the sharee and as the sharer - Given using DAV path + Scenario: moving a file (with versions) into a shared folder as the sharee and as the sharer + Given using new 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 @@ -369,6 +369,7 @@ Feature: dav-versions | permissions | change | | shareWith | Alice | And user "Brian" has uploaded file with content "test data 1" to "/testfile.txt" + And we save it into "FILEID" And user "Brian" has uploaded file with content "test data 2" to "/testfile.txt" And user "Brian" has uploaded file with content "test data 3" to "/testfile.txt" When user "Brian" moves file "/testfile.txt" to "/testshare/testfile.txt" using the WebDAV API @@ -376,11 +377,8 @@ Feature: dav-versions 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 "Brian" file "/testfile.txt" should not exist - And the version folder of file "/Shares/testshare/testfile.txt" for user "Alice" should contain "2" elements - Examples: - | dav-path-version | - | old | - | new | + When user "Alice" tries to get the number of versions of file "/Shares/testshare/testfile.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "403" Scenario Outline: moving a file (with versions) out of a shared folder as the sharee and as the sharer