Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] Extend API test coverage for MOVE between spaces #8113

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/acceptance/config/behat-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ default:
contexts:
- FeatureContext: *common_feature_context_params
- WebDavPropertiesContext:
- FilesVersionsContext:

coreApiWebdavOperations:
paths:
Expand Down
22 changes: 4 additions & 18 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,6 @@ cannot share a folder with create permission
- [coreApiShareOperationsToShares2/uploadToShare.feature:202](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature#L202)
- [coreApiShareOperationsToShares2/uploadToShare.feature:203](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature#L203)

#### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764)

- [coreApiShareOperationsToShares1/changingFilesShare.feature:25](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L25)
- [coreApiShareOperationsToShares1/changingFilesShare.feature:26](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L26)
- [coreApiShareOperationsToShares1/changingFilesShare.feature:65](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L65)
- [coreApiShareOperationsToShares1/changingFilesShare.feature:66](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L66)
- [coreApiShareOperationsToShares1/changingFilesShare.feature:85](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L85)
- [coreApiShareOperationsToShares1/changingFilesShare.feature:86](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L86)
- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:474](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L474)
- [coreApiWebdavMove2/moveShareOnOcis.feature:28](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L28)
- [coreApiWebdavMove2/moveShareOnOcis.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L30)
- [coreApiWebdavMove2/moveShareOnOcis.feature:93](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L93)
- [coreApiWebdavMove2/moveShareOnOcis.feature:95](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L95)

#### [Expiration date for shares is not implemented](https://github.com/owncloud/ocis/issues/1250)

#### Expiration date of user shares
Expand Down Expand Up @@ -440,9 +426,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers
- [coreApiWebdavUpload1/uploadFile.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload1/uploadFile.feature#L181)
- [coreApiWebdavUpload1/uploadFile.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload1/uploadFile.feature#L180)
- [coreApiWebdavUpload1/uploadFile.feature:186](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload1/uploadFile.feature#L186)
- [coreApiWebdavMove2/moveFile.feature:175](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L175)
- [coreApiWebdavMove2/moveFile.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L176)
- [coreApiWebdavMove2/moveFile.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L181)
- [coreApiWebdavMove2/moveFile.feature:178](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L178)
- [coreApiWebdavMove2/moveFile.feature:179](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L179)
- [coreApiWebdavMove2/moveFile.feature:184](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L184)

#### [cannot set blacklisted file names](https://github.com/owncloud/product/issues/260)

Expand Down Expand Up @@ -483,7 +469,7 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers
- [coreApiWebdavMove1/moveFolder.feature:26](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L26)
- [coreApiWebdavMove1/moveFolder.feature:44](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L44)
- [coreApiWebdavMove1/moveFolder.feature:62](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L62)
- [coreApiWebdavMove2/moveFile.feature:137](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L137)
- [coreApiWebdavMove2/moveFile.feature:140](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L140)
- [coreApiWebdavMove2/moveFileToBlacklistedName.feature:24](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature#L24)

#### [REPORT method on spaces returns an incorrect d:href response](https://github.com/owncloud/ocis/issues/3111)
Expand Down
136 changes: 80 additions & 56 deletions tests/acceptance/features/apiSpacesShares/moveSpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,13 @@ Feature: move (rename) file
| role | permissions |
| manager | 31 |
| editor | 31 |
| viewer | 31 |
| manager | 17 |
| editor | 17 |
| viewer | 31 |
| viewer | 17 |
| manager | 1 |
| editor | 1 |
| viewer | 1 |


Scenario Outline: user moves a file from space personal to space project with different role
Expand Down Expand Up @@ -199,98 +202,119 @@ Feature: move (rename) file
| manager | 17 |
| editor | 17 |
| viewer | 17 |
| manager | 1 |
| editor | 1 |
| viewer | 1 |


Scenario: user moves a file from space Shares with role editor to space Shares with role editor
Given user "Brian" has created folder "/testshare1"
And user "Brian" has created folder "/testshare2"
And user "Brian" has uploaded file with content "testshare1 content" to "/testshare1/testshare1.txt"
And user "Brian" has shared folder "/testshare1" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "31"
When user "Alice" moves file "/testshare1/testshare1.txt" from space "Shares" to "/testshare2/testshare1.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare1" of the space "Shares" should contain these entries:
| testshare1.txt |
But for user "Alice" folder "testshare2" of the space "Shares" should not contain these entries:
| testshare1.txt |


Scenario: user moves a file from space Shares with role editor to space Shares with role viewer
Given user "Brian" has created folder "/testshare1"
And user "Brian" has created folder "/testshare2"
And user "Brian" has uploaded file with content "testshare1 content" to "/testshare1/testshare1.txt"
And user "Brian" has shared folder "/testshare1" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "17"
When user "Alice" moves file "/testshare1/testshare1.txt" from space "Shares" to "/testshare2/testshare1.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare1" of the space "Shares" should contain these entries:
| testshare1.txt |
But for user "Alice" folder "testshare2" of the space "Shares" should not contain these entries:
| testshare1.txt |


Scenario: user moves a file from space Shares with role viewer to space Shares with role editor
Scenario Outline: user moves a file from space Shares to another space Shares with different role (permissions)
Given user "Brian" has created folder "/testshare1"
And user "Brian" has created folder "/testshare2"
And user "Brian" has uploaded file with content "testshare1 content" to "/testshare1/testshare1.txt"
And user "Brian" has shared folder "/testshare1" with user "Alice" with permissions "17"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare1" with user "Alice" with permissions "<from_permissions>"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "<to_permissions>"
When user "Alice" moves file "/testshare1/testshare1.txt" from space "Shares" to "/testshare2/testshare1.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare1" of the space "Shares" should contain these entries:
| testshare1.txt |
But for user "Alice" folder "testshare2" of the space "Shares" should not contain these entries:
| testshare1.txt |
Examples:
| from_permissions | to_permissions |
| 31 | 31 |
| 31 | 17 |
| 31 | 1 |
| 17 | 31 |
| 17 | 17 |
| 17 | 1 |
| 1 | 31 |
| 1 | 17 |
| 1 | 1 |


Scenario: moving a file out of a shared folder as a sharer
Scenario Outline: moving a file out of a shared folder as a sharer
Given user "Brian" has created folder "/testshare"
And user "Brian" has uploaded file with content "test data" to "/testshare/testfile.txt"
And user "Brian" has created a share with settings
| path | testshare |
| shareType | user |
| permissions | change |
| shareWith | Alice |
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "<permissions>"
When user "Brian" moves file "/testshare/testfile.txt" from space "Personal" to "/testfile.txt" inside space "Personal" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/testfile.txt" for user "Brian" should be "test data"
And for user "Alice" folder "testshare" of the space "Shares" should not contain these entries:
| testfile.txt |
And for user "Brian" folder "testshare" of the space "Personal" should not contain these entries:
| testfile.txt |
Examples:
| permissions |
| 31 |
| 17 |
| 1 |


Scenario: moving a folder out of a shared folder as a sharer
Scenario Outline: moving a folder out of a shared folder as a sharer
Given user "Brian" has created the following folders
| path |
| /testshare |
| /testshare/testsubfolder |
And user "Brian" has uploaded file with content "test data" to "/testshare/testsubfolder/testfile.txt"
And user "Brian" has created a share with settings
| path | testshare |
| shareType | user |
| permissions | change |
| shareWith | Alice |
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "<permissions>"
When user "Brian" moves folder "/testshare/testsubfolder" from space "Personal" to "/testsubfolder" inside space "Personal" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/testsubfolder/testfile.txt" for user "Brian" should be "test data"
And for user "Alice" folder "testshare" of the space "Shares" should not contain these entries:
| testsubfolder |
And for user "Brian" folder "testshare" of the space "Personal" should not contain these entries:
| testsubfolder |
Examples:
| permissions |
| 31 |
| 17 |
| 1 |


Scenario: overwriting a file while moving
Given user "Brian" has created folder "/folder"
And user "Brian" has uploaded file with content "some content" to "/folder/testfile.txt"
And user "Brian" has uploaded file with content "old data version 1" to "/testfile.txt"
And user "Brian" has uploaded file with content "new data version 2" to "/testfile.txt"
When user "Brian" overwrites file "/testfile.txt" from space "Personal" to "folder/testfile.txt" inside space "Personal" while moving using the WebDAV API
Scenario Outline: sharee moves a file within a Shares space (all/change permissions)
Given user "Brian" has created folder "testshare"
Given user "Brian" has created folder "testshare/child"
And user "Brian" has uploaded file with content "test file content" to "/testshare/testfile.txt"
And user "Brian" has shared folder "testshare" with user "Alice" with permissions "<permissions>"
When user "Alice" moves file "testshare/testfile.txt" from space "Shares" to "testshare/child/testfile.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" the content of the file "testshare/child/testfile.txt" of the space "Shares" should be "test file content"
And for user "Alice" folder "testshare" of the space "Shares" should not contain these entries:
| testfile.txt |
Examples:
| permissions |
| all |
| change |


Scenario: sharee moves a file within a Shares space (read permissions)
Given user "Brian" has created folder "testshare"
Given user "Brian" has created folder "testshare/child"
And user "Brian" has uploaded file with content "test file content" to "/testshare/testfile.txt"
And user "Brian" has shared folder "testshare" with user "Alice" with permissions "read"
When user "Alice" moves file "testshare/testfile.txt" from space "Shares" to "testshare/child/testfile.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare/child" of the space "Shares" should not contain these entries:
| testfile.txt |
But for user "Alice" folder "testshare" of the space "Shares" should contain these entries:
| testfile.txt |


Scenario: overwrite a file while moving in project space
Given the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API
And user "Brian" has created a space "Project" with the default quota using the Graph API
And user "Brian" has created a folder "folder" in space "Project"
And user "Brian" has uploaded a file inside space "Project" with content "root file v1" to "testfile.txt"
And user "Brian" has uploaded a file inside space "Project" with content "root file v2" to "testfile.txt"
And user "Brian" has uploaded a file inside space "Project" with content "same name file" to "folder/testfile.txt"
And user "Brian" has shared a space "Project" with settings:
| shareWith | Alice |
| role | editor |
When user "Alice" overwrites file "testfile.txt" from space "Project" to "folder/testfile.txt" inside space "Project" while moving using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/folder/testfile.txt" for user "Brian" should be "new data version 2"
And for user "Brian" the space "Personal" should not contain these entries:
| /testfile.txt |
When user "Brian" downloads version of the file "/folder/testfile.txt" with the index "1" of the space "Personal" using the WebDAV API
And for user "Alice" the content of the file "folder/testfile.txt" of the space "Project" should be "root file v2"
And for user "Alice" the space "Project" should not contain these entries:
| testfile.txt |
When user "Brian" downloads version of the file "folder/testfile.txt" with the index "1" of the space "Project" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "old data version 1"
And as "Brian" file "testfile.txt" should exist in the trashbin of the space "Personal"
And the downloaded content should be "root file v1"
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Feature: share resources where the sharee receives the share in multiple ways
And as "Brian" file "Shares/sharedParent/child/lorem.txt" should exist

@issue-7555
Scenario Outline: share receiver renames a group share and receives same resource through user share with additional permissions
Scenario Outline: share receiver renames a group share and receives same resource through user share with additional permissions
Given using OCS API version "<ocs_api_version>"
And group "grp" has been created
And user "Brian" has been added to group "grp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ Feature: sharing
| 1 | 100 |
| 2 | 200 |

@issue-2146 @issue-764 @issue-7555
@issue-764 @issue-7555
Scenario: share a file by multiple channels and download from sub-folder and direct file share
Given these users have been created with default attributes and without skeleton files:
| username |
Expand All @@ -481,11 +481,11 @@ Feature: sharing
And user "Carol" has been added to group "grp1"
And user "Alice" has created folder "/common"
And user "Alice" has created folder "/common/sub"
And user "Alice" has uploaded file with content "ownCloud" to "/textfile0.txt"
And user "Alice" has shared folder "common" with group "grp1"
And user "Brian" has uploaded file with content "ownCloud" to "/textfile0.txt"
And user "Brian" has shared file "textfile0.txt" with user "Carol"
And user "Brian" has moved file "/textfile0.txt" to "/Shares/common/textfile0.txt"
And user "Brian" has moved file "/Shares/common/textfile0.txt" to "/Shares/common/sub/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Carol"
And user "Alice" has moved file "/textfile0.txt" to "/common/textfile0.txt"
And user "Alice" has moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
When user "Carol" uploads file "filesForUpload/file_to_overwrite.txt" to "/Shares/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/Shares/common/sub/textfile0.txt" for user "Carol" should be "BLABLABLA" plus end-of-line
Expand Down
Loading