From 098080a4e0e96ceba1a8a52c5b76b9d105c507a2 Mon Sep 17 00:00:00 2001 From: Dipak Acharya Date: Wed, 23 Sep 2020 13:15:57 +0545 Subject: [PATCH 1/2] [Tests-Only] refactor shareManagement test suite for Shares subfolder and root --- .drone.star | 3 +- tests/acceptance/config/behat.yml | 16 +- .../acceptShares.feature | 22 +- ...SharesToSharesFolderOc10Issue37883.feature | 4 +- .../disableSharing.feature | 2 +- .../mergeShare.feature | 2 +- .../moveReceivedShare.feature | 2 +- .../acceptShares.feature | 451 ++++++++++++++++++ .../acceptSharesToSharesFolder.feature | 20 +- .../mergeShare.feature | 106 ++++ .../moveReceivedShare.feature | 101 ++++ .../features/bootstrap/OccContext.php | 2 +- 12 files changed, 690 insertions(+), 41 deletions(-) rename tests/acceptance/features/{apiShareManagement => apiShareManagementToRoot}/acceptShares.feature (98%) rename tests/acceptance/features/{apiShareManagement => apiShareManagementToRoot}/acceptSharesToSharesFolderOc10Issue37883.feature (96%) rename tests/acceptance/features/{apiShareManagement => apiShareManagementToRoot}/disableSharing.feature (98%) rename tests/acceptance/features/{apiShareManagement => apiShareManagementToRoot}/mergeShare.feature (98%) rename tests/acceptance/features/{apiShareManagement => apiShareManagementToRoot}/moveReceivedShare.feature (98%) create mode 100644 tests/acceptance/features/apiShareManagementToShares/acceptShares.feature rename tests/acceptance/features/{apiShareManagement => apiShareManagementToShares}/acceptSharesToSharesFolder.feature (80%) create mode 100644 tests/acceptance/features/apiShareManagementToShares/mergeShare.feature create mode 100644 tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature diff --git a/.drone.star b/.drone.star index 0cb6851f4d87..fc9c5806a667 100644 --- a/.drone.star +++ b/.drone.star @@ -93,7 +93,8 @@ config = { 'apiShareCreateSpecialRoot2', 'apiShareCreateSpecialShares2', 'apiSharees', - 'apiShareManagement', + 'apiShareManagementToRoot', + 'apiShareManagementToShares', 'apiShareToRootManagementBasic', 'apiShareToSharesManagementBasic', 'apiShareOperationsToRoot', diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 221d3812a13a..aa08263dc88a 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -185,9 +185,21 @@ default: - ShareesContext: - AppConfigurationContext: - apiShareManagement: + apiShareManagementToRoot: paths: - - '%paths.base%/../features/apiShareManagement' + - '%paths.base%/../features/apiShareManagementToRoot' + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - OccContext: + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - AppConfigurationContext: + + apiShareManagementToShares: + paths: + - '%paths.base%/../features/apiShareManagementToShares' context: *common_ldap_suite_context contexts: - FeatureContext: *common_feature_context_params diff --git a/tests/acceptance/features/apiShareManagement/acceptShares.feature b/tests/acceptance/features/apiShareManagementToRoot/acceptShares.feature similarity index 98% rename from tests/acceptance/features/apiShareManagement/acceptShares.feature rename to tests/acceptance/features/apiShareManagementToRoot/acceptShares.feature index 6e518deeff9f..8d1bfb2e1e74 100644 --- a/tests/acceptance/features/apiShareManagement/acceptShares.feature +++ b/tests/acceptance/features/apiShareManagementToRoot/acceptShares.feature @@ -1,4 +1,4 @@ -@api @files_sharing-app-required @issue-ocis-reva-34 @issue-ocis-reva-41 @issue-ocis-reva-243 +@api @files_sharing-app-required @notToImplementOnOCIS Feature: accept/decline shares coming from internal users As a user I want to have control of which received shares I accept @@ -16,7 +16,7 @@ Feature: accept/decline shares coming from internal users And user "Brian" has been added to group "grp1" And user "Carol" has been added to group "grp1" - @smokeTest @toImplementOnOCIS + @smokeTest Scenario Outline: share a file & folder with another internal user with different permissions when auto accept is enabled Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" When user "Alice" creates a share using the sharing API with settings @@ -46,7 +46,6 @@ Feature: accept/decline shares coming from internal users | change | | all | - @toImplementOnOCIS Scenario Outline: share a file & folder with another internal user when auto accept is enabled and there is a default folder for received shares Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And the administrator has set the default folder for received shares to "" @@ -73,7 +72,6 @@ Feature: accept/decline shares coming from internal users | ReceivedShares | /ReceivedShares | | PARENT | textfile0.txt | | /My/Received/Shares | /My/Received/Shares | | PARENT | textfile0.txt | - @toImplementOnOCIS Scenario Outline: share a file & folder with internal group with different permissions when auto accept is enabled Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" When user "Alice" creates a share using the sharing API with settings @@ -114,7 +112,7 @@ Feature: accept/decline shares coming from internal users | change | | all | - @smokeTest @toImplementOnOCIS + @smokeTest Scenario: decline a share that has been auto-accepted Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has shared folder "/PARENT" with user "Brian" @@ -132,7 +130,6 @@ Feature: accept/decline shares coming from internal users | /PARENT/ | | /textfile0.txt | - @toImplementOnOCIS Scenario: accept a share that has been declined before Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has shared folder "/PARENT" with user "Brian" @@ -167,7 +164,6 @@ Feature: accept/decline shares coming from internal users | /PARENT/ | | /textfile0.txt | - @toImplementOnOCIS Scenario: unshare a share that was shared with a group and auto-accepted Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has shared folder "/PARENT" with group "grp1" @@ -191,7 +187,6 @@ Feature: accept/decline shares coming from internal users | /PARENT (2)/ | | /textfile0 (2).txt | - @toImplementOnOCIS Scenario: rename accepted share, decline it Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has shared folder "/PARENT" with user "Brian" @@ -206,7 +201,6 @@ Feature: accept/decline shares coming from internal users | path | | /PARENT/ | - @toImplementOnOCIS Scenario: rename accepted share, decline it then accept again, name stays Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has shared folder "/PARENT" with user "Brian" @@ -222,7 +216,6 @@ Feature: accept/decline shares coming from internal users | path | | /PARENT-renamed/ | - @toImplementOnOCIS Scenario: move accepted share, decline it, accept again Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has created folder "/shared" @@ -240,7 +233,6 @@ Feature: accept/decline shares coming from internal users | path | | /PARENT/shared/ | - @toImplementOnOCIS Scenario: move accepted share, decline it, delete parent folder, accept again Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has created folder "/shared" @@ -259,7 +251,6 @@ Feature: accept/decline shares coming from internal users | path | | /shared/ | - @toImplementOnOCIS Scenario: receive two shares with identical names from different users Given parameter "shareapi_auto_accept_share" of app "core" has been set to "yes" And user "Alice" has created folder "/shared" @@ -278,7 +269,7 @@ Feature: accept/decline shares coming from internal users | /shared/ | | /shared (2)/ | - @smokeTest @toImplementOnOCIS + @smokeTest Scenario: share a file & folder with another internal group when auto accept is disabled Given parameter "shareapi_auto_accept_share" of app "core" has been set to "no" When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API @@ -482,7 +473,6 @@ Feature: accept/decline shares coming from internal users And user "Alice" deletes file "/textfile0.txt" using the WebDAV API Then the sharing API should report that no shares are shared with user "Brian" - @toImplementOnOCIS Scenario: only one user in a group accepts a share Given parameter "shareapi_auto_accept_share" of app "core" has been set to "no" And user "Alice" has shared folder "/PARENT" with group "grp1" @@ -528,7 +518,6 @@ Feature: accept/decline shares coming from internal users | /shared/ | | /shared (2)/ | - @toImplementOnOCIS Scenario: share with a group that you are part of yourself Given parameter "shareapi_auto_accept_share" of app "core" has been set to "no" When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API @@ -599,7 +588,6 @@ Feature: accept/decline shares coming from internal users And the content of file "/PARENT (2)/abc.txt" for user "Brian" should be "uploaded content" And the content of file "/FOLDER (2)/abc.txt" for user "Brian" should be "uploaded content" - @toImplementOnOCIS Scenario: user shares folder in a group with matching folder-name for every users involved Given user "Alice" uploads file with content "uploaded content" to "/PARENT/abc.txt" using the WebDAV API And user "Alice" uploads file with content "uploaded content" to "/FOLDER/abc.txt" using the WebDAV API @@ -632,7 +620,6 @@ Feature: accept/decline shares coming from internal users And the content of file "/PARENT (2)/abc.txt" for user "Carol" should be "uploaded content" And the content of file "/FOLDER (2)/abc.txt" for user "Carol" should be "uploaded content" - @toImplementOnOCIS Scenario: user shares files in a group with matching file-names for every users involved in sharing When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API And user "Alice" shares file "/textfile1.txt" with group "grp1" using the sharing API @@ -669,7 +656,6 @@ Feature: accept/decline shares coming from internal users | /PARENT%20(2)/ | | /textfile0%20(2).txt | - @toImplementOnOCIS Scenario: user shares file in a group with matching filename when auto accept is disabled Given parameter "shareapi_auto_accept_share" of app "core" has been set to "no" When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API diff --git a/tests/acceptance/features/apiShareManagement/acceptSharesToSharesFolderOc10Issue37883.feature b/tests/acceptance/features/apiShareManagementToRoot/acceptSharesToSharesFolderOc10Issue37883.feature similarity index 96% rename from tests/acceptance/features/apiShareManagement/acceptSharesToSharesFolderOc10Issue37883.feature rename to tests/acceptance/features/apiShareManagementToRoot/acceptSharesToSharesFolderOc10Issue37883.feature index 574e9144ab52..e2b45e1a2ce4 100644 --- a/tests/acceptance/features/apiShareManagement/acceptSharesToSharesFolderOc10Issue37883.feature +++ b/tests/acceptance/features/apiShareManagementToRoot/acceptSharesToSharesFolderOc10Issue37883.feature @@ -1,4 +1,4 @@ -@api @files_sharing-app-required +@api @files_sharing-app-required @notToImplementOnOCIS Feature: accept/decline shares coming from internal users to the Shares folder As a user I want to have control of which received shares I accept @@ -12,7 +12,6 @@ Feature: accept/decline shares coming from internal users to the Shares folder | Alice | | Brian | - @notToImplementOnOCIS @issue-37883 Scenario: When accepting a share of a file, the response has valid fields # When fixing this issue on oC10, delete this scenario and enable the scenario in acceptSharesToSharesFolder Given the administrator has set the default folder for received shares to "Shares" @@ -35,7 +34,6 @@ Feature: accept/decline shares coming from internal users to the Shares folder | share_type | user | And the content of file "/Shares/textfile0.txt" for user "Brian" should be "ownCloud test text file 0" plus end-of-line - @notToImplementOnOCIS @issue-37883 Scenario: When accepting a share of a folder, the response has valid fields # When fixing this issue on oC10, delete this scenario and enable the scenario in acceptSharesToSharesFolder Given the administrator has set the default folder for received shares to "Shares" diff --git a/tests/acceptance/features/apiShareManagement/disableSharing.feature b/tests/acceptance/features/apiShareManagementToRoot/disableSharing.feature similarity index 98% rename from tests/acceptance/features/apiShareManagement/disableSharing.feature rename to tests/acceptance/features/apiShareManagementToRoot/disableSharing.feature index 480a4aa340f1..dc93a177f897 100644 --- a/tests/acceptance/features/apiShareManagement/disableSharing.feature +++ b/tests/acceptance/features/apiShareManagementToRoot/disableSharing.feature @@ -1,4 +1,4 @@ -@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-41 @issue-ocis-reva-243 +@api @files_sharing-app-required @notToImplementOnOCIS Feature: sharing As an admin I want to be able to disable sharing functionality diff --git a/tests/acceptance/features/apiShareManagement/mergeShare.feature b/tests/acceptance/features/apiShareManagementToRoot/mergeShare.feature similarity index 98% rename from tests/acceptance/features/apiShareManagement/mergeShare.feature rename to tests/acceptance/features/apiShareManagementToRoot/mergeShare.feature index 3c8144752795..850c539b239d 100644 --- a/tests/acceptance/features/apiShareManagement/mergeShare.feature +++ b/tests/acceptance/features/apiShareManagementToRoot/mergeShare.feature @@ -1,4 +1,4 @@ -@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-34 @issue-ocis-reva-243 +@api @files_sharing-app-required @notToImplementOnOCIS Feature: sharing Background: diff --git a/tests/acceptance/features/apiShareManagement/moveReceivedShare.feature b/tests/acceptance/features/apiShareManagementToRoot/moveReceivedShare.feature similarity index 98% rename from tests/acceptance/features/apiShareManagement/moveReceivedShare.feature rename to tests/acceptance/features/apiShareManagementToRoot/moveReceivedShare.feature index d7b7c2a43abb..4d6635be95a4 100644 --- a/tests/acceptance/features/apiShareManagement/moveReceivedShare.feature +++ b/tests/acceptance/features/apiShareManagementToRoot/moveReceivedShare.feature @@ -1,4 +1,4 @@ -@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-14 @issue-ocis-reva-243 +@api @files_sharing-app-required @notToImplementOnOCIS Feature: sharing Background: diff --git a/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature b/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature new file mode 100644 index 000000000000..3e5553633fce --- /dev/null +++ b/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature @@ -0,0 +1,451 @@ +@api @files_sharing-app-required @issue-ocis-reva-34 @issue-ocis-reva-41 @issue-ocis-reva-243 +Feature: accept/decline shares coming from internal users + As a user + I want to have control of which received shares I accept + So that I can keep my file system clean + + Background: + Given the administrator has set the default folder for received shares to "Shares" + And auto-accept shares has been disabled + And using OCS API version "1" + And using new DAV path + And these users have been created with default attributes and skeleton files: + | username | + | Alice | + | Brian | + | Carol | + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Carol" has been added to group "grp1" + + @smokeTest @toImplementOnOCIS + Scenario: share a file & folder with another internal group when auto accept is disabled + When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API + And user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /textfile0.txt | + But user "Brian" should not see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the pending state + | path | + | /PARENT/ | + | /textfile0.txt | + And user "Carol" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /textfile0.txt | + But user "Carol" should not see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Carol" that these shares are in the pending state + | path | + | /PARENT/ | + | /textfile0.txt | + + Scenario: share a file & folder with another internal user when auto accept is disabled + When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API + And user "Alice" shares file "/textfile0.txt" with user "Brian" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /textfile0.txt | + But user "Brian" should not see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the pending state + | path | + | /PARENT/ | + | /textfile0.txt | + + @smokeTest + Scenario: accept a pending share + Given user "Alice" has shared folder "/PARENT" with user "Brian" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" + When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And the fields of the last response to user "Alice" sharing with user "Brian" should include + | id | A_STRING | + | share_type | user | + | uid_owner | %username% | + | displayname_owner | %displayname% | + | permissions | share,read,update | + | uid_file_owner | %username% | + | displayname_file_owner | %displayname% | + | state | 0 | + | path | /Shares/textfile0.txt | + | item_type | file | + | mimetype | text/plain | + | storage_id | shared::/Shares/textfile0.txt | + | storage | A_STRING | + | item_source | A_STRING | + | file_source | A_STRING | + | file_target | /Shares/textfile0.txt | + | share_with | %username% | + | share_with_displayname | %displayname% | + | mail_send | 0 | + And user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /textfile0.txt | + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the accepted state + | path | + | /Shares/PARENT | + | /Shares/textfile0.txt | + + @toImplementInOCIS + Scenario Outline: accept a pending share when there is a default folder for received shares + Given the administrator has set the default folder for received shares to "" + And user "Alice" has shared folder "/PARENT" with user "Brian" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" + When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And the fields of the last response to user "Alice" sharing with user "Brian" should include + | id | A_STRING | + | share_type | user | + | uid_owner | %username% | + | displayname_owner | %displayname% | + | permissions | share,read,update | + | uid_file_owner | %username% | + | displayname_file_owner | %displayname% | + | state | 0 | + | path | / | + | item_type | file | + | mimetype | text/plain | + | storage_id | shared::/ | + | storage | A_STRING | + | item_source | A_STRING | + | file_source | A_STRING | + | file_target | / | + | share_with | %username% | + | share_with_displayname | %displayname% | + | mail_send | 0 | + And user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /PARENT/ | + | /PARENT/parent.txt | + | /textfile0.txt | + | /textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the accepted state + | path | + | // | + | / | + Examples: + | share_folder | top_folder | suffix | received_parent_name | received_textfile_name | + | | | %20(2) | PARENT (2) | textfile0 (2).txt | + | / | | %20(2) | PARENT (2) | textfile0 (2).txt | + | /ReceivedShares | /ReceivedShares | | PARENT | textfile0.txt | + | ReceivedShares | /ReceivedShares | | PARENT | textfile0.txt | + | /My/Received/Shares | /My/Received/Shares | | PARENT | textfile0.txt | + + Scenario: accept an accepted share + Given user "Alice" has created folder "/shared" + And user "Alice" has shared folder "/shared" with user "Brian" + When user "Brian" accepts share "/shared" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should see the following elements + | /Shares/shared/ | + And the sharing API should report to user "Brian" that these shares are in the accepted state + | path | + | /Shares/shared/ | + + @smokeTest + Scenario: declines a pending share + Given user "Alice" has shared folder "/PARENT" with user "Brian" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" + When user "Brian" declines share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" declines share "/textfile0.txt" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /textfile0.txt | + But user "Brian" should not see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the declined state + | path | + | /PARENT/ | + | /textfile0.txt | + + @smokeTest + Scenario: decline an accepted share + Given user "Alice" has shared folder "/PARENT" with user "Brian" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/PARENT" offered by user "Alice" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" declines share "/Shares/PARENT" offered by user "Alice" using the sharing API + And user "Brian" declines share "/Shares/textfile0.txt" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should not see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the declined state + | path | + | /PARENT/ | + | /textfile0.txt | + + Scenario: deleting shares in pending state + Given user "Alice" has shared folder "/PARENT" with user "Brian" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" + When user "Alice" deletes folder "/PARENT" using the WebDAV API + And user "Alice" deletes file "/textfile0.txt" using the WebDAV API + Then the sharing API should report that no shares are shared with user "Brian" + + @toImplementOnOCIS + Scenario: only one user in a group accepts a share + Given user "Alice" has shared folder "/PARENT" with group "grp1" + And user "Alice" has shared file "/textfile0.txt" with group "grp1" + When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Carol" should not see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Carol" that these shares are in the pending state + | path | + | /PARENT/ | + | /textfile0.txt | + But user "Brian" should see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/parent.txt | + | /Shares/textfile0.txt | + And the sharing API should report to user "Brian" that these shares are in the accepted state + | path | + | /Shares/PARENT/ | + | /Shares/textfile0.txt | + + Scenario: receive two shares with identical names from different users, accept one by one + Given user "Alice" has created folder "/shared" + And user "Alice" has created folder "/shared/Alice" + And user "Brian" has created folder "/shared" + And user "Brian" has created folder "/shared/Brian" + And user "Alice" has shared folder "/shared" with user "Carol" + And user "Brian" has shared folder "/shared" with user "Carol" + When user "Carol" accepts share "/shared" offered by user "Brian" using the sharing API + And user "Carol" accepts share "/shared" offered by user "Alice" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Carol" should see the following elements + | /Shares/shared/Brian/ | + | /Shares/shared%20(2)/Alice/ | + And the sharing API should report to user "Carol" that these shares are in the accepted state + | path | + | /Shares/shared/ | + | /Shares/shared (2)/ | + + @toImplementOnOCIS + Scenario: share with a group that you are part of yourself + When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And the sharing API should report to user "Brian" that these shares are in the pending state + | path | + | /PARENT/ | + And the sharing API should report that no shares are shared with user "Alice" + + Scenario: user accepts file that was initially accepted from another user and then declined + Given user "Alice" has uploaded file with content "First file" to "/testfile.txt" + And user "Brian" has uploaded file with content "Second file" to "/testfile.txt" + And user "Carol" has created folder "Shares" + And user "Carol" has uploaded file with content "Third file" to "/Shares/testfile.txt" + And user "Alice" has shared file "/testfile.txt" with user "Carol" + And user "Carol" has accepted share "/testfile.txt" offered by user "Alice" + When user "Carol" declines share "/Shares/testfile (2).txt" offered by user "Alice" using the sharing API + And user "Brian" shares file "/testfile.txt" with user "Carol" using the sharing API + And user "Carol" accepts share "/testfile.txt" offered by user "Brian" using the sharing API + And user "Carol" accepts share "/testfile.txt" offered by user "Alice" using the sharing API + Then the sharing API should report to user "Carol" that these shares are in the accepted state + | path | + | /Shares/testfile (2).txt | + | /Shares/testfile (2) (2).txt | + And the content of file "/Shares/testfile.txt" for user "Carol" should be "Third file" + And the content of file "/Shares/testfile (2).txt" for user "Carol" should be "Second file" + And the content of file "/Shares/testfile (2) (2).txt" for user "Carol" should be "First file" + + Scenario: user accepts shares received from multiple users with the same name when auto-accept share is disabled + Given user "David" has been created with default attributes and skeleton files + And user "Brian" has shared folder "/PARENT" with user "Alice" + And user "Carol" has shared folder "/PARENT" with user "Alice" + And user "Alice" has created folder "Shares" + And user "Alice" has created folder "Shares/PARENT" + When user "Alice" accepts share "/PARENT" offered by user "Brian" using the sharing API + And user "Alice" declines share "/Shares/PARENT (2)" offered by user "Brian" using the sharing API + And user "Alice" accepts share "/PARENT" offered by user "Carol" using the sharing API + And user "Alice" accepts share "/PARENT" offered by user "Brian" using the sharing API + And user "Alice" declines share "/Shares/PARENT (2)" offered by user "Carol" using the sharing API + And user "Alice" declines share "/Shares/PARENT (2) (2)" offered by user "Brian" using the sharing API + And user "David" shares folder "/PARENT" with user "Alice" using the sharing API + And user "Alice" accepts share "/PARENT" offered by user "David" using the sharing API + And user "Alice" accepts share "/PARENT" offered by user "Carol" using the sharing API + And user "Alice" accepts share "/PARENT" offered by user "Brian" using the sharing API + Then the sharing API should report to user "Alice" that these shares are in the accepted state + | path | uid_owner | + | /Shares/PARENT (2)/ | David | + | /Shares/PARENT (2) (2)/ | Carol | + | /Shares/PARENT (2) (2) (2)/ | Brian | + + Scenario: user shares folder with matching folder-name for both user involved in sharing + Given user "Alice" uploads file with content "uploaded content" to "/PARENT/abc.txt" using the WebDAV API + And user "Alice" uploads file with content "uploaded content" to "/FOLDER/abc.txt" using the WebDAV API + When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API + And user "Alice" shares folder "/FOLDER" with user "Brian" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API + Then user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /Shares/PARENT/ | + | /Shares/PARENT/abc.txt | + | /Shares/FOLDER/ | + | /Shares/FOLDER/abc.txt | + And user "Brian" should not see the following elements + | /FOLDER/abc.txt | + | /PARENT/abc.txt | + And the content of file "/Shares/PARENT/abc.txt" for user "Brian" should be "uploaded content" + And the content of file "/Shares/FOLDER/abc.txt" for user "Brian" should be "uploaded content" + + @toImplementOnOCIS + Scenario: user shares folder in a group with matching folder-name for every users involved + Given user "Alice" uploads file with content "uploaded content" to "/PARENT/abc.txt" using the WebDAV API + And user "Alice" uploads file with content "uploaded content" to "/FOLDER/abc.txt" using the WebDAV API + When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API + And user "Alice" shares folder "/FOLDER" with group "grp1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/FOLDER" offered by user "Alice" using the sharing API + Then user "Brian" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /Shares/PARENT/ | + | /Shares/FOLDER/ | + | /Shares/PARENT/abc.txt | + | /Shares/FOLDER/abc.txt | + And user "Brian" should not see the following elements + | /FOLDER/abc.txt | + | /PARENT/abc.txt | + And user "Carol" should see the following elements + | /FOLDER/ | + | /PARENT/ | + | /Shares/PARENT/ | + | /Shares/FOLDER/ | + | /Shares/PARENT/abc.txt | + | /Shares/FOLDER/abc.txt | + And user "Carol" should not see the following elements + | /FOLDER/abc.txt | + | /PARENT/abc.txt | + And the content of file "/Shares/PARENT/abc.txt" for user "Brian" should be "uploaded content" + And the content of file "/Shares/FOLDER/abc.txt" for user "Brian" should be "uploaded content" + And the content of file "/Shares/PARENT/abc.txt" for user "Carol" should be "uploaded content" + And the content of file "/Shares/FOLDER/abc.txt" for user "Carol" should be "uploaded content" + + @toImplementOnOCIS + Scenario: user shares files in a group with matching file-names for every users involved in sharing + When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API + And user "Alice" shares file "/textfile1.txt" with group "grp1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API + Then user "Brian" should see the following elements + | /textfile0.txt | + | /textfile1.txt | + | /Shares/textfile0.txt | + | /Shares/textfile1.txt | + And user "Carol" should see the following elements + | /textfile0.txt | + | /textfile1.txt | + | /Shares/textfile0.txt | + | /Shares/textfile1.txt | + + Scenario: user shares resource with matching resource-name with another user when auto accept is disabled + Given user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API + And user "Alice" shares file "/textfile0.txt" with user "Brian" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should see the following elements + | /PARENT/ | + | /textfile0.txt | + But user "Brian" should not see the following elements + | /Shares/textfile0.txt | + | /Shares/PARENT/ | + When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + Then user "Brian" should see the following elements + | /PARENT/ | + | /textfile0.txt | + | /Shares/PARENT/ | + | /Shares/textfile0.txt | + + @toImplementOnOCIS + Scenario: user shares file in a group with matching filename when auto accept is disabled + When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And user "Brian" should see the following elements + | /textfile0.txt | + But user "Brian" should not see the following elements + | /Shares/textfile0.txt | + And user "Carol" should see the following elements + | /textfile0.txt | + But user "Carol" should not see the following elements + | /Shares/textfile0.txt | + When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + Then user "Brian" should see the following elements + | /textfile0.txt | + | /Shares/textfile0.txt | + When user "Carol" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + Then user "Carol" should see the following elements + | /textfile0.txt | + | /Shares/textfile0.txt | + + @skipOnLDAP + Scenario: user shares folder with matching folder name a user before that user has logged in + Given these users have been created with skeleton files but not initialized: + | username | + | David | + And user "Alice" uploads file with content "uploaded content" to "/PARENT/abc.txt" using the WebDAV API + When user "Alice" shares folder "/PARENT" with user "David" using the sharing API + When user "David" accepts share "/PARENT" offered by user "Alice" using the sharing API + Then user "David" should see the following elements + | /Shares/PARENT/ | + | /Shares/PARENT/abc.txt | + | /FOLDER/ | + | /textfile0.txt | + | /textfile1.txt | + | /textfile2.txt | + | /textfile3.txt | + And user "David" should not see the following elements + | /PARENT%20(2)/ | + And the content of file "/Shares/PARENT/abc.txt" for user "David" should be "uploaded content" diff --git a/tests/acceptance/features/apiShareManagement/acceptSharesToSharesFolder.feature b/tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature similarity index 80% rename from tests/acceptance/features/apiShareManagement/acceptSharesToSharesFolder.feature rename to tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature index 083d56903b5d..479f647bf59f 100644 --- a/tests/acceptance/features/apiShareManagement/acceptSharesToSharesFolder.feature +++ b/tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature @@ -5,7 +5,9 @@ Feature: accept/decline shares coming from internal users to the Shares folder So that I can keep my file system clean Background: - Given using OCS API version "1" + Given the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using OCS API version "1" And using new DAV path And these users have been created with default attributes and skeleton files: | username | @@ -13,24 +15,18 @@ Feature: accept/decline shares coming from internal users to the Shares folder | Brian | Scenario: When accepting a share of a file, the received file is accessible - Given the administrator has set the default folder for received shares to "Shares" - And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" - And user "Alice" has shared file "/textfile0.txt" with user "Brian" + Given user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API Then the content of file "/Shares/textfile0.txt" for user "Brian" should be "ownCloud test text file 0" plus end-of-line Scenario: When accepting a share of a folder, the received folder is accessible - Given the administrator has set the default folder for received shares to "Shares" - And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" - And user "Alice" has shared file "/PARENT" with user "Brian" + Given user "Alice" has shared file "/PARENT" with user "Brian" When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API Then the content of file "/Shares/PARENT/parent.txt" for user "Brian" should be "ownCloud test text file parent" plus end-of-line @skipOnOcV10 @issue-37883 Scenario: When accepting a share of a file, the response is valid - Given the administrator has set the default folder for received shares to "Shares" - And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" - And user "Alice" has shared file "/textfile0.txt" with user "Brian" + Given user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API Then the OCS status code should be "100" And the HTTP status code should be "200" @@ -50,9 +46,7 @@ Feature: accept/decline shares coming from internal users to the Shares folder @skipOnOcV10 @issue-37883 Scenario: When accepting a share of a folder, the response is valid - Given the administrator has set the default folder for received shares to "Shares" - And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" - And user "Alice" has shared file "/PARENT" with user "Brian" + Given user "Alice" has shared file "/PARENT" with user "Brian" When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API Then the OCS status code should be "100" And the HTTP status code should be "200" diff --git a/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature b/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature new file mode 100644 index 000000000000..40f2a5dd9f12 --- /dev/null +++ b/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature @@ -0,0 +1,106 @@ +@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-34 @issue-ocis-reva-243 +Feature: sharing + + Background: + Given the administrator has set the default folder for received shares to "Shares" + And auto-accept shares has been disabled + And using OCS API version "1" + And these users have been created with default attributes and skeleton files: + | username | + | Alice | + | Brian | + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + + @smokeTest + Scenario: Merging shares for recipient when shared from outside with group and member + Given user "Alice" has created folder "/merge-test-outside" + When user "Alice" shares folder "/merge-test-outside" with group "grp1" using the sharing API + And user "Alice" shares folder "/merge-test-outside" with user "Brian" using the sharing API + And user "Brian" accepts share "/merge-test-outside" offered by user "Alice" using the sharing API + Then as "Brian" folder "/Shares/merge-test-outside" should exist + And as "Brian" folder "/Shares/merge-test-outside (2)" should not exist + + Scenario: Merging shares for recipient when shared from outside with group and member with different permissions + Given user "Alice" has created folder "/merge-test-outside-perms" + When user "Alice" shares folder "/merge-test-outside-perms" with group "grp1" with permissions "read" using the sharing API + And user "Alice" shares folder "/merge-test-outside-perms" with user "Brian" with permissions "all" using the sharing API + And user "Brian" accepts share "/merge-test-outside-perms" offered by user "Alice" using the sharing API + Then as user "Brian" folder "/Shares/merge-test-outside-perms" should contain a property "oc:permissions" with value "SRDNVCK" + And as "Brian" folder "/Shares/merge-test-outside-perms (2)" should not exist + + Scenario: Merging shares for recipient when shared from outside with two groups + Given group "grp2" has been created + And user "Brian" has been added to group "grp2" + And user "Alice" has created folder "/merge-test-outside-twogroups" + When user "Alice" shares folder "/merge-test-outside-twogroups" with group "grp1" using the sharing API + And user "Alice" shares folder "/merge-test-outside-twogroups" with group "grp2" using the sharing API + And user "Brian" accepts share "/merge-test-outside-twogroups" offered by user "Alice" using the sharing API + Then as "Brian" folder "/Shares/merge-test-outside-twogroups" should exist + And as "Brian" folder "/Shares/merge-test-outside-twogroups (2)" should not exist + + Scenario: Merging shares for recipient when shared from outside with two groups with different permissions + Given group "grp2" has been created + And user "Brian" has been added to group "grp2" + And user "Alice" has created folder "/merge-test-outside-twogroups-perms" + When user "Alice" shares folder "/merge-test-outside-twogroups-perms" with group "grp1" with permissions "read" using the sharing API + And user "Alice" shares folder "/merge-test-outside-twogroups-perms" with group "grp2" with permissions "all" using the sharing API + And user "Brian" accepts share "/merge-test-outside-twogroups-perms" offered by user "Alice" using the sharing API + Then as user "Brian" folder "/Shares/merge-test-outside-twogroups-perms" should contain a property "oc:permissions" with value "SRDNVCK" + And as "Brian" folder "/Shares/merge-test-outside-twogroups-perms (2)" should not exist + + Scenario: Merging shares for recipient when shared from outside with two groups and member + Given group "grp2" has been created + And user "Brian" has been added to group "grp2" + And user "Alice" has created folder "/merge-test-outside-twogroups-member-perms" + When user "Alice" shares folder "/merge-test-outside-twogroups-member-perms" with group "grp1" with permissions "read" using the sharing API + And user "Alice" shares folder "/merge-test-outside-twogroups-member-perms" with group "grp2" with permissions "all" using the sharing API + And user "Alice" shares folder "/merge-test-outside-twogroups-member-perms" with user "Brian" with permissions "read" using the sharing API + And user "Brian" accepts share "/merge-test-outside-twogroups-member-perms" offered by user "Alice" using the sharing API + Then as user "Brian" folder "/Shares/merge-test-outside-twogroups-member-perms" should contain a property "oc:permissions" with value "SRDNVCK" + And as "Brian" folder "/Shares/merge-test-outside-twogroups-member-perms (2)" should not exist + + Scenario: Merging shares for recipient when shared from inside with group + Given user "Brian" has created folder "/merge-test-inside-group" + When user "Brian" shares folder "/merge-test-inside-group" with group "grp1" using the sharing API + Then as "Brian" folder "/merge-test-inside-group" should exist + And as "Brian" folder "/Shares/merge-test-inside-group" should not exist + + Scenario: Merging shares for recipient when shared from inside with two groups + Given group "grp2" has been created + And user "Brian" has been added to group "grp2" + And user "Brian" has created folder "/merge-test-inside-twogroups" + When user "Brian" shares folder "/merge-test-inside-twogroups" with group "grp1" using the sharing API + And user "Brian" shares folder "/merge-test-inside-twogroups" with group "grp2" using the sharing API + Then as "Brian" folder "/merge-test-inside-twogroups" should exist + And as "Brian" folder "/Shares/merge-test-inside-twogroups" should not exist + And as "Brian" folder "/Shares/merge-test-inside-twogroups (2)" should not exist + + Scenario: Merging shares for recipient when shared from inside with group with less permissions + Given group "grp2" has been created + And user "Brian" has been added to group "grp2" + And user "Brian" has created folder "/merge-test-inside-twogroups-perms" + When user "Brian" shares folder "/merge-test-inside-twogroups-perms" with group "grp1" using the sharing API + And user "Brian" shares folder "/merge-test-inside-twogroups-perms" with group "grp2" using the sharing API + Then as user "Brian" folder "/merge-test-inside-twogroups-perms" should contain a property "oc:permissions" with value "RDNVCK" or with value "RMDNVCK" + And as "Brian" folder "/Shares/merge-test-inside-twogroups-perms" should not exist + And as "Brian" folder "/Shares/merge-test-inside-twogroups-perms (2)" should not exist + + Scenario: Merging shares for recipient when shared from outside with group then user and recipient renames in between + Given user "Alice" has created folder "/merge-test-outside-groups-renamebeforesecondshare" + When user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with group "grp1" using the sharing API + And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare" offered by user "Alice" using the sharing API + And user "Brian" moves folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed" using the WebDAV API + And user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with user "Brian" using the sharing API + And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare-renamed" offered by user "Alice" using the sharing API + Then as user "Brian" folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" should contain a property "oc:permissions" with value "SRDNVCK" + And as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should not exist + + Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between + Given user "Alice" has created folder "/merge-test-outside-groups-renamebeforesecondshare" + When user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with user "Brian" using the sharing API + And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare" offered by user "Alice" using the sharing API + And user "Brian" moves folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed" using the WebDAV API + And user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with group "grp1" using the sharing API + Then as user "Brian" folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" should contain a property "oc:permissions" with value "SRDNVCK" + And as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should not exist diff --git a/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature b/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature new file mode 100644 index 000000000000..e74e23842f06 --- /dev/null +++ b/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature @@ -0,0 +1,101 @@ +@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-14 @issue-ocis-reva-243 +Feature: sharing + + Background: + Given the administrator has set the default folder for received shares to "Shares" + And auto-accept shares has been disabled + And using OCS API version "1" + And these users have been created with default attributes and skeleton files: + | username | + | Alice | + | Brian | + | Carol | + + Scenario: Keep usergroup shares (#22143) + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Carol" has been added to group "grp1" + And user "Alice" has created folder "/TMP" + When user "Alice" shares folder "TMP" with group "grp1" using the sharing API + And user "Brian" accepts share "/TMP" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/TMP" offered by user "Alice" using the sharing API + And user "Brian" creates folder "/myFOLDER" using the WebDAV API + And user "Brian" moves folder "/Shares/TMP" to "/myFOLDER/myTMP" using the WebDAV API + And the administrator deletes user "Carol" using the provisioning API + Then user "Brian" should see the following elements + | /myFOLDER/myTMP/ | + + Scenario: keep user shared file name same after one of recipient has renamed the file + Given user "Alice" has uploaded file with content "foo" to "/sharefile.txt" + And user "Alice" has shared file "/sharefile.txt" with user "Brian" + And user "Alice" has shared file "/sharefile.txt" with user "Carol" + And user "Brian" accepts share "/sharefile.txt" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/sharefile.txt" offered by user "Alice" using the sharing API + When user "Carol" moves file "/Shares/sharefile.txt" to "/renamedsharefile.txt" using the WebDAV API + Then as "Carol" file "/renamedsharefile.txt" should exist + And as "Alice" file "/sharefile.txt" should exist + And as "Brian" file "/Shares/sharefile.txt" should exist + + Scenario: keep user shared file directory same in respect to respective user if one of the recipient has moved the file + Given user "Alice" has uploaded file with content "foo" to "/sharefile.txt" + And user "Alice" has shared file "/sharefile.txt" with user "Brian" + And user "Alice" has shared file "/sharefile.txt" with user "Carol" + And user "Brian" accepts share "/sharefile.txt" offered by user "Alice" using the sharing API + And user "Carol" accepts share "/sharefile.txt" offered by user "Alice" using the sharing API + And user "Carol" has created folder "newfolder" + When user "Carol" moves file "/Shares/sharefile.txt" to "/newfolder/sharefile.txt" using the WebDAV API + Then as "Carol" file "/newfolder/sharefile.txt" should exist + And as "Alice" file "/sharefile.txt" should exist + And as "Brian" file "/Shares/sharefile.txt" should exist + + Scenario Outline: move folder inside received folder with special characters + Given group "grp1" has been created + And user "Carol" has been added to group "grp1" + And user "Alice" has created folder "" + And user "Alice" has created folder "" + And user "Brian" has created folder "" + And user "Carol" has created folder "" + When user "Alice" shares folder "" with user "Brian" using the sharing API + And user "Brian" accepts share "/" offered by user "Alice" using the sharing API + And user "Brian" moves folder "" to "/Shares//" using the WebDAV API + Then as "Alice" folder "/" should exist + And as "Brian" folder "/Shares//" should exist + When user "Alice" shares folder "" with group "grp1" using the sharing API + And user "Carol" accepts share "/" offered by user "Alice" using the sharing API + And user "Carol" moves folder "/" to "/Shares//" using the WebDAV API + Then as "Alice" folder "/" should exist + And as "Carol" folder "/Shares//" should exist + Examples: + | sharer_folder | group_folder | receiver_folder | + | ?abc=oc # | ?abc=oc g%rp# | # oc?test=oc&a | + | @a#8a=b?c=d | @a#8a=b?c=d grp | ?a#8 a=b?c=d | + + Scenario: receiver renames a received share with share, read, change permissions + Given user "Alice" has created folder "folderToShare" + And user "Alice" has uploaded file with content "thisIsAFileInsideTheSharedFolder" to "/folderToShare/fileInside" + And user "Alice" has shared folder "folderToShare" with user "Brian" with permissions "share,read,change" + And user "Brian" accepts share "/folderToShare" offered by user "Alice" using the sharing API + When user "Brian" moves folder "/Shares/folderToShare" to "myFolder" using the WebDAV API + Then the HTTP status code should be "201" + And as "Brian" folder "myFolder" should exist + But as "Alice" folder "myFolder" should not exist + When user "Brian" moves file "/myFolder/fileInside" to "/myFolder/renamedFile" using the WebDAV API + Then the HTTP status code should be "201" + And as "Brian" file "/myFolder/renamedFile" should exist + And as "Alice" file "/folderToShare/renamedFile" should exist + But as "Alice" file "/folderToShare/fileInside" should not exist + + Scenario: receiver tries to rename a received share with share, read permissions + Given user "Alice" has created folder "folderToShare" + And user "Alice" has uploaded file with content "thisIsAFileInsideTheSharedFolder" to "/folderToShare/fileInside" + And user "Alice" has shared folder "folderToShare" with user "Brian" with permissions "share,read" + And user "Brian" accepts share "/folderToShare" offered by user "Alice" using the sharing API + When user "Brian" moves folder "/Shares/folderToShare" to "/myFolder" using the WebDAV API + Then the HTTP status code should be "201" + And as "Brian" folder "myFolder" should exist + But as "Alice" folder "myFolder" should not exist + When user "Brian" moves file "/myFolder/fileInside" to "/myFolder/renamedFile" using the WebDAV API + Then the HTTP status code should be "403" + And as "Brian" file "/myFolder/renamedFile" should not exist + But as "Brian" file "/myFolder/fileInside" should exist + diff --git a/tests/acceptance/features/bootstrap/OccContext.php b/tests/acceptance/features/bootstrap/OccContext.php index 4f71e929af05..2c8ab7540a9a 100644 --- a/tests/acceptance/features/bootstrap/OccContext.php +++ b/tests/acceptance/features/bootstrap/OccContext.php @@ -356,7 +356,7 @@ public function addSystemConfigKeyUsingTheOccCommand( $key, $value, $type = "string" ) { $this->invokingTheCommand( - "config:system:set --value ${value} --type ${type} ${key}" + "config:system:set --value '${value}' --type ${type} ${key}" ); } From 6b5e3f16858232c82317c46a69e8875640affe68 Mon Sep 17 00:00:00 2001 From: Dipak Acharya Date: Thu, 24 Sep 2020 13:19:28 +0545 Subject: [PATCH 2/2] Remove unused tags for ocis tests --- .../apiShareManagementToShares/acceptShares.feature | 9 ++------- .../apiShareManagementToShares/moveReceivedShare.feature | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature b/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature index 3e5553633fce..7d875e6727fb 100644 --- a/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature +++ b/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature @@ -18,7 +18,7 @@ Feature: accept/decline shares coming from internal users And user "Brian" has been added to group "grp1" And user "Carol" has been added to group "grp1" - @smokeTest @toImplementOnOCIS + @smokeTest Scenario: share a file & folder with another internal group when auto accept is disabled When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API And user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API @@ -214,7 +214,6 @@ Feature: accept/decline shares coming from internal users And user "Alice" deletes file "/textfile0.txt" using the WebDAV API Then the sharing API should report that no shares are shared with user "Brian" - @toImplementOnOCIS Scenario: only one user in a group accepts a share Given user "Alice" has shared folder "/PARENT" with group "grp1" And user "Alice" has shared file "/textfile0.txt" with group "grp1" @@ -258,7 +257,6 @@ Feature: accept/decline shares coming from internal users | /Shares/shared/ | | /Shares/shared (2)/ | - @toImplementOnOCIS Scenario: share with a group that you are part of yourself When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API Then the OCS status code should be "100" @@ -331,7 +329,6 @@ Feature: accept/decline shares coming from internal users And the content of file "/Shares/PARENT/abc.txt" for user "Brian" should be "uploaded content" And the content of file "/Shares/FOLDER/abc.txt" for user "Brian" should be "uploaded content" - @toImplementOnOCIS Scenario: user shares folder in a group with matching folder-name for every users involved Given user "Alice" uploads file with content "uploaded content" to "/PARENT/abc.txt" using the WebDAV API And user "Alice" uploads file with content "uploaded content" to "/FOLDER/abc.txt" using the WebDAV API @@ -368,7 +365,6 @@ Feature: accept/decline shares coming from internal users And the content of file "/Shares/PARENT/abc.txt" for user "Carol" should be "uploaded content" And the content of file "/Shares/FOLDER/abc.txt" for user "Carol" should be "uploaded content" - @toImplementOnOCIS Scenario: user shares files in a group with matching file-names for every users involved in sharing When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API And user "Alice" shares file "/textfile1.txt" with group "grp1" using the sharing API @@ -408,7 +404,6 @@ Feature: accept/decline shares coming from internal users | /Shares/PARENT/ | | /Shares/textfile0.txt | - @toImplementOnOCIS Scenario: user shares file in a group with matching filename when auto accept is disabled When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API Then the OCS status code should be "100" @@ -437,7 +432,7 @@ Feature: accept/decline shares coming from internal users | David | And user "Alice" uploads file with content "uploaded content" to "/PARENT/abc.txt" using the WebDAV API When user "Alice" shares folder "/PARENT" with user "David" using the sharing API - When user "David" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "David" accepts share "/PARENT" offered by user "Alice" using the sharing API Then user "David" should see the following elements | /Shares/PARENT/ | | /Shares/PARENT/abc.txt | diff --git a/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature b/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature index e74e23842f06..f3ea4a290c5b 100644 --- a/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature +++ b/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature @@ -74,7 +74,7 @@ Feature: sharing Given user "Alice" has created folder "folderToShare" And user "Alice" has uploaded file with content "thisIsAFileInsideTheSharedFolder" to "/folderToShare/fileInside" And user "Alice" has shared folder "folderToShare" with user "Brian" with permissions "share,read,change" - And user "Brian" accepts share "/folderToShare" offered by user "Alice" using the sharing API + And user "Brian" has accepted share "/folderToShare" offered by user "Alice" When user "Brian" moves folder "/Shares/folderToShare" to "myFolder" using the WebDAV API Then the HTTP status code should be "201" And as "Brian" folder "myFolder" should exist @@ -89,7 +89,7 @@ Feature: sharing Given user "Alice" has created folder "folderToShare" And user "Alice" has uploaded file with content "thisIsAFileInsideTheSharedFolder" to "/folderToShare/fileInside" And user "Alice" has shared folder "folderToShare" with user "Brian" with permissions "share,read" - And user "Brian" accepts share "/folderToShare" offered by user "Alice" using the sharing API + And user "Brian" has accepted share "/folderToShare" offered by user "Alice" When user "Brian" moves folder "/Shares/folderToShare" to "/myFolder" using the WebDAV API Then the HTTP status code should be "201" And as "Brian" folder "myFolder" should exist