From 8940e1a94cbbf8d8a0a9485f257673825818b77a Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Tue, 25 May 2021 11:11:21 +0545 Subject: [PATCH] Add more test coverage to apiCustomGroups --- .../apiCustomGroups/customGroups.feature | 9 +++ .../sharingCustomGroups.feature | 69 +++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/tests/acceptance/features/apiCustomGroups/customGroups.feature b/tests/acceptance/features/apiCustomGroups/customGroups.feature index 0de07e9e..195581ee 100644 --- a/tests/acceptance/features/apiCustomGroups/customGroups.feature +++ b/tests/acceptance/features/apiCustomGroups/customGroups.feature @@ -289,3 +289,12 @@ Feature: Custom Groups | समूह | | ab | | hello-&#$% | + + Scenario: trying to leave an already left custom group + Given user "Alice" has been created with default attributes and without skeleton files + And user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created a custom group called "group1" + And user "Alice" has made user "Brian" a member of custom group "group1" + And user "Brian" has removed membership of user "Brian" from custom group "group1" + When user "Brian" removes membership of user "Brian" from custom group "group1" using the API + Then the HTTP status code should be "403" diff --git a/tests/acceptance/features/apiCustomGroups/sharingCustomGroups.feature b/tests/acceptance/features/apiCustomGroups/sharingCustomGroups.feature index bd533338..e9d49a41 100644 --- a/tests/acceptance/features/apiCustomGroups/sharingCustomGroups.feature +++ b/tests/acceptance/features/apiCustomGroups/sharingCustomGroups.feature @@ -208,3 +208,72 @@ Feature: Sharing Custom Groups | permissions | all | Then the OCS status code should be "100" And the HTTP status code should be "200" + + Scenario: user shares a file to a custom group and normal group with same name + Given user "Alice" has been created with default attributes and small skeleton files + And user "Alice" has created a custom group called "group1" + And group "group1" has been created + When user "Alice" shares file "/textfile0.txt" with group "customgroup_group1" using the sharing API + Then the HTTP status code should be "200" + When user "Alice" shares file "/textfile0.txt" with group "group1" using the sharing API + Then the HTTP status code should be "200" + And the HTTP status code should be "200" + And custom group "group1" should exist + And group "group1" should exist + + Scenario: sharing sub-folder to a custom group when the main folder is already shared with a user + Given user "Alice" has been created with default attributes and small skeleton files + And user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created a custom group called "group1" + And user "Alice" has created folder "/NEW-FOLDER" + And user "Alice" has created folder "/NEW-FOLDER/sub-folder" + And user "Alice" has shared folder "/NEW-FOLDER" with user "Brian" + When user "Alice" shares folder "/NEW-FOLDER/sub-folder" with group "customgroup_group1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: sharing sub-folder to a custom group when the main folder is already shared with a normal group + Given user "Alice" has been created with default attributes and small skeleton files + And user "Alice" has created a custom group called "group1" + And group "grp1" has been created + And user "Alice" has created folder "/NEW-FOLDER" + And user "Alice" has created folder "/NEW-FOLDER/sub-folder" + And user "Alice" has shared folder "/NEW-FOLDER" with group "grp1" + When user "Alice" shares folder "/NEW-FOLDER/sub-folder" with group "customgroup_group1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: sharing sub-folder to a user when the main folder is already shared with a custom group + Given user "Alice" has been created with default attributes and small skeleton files + And user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created a custom group called "group1" + And user "Alice" has created folder "/NEW-FOLDER" + And user "Alice" has created folder "/NEW-FOLDER/sub-folder" + And user "Alice" has shared folder "/NEW-FOLDER" with group "customgroup_group1" + When user "Alice" shares folder "/NEW-FOLDER/sub-folder" with user "Brian" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: sharing sub-folder to a normal group when the main folder is already shared with a custom group + Given user "Alice" has been created with default attributes and small skeleton files + And user "Alice" has created a custom group called "group1" + And group "grp1" has been created + And user "Alice" has created folder "/NEW-FOLDER" + And user "Alice" has created folder "/NEW-FOLDER/sub-folder" + And user "Alice" has shared folder "/NEW-FOLDER" with group "customgroup_group1" + When user "Alice" shares folder "/NEW-FOLDER/sub-folder" with group "grp1" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: Resharing a recieved share from custom group + Given user "Alice" has been created with default attributes and small skeleton files + And user "Brian" has been created with default attributes and without skeleton files + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has created a custom group called "sharing-group" + And user "ALice" has made user "Brian" a member of custom group "sharing-group" + And user "Alice" has created folder "/foldertoshare" + And user "Alice" has shared folder "/foldertoshare" with group "customgroup_sharing-group" + When user "Alice" shares folder "/foldertoshare" with user "Carol" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And as "Carol" folder "/foldertoshare" should exist