Skip to content

Commit

Permalink
Demonstrate copy file over shared file and folder over shared folder
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Apr 18, 2023
1 parent c161549 commit f36b220
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions tests/acceptance/features/apiWebdavProperties1/copyFile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,91 @@ Feature: copy file
| 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
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"
# Alice now sees the content of "her" file in /Shares/sharedfile1.txt
# The share that she received from Brian has "automatically" gone into the "declined" state
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 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"
# Alice can accept the share from Brian again
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" text file as "/Shares/sharedfile1.txt"
# and has the shared folder from Brian as "/Shares/sharedfile1 (2).txt"
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 "/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 folder over the top of an existing folder received as a user 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 "204"
# Alice now sees the content of "her" folder as folder "/Shares/BRIAN-Folder"
# The share that she received from Brian has "automatically" gone into the "declined" state
And as "Alice" folder "/FOLDER/ALICE-folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder/ALICE-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/BRIAN-Folder |
# Brian still has his original BRIAN-Folder and can see that it is shared with Alice
And as "Brian" folder "BRIAN-Folder" should exist
And as "Brian" folder "BRIAN-Folder/sample-folder" should exist
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/BRIAN-Folder" should be included in the response
When user "Alice" accepts share "/BRIAN-Folder" 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/BRIAN-Folder"
# and has the shared file from Brian as "/Shares/BRIAN-Folder (2)"
And as "Alice" folder "/Shares/BRIAN-Folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder/ALICE-folder" should exist
And as "Alice" folder "/Shares/BRIAN-Folder (2)" should exist
And as "Alice" folder "/Shares/BRIAN-Folder (2)/sample-folder" should exist
# Alice can add content to both folders
# Brian sees what Alice puts into "/Shares/BRIAN-Folder (2)"
And user "Alice" has created folder "/Shares/BRIAN-Folder/new-folder1"
And user "Alice" has created folder "/Shares/BRIAN-Folder (2)/new-folder2"
And user "Alice" has uploaded file with content "new content 1" to "/Shares/BRIAN-Folder/new-folder1/file1.txt"
And user "Alice" has uploaded file with content "new content 2" to "/Shares/BRIAN-Folder (2)/new-folder2/file2.txt"
And the content of file "/Shares/BRIAN-Folder/new-folder1/file1.txt" for user "Alice" should be "new content 1"
And the content of file "/Shares/BRIAN-Folder (2)/new-folder2/file2.txt" for user "Alice" should be "new content 2"
And the content of file "/BRIAN-Folder/new-folder2/file2.txt" for user "Brian" should be "new content 2"
Examples:
| dav_version |
| old |
| new |


Scenario Outline: copy a folder into another folder at different level which is received as a user share
Given using <dav_version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
Expand Down

0 comments on commit f36b220

Please sign in to comment.