From 82a5c2037c4fd345e44bbaa6c12eaac6f65caf2c Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 22 Aug 2022 15:02:15 +0545 Subject: [PATCH] Demonstrate copy file over shared file and folder over shared folder --- .../apiWebdavProperties1/copyFile.feature | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tests/acceptance/features/apiWebdavProperties1/copyFile.feature b/tests/acceptance/features/apiWebdavProperties1/copyFile.feature index 3231a82f5ae0..7a482368ebd9 100644 --- a/tests/acceptance/features/apiWebdavProperties1/copyFile.feature +++ b/tests/acceptance/features/apiWebdavProperties1/copyFile.feature @@ -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 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 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 path And user "Brian" has been created with default attributes and without skeleton files