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] [full-ci] Enhance share copy-overwrite test scenarios #6323

Closed
wants to merge 3 commits into from
Closed
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
18 changes: 8 additions & 10 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ Basic file management like up and download, move, copy, properties, trash, versi

#### [Getting information about a folder overwritten by a file gives 500 error instead of 404](https://github.com/owncloud/ocis/issues/1239)

- [coreApiWebdavProperties1/copyFile.feature:272](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L272)
- [coreApiWebdavProperties1/copyFile.feature:273](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L273)
- [coreApiWebdavProperties1/copyFile.feature:290](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L290)
- [coreApiWebdavProperties1/copyFile.feature:291](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L291)
- [coreApiWebdavProperties1/copyFile.feature:314](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L314)
- [coreApiWebdavProperties1/copyFile.feature:315](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L315)

#### [Custom dav properties with namespaces are rendered incorrectly](https://github.com/owncloud/ocis/issues/2140)

Expand Down Expand Up @@ -530,12 +528,12 @@ And other missing implementation of favorites

#### [copying the file inside Shares folder returns 404](https://github.com/owncloud/ocis/issues/3874)

- [coreApiWebdavProperties1/copyFile.feature:408](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L408)
- [coreApiWebdavProperties1/copyFile.feature:409](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L409)
- [coreApiWebdavProperties1/copyFile.feature:414](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L414)
- [coreApiWebdavProperties1/copyFile.feature:434](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L434)
- [coreApiWebdavProperties1/copyFile.feature:435](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L435)
- [coreApiWebdavProperties1/copyFile.feature:440](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L440)
- [coreApiWebdavProperties1/copyFile.feature:474](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L474)
- [coreApiWebdavProperties1/copyFile.feature:475](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L475)
- [coreApiWebdavProperties1/copyFile.feature:480](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L480)
- [coreApiWebdavProperties1/copyFile.feature:500](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L500)
- [coreApiWebdavProperties1/copyFile.feature:501](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L501)
- [coreApiWebdavProperties1/copyFile.feature:506](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties1/copyFile.feature#L506)

### Won't fix

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,14 @@ Feature: copy file
And user "Brian" has shared folder "BRIAN-Folder" with user "Alice"
And user "Alice" has accepted share "/BRIAN-Folder" offered by user "Brian"
When user "Alice" copies file "/textfile1.txt" to "/Shares/BRIAN-Folder" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/Shares/BRIAN-Folder" for user "Alice" should be "ownCloud test text file 1"
And as "Alice" folder "/Shares/BRIAN-Folder/sample-folder" should not exist
Then the HTTP status code should be "412"
# the copy request is rejected with 412 "precondition failed"
# Brian's original folder should still exist and be shared with Alice
And as "Brian" folder "BRIAN-Folder" should exist
And as "Brian" folder "BRIAN-Folder/sample-folder" should exist
And as "Alice" folder "BRIAN-Folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder/sample-folder" should exist
And as "Alice" file "/textfile1.txt" should exist
And user "Alice" should not have any received shares
Examples:
| dav_version |
| old |
Expand All @@ -282,9 +285,72 @@ Feature: copy file
And user "Alice" has created folder "FOLDER/sample-folder"
When user "Alice" copies folder "/FOLDER" to "/Shares/sharedfile1.txt" using the WebDAV API
Then the HTTP status code should be "204"
# Alice now sees the content of "her" folder as folder "/Shares/sharedfile1.txt"
# The share that she received from Brian has "automatically" gone into the "declined" state
And as "Alice" folder "/FOLDER/sample-folder" should exist
And as "Alice" folder "/Shares/sharedfile1.txt/sample-folder" should exist
And user "Alice" should not have any received shares
And the sharing API should report to user "Alice" that these shares are in the declined state
| path |
| /Shares/sharedfile1.txt |
# Brian still has his original sharedfile1.txt and can see that it is shared with Alice
And as "Brian" file "sharedfile1.txt" should exist
And the content of file "sharedfile1.txt" for user "Brian" should be "file to share"
When user "Brian" gets all shares shared by him using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And file "/Shares/sharedfile1.txt" should be included in the response
When user "Alice" accepts share "/sharedfile1.txt" offered by user "Brian" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
# now Alice has "her" folder as "/Shares/sharedfile1.txt"
# and has the shared file from Brian as "/Shares/sharedfile1 (2).txt"
And as "Alice" folder "/Shares/sharedfile1.txt" should exist
And as "Alice" folder "/Shares/sharedfile1.txt/sample-folder" should exist
And as "Alice" file "/Shares/sharedfile1 (2).txt" should exist
And the content of file "/Shares/sharedfile1 (2).txt" for user "Alice" should be "file to share"
Examples:
| dav_version |
| old |
| new |


Scenario Outline: copy a file over the top of an existing file received as a user share
Given using <dav_version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
Comment on lines +318 to +320
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have this test:

Scenario Outline: copy a file over the top of an existing folder received as a user share

And user "Brian" has uploaded file with content "file to share" to "/sharedfile1.txt"
And user "Brian" has shared file "/sharedfile1.txt" with user "Alice"
And user "Alice" has accepted share "/sharedfile1.txt" offered by user "Brian"
When user "Alice" copies file "/textfile1.txt" to "/Shares/sharedfile1.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "/Shares/sharedfile1.txt" should exist
And the content of file "/Shares/sharedfile1.txt" for user "Alice" should be "ownCloud test text file 1"
And as "Alice" file "/textfile1.txt" should exist
And as "Brian" file "/sharedfile1.txt" should exist
And the content of file "/sharedfile1.txt" for user "Brian" should be "ownCloud test text file 1"
Examples:
| dav_version |
| old |
| new |


Scenario Outline: copy a folder over the top of an existing folder received as a user share
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have this test:

Scenario Outline: copy a folder over the top of an existing folder received as a share

Given using <dav_version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Brian" has created folder "/BRIAN-Folder"
And user "Brian" has created folder "BRIAN-Folder/sample-folder"
And user "Brian" has shared folder "BRIAN-Folder" with user "Alice"
And user "Alice" has accepted share "/BRIAN-Folder" offered by user "Brian"
And user "Alice" has created folder "FOLDER/ALICE-folder"
When user "Alice" copies folder "/FOLDER" to "/Shares/BRIAN-Folder" using the WebDAV API
Then the HTTP status code should be "409"
And as "Alice" folder "/FOLDER/ALICE-folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder/sample-folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder/ALICE-folder" should not exist
And as "Brian" folder "BRIAN-Folder" should exist
And as "Brian" folder "BRIAN-Folder/sample-folder" should exist
And as "Brian" folder "/Shares/BRIAN-Folder/ALICE-folder" should not exist
Examples:
| dav_version |
| old |
Expand Down Expand Up @@ -879,3 +945,19 @@ Feature: copy file
Examples:
| dav_version |
| spaces |


Scenario Outline: copying a folder with a file onto another folder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar test scenario:

Scenario Outline: copying a folder with a file into another folder

Given using <dav_version> DAV path
And user "Alice" has created folder "/FOLDER1"
And user "Alice" has created folder "/FOLDER2"
And user "Alice" has uploaded file with content "Folder 1 text" to "/FOLDER1/textfile1.txt"
And user "Alice" has uploaded file with content "Folder 2 text" to "/FOLDER2/textfile2.txt"
When user "Alice" copies folder "/FOLDER1" to "/FOLDER2" using the WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "/FOLDER2/textfile1.txt" should exist
And as "Alice" file "/FOLDER2/textfile2.txt" should not exist
Examples:
| dav_version |
| old |
| new |