From 0011a9b1f21d7d3e31d2ffb0a2a912eb0a242eae Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Wed, 22 May 2024 14:34:53 +0545 Subject: [PATCH] adding test for deleting/removing share link of file and folder in project space using permission endpoint --- ...ected-failures-localAPI-on-OCIS-storage.md | 28 +++++++++---------- .../apiSharingNgLinkShare/linkShare.feature | 13 +++++++++ .../features/bootstrap/SharingNgContext.php | 12 ++++++++ 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 0b26f91ac06..7abefd3dd1b 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -242,26 +242,26 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSharingNgLinkShare/linkShare.feature:544](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L544) - [apiSharingNgLinkShare/linkShare.feature:545](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L545) - [apiSharingNgLinkShare/linkShare.feature:611](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L611) -- [apiSharingNgLinkShare/linkShare.feature:958](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L958) -- [apiSharingNgLinkShare/linkShare.feature:1104](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1104) -- [apiSharingNgLinkShare/linkShare.feature:1160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1160) +- [apiSharingNgLinkShare/linkShare.feature:959](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L959) +- [apiSharingNgLinkShare/linkShare.feature:1105](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1105) - [apiSharingNgLinkShare/linkShare.feature:1161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1161) - [apiSharingNgLinkShare/linkShare.feature:1162](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1162) -- [apiSharingNgLinkShare/linkShare.feature:1267](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1267) -- [apiSharingNgLinkShare/linkShare.feature:1333](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1333) -- [apiSharingNgLinkShare/linkShare.feature:1477](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1477) -- [apiSharingNgLinkShare/linkShare.feature:1546](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1546) -- [apiSharingNgLinkShare/linkShare.feature:1596](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1596) +- [apiSharingNgLinkShare/linkShare.feature:1163](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1163) +- [apiSharingNgLinkShare/linkShare.feature:1268](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1268) +- [apiSharingNgLinkShare/linkShare.feature:1334](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1334) +- [apiSharingNgLinkShare/linkShare.feature:1478](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1478) +- [apiSharingNgLinkShare/linkShare.feature:1547](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1547) - [apiSharingNgLinkShare/linkShare.feature:1597](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1597) - [apiSharingNgLinkShare/linkShare.feature:1598](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1598) -- [apiSharingNgLinkShare/linkShare.feature:1837](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1837) -- [apiSharingNgLinkShare/linkShare.feature:1977](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1977) -- [apiSharingNgLinkShare/linkShare.feature:2031](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2031) +- [apiSharingNgLinkShare/linkShare.feature:1599](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1599) +- [apiSharingNgLinkShare/linkShare.feature:1838](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1838) +- [apiSharingNgLinkShare/linkShare.feature:1978](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L1978) - [apiSharingNgLinkShare/linkShare.feature:2032](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2032) - [apiSharingNgLinkShare/linkShare.feature:2033](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2033) -- [apiSharingNgLinkShare/linkShare.feature:2101](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2101) -- [apiSharingNgLinkShare/linkShare.feature:2168](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2168) -- [apiSharingNgLinkShare/linkShare.feature:2239](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2239) +- [apiSharingNgLinkShare/linkShare.feature:2034](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2034) +- [apiSharingNgLinkShare/linkShare.feature:2102](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2102) +- [apiSharingNgLinkShare/linkShare.feature:2169](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2169) +- [apiSharingNgLinkShare/linkShare.feature:2240](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2240) - [apiSharingNg/removeAccessToDriveItem.feature:125](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L125) - [apiSharingNg/removeAccessToDriveItem.feature:141](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L141) - [apiSharingNg/removeAccessToDriveItem.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L161) diff --git a/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature b/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature index f0b894ef730..e7221b0779e 100644 --- a/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature +++ b/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature @@ -769,6 +769,7 @@ Feature: Create a share link for a resource """ And the public should be able to download file "textfile1.txt" from the last link share with password "%public%" and the content should be "other data" + Scenario: update password of a file's link share Given user "Alice" has uploaded file with content "other data" to "textfile1.txt" And user "Alice" has created the following resource link share: @@ -2300,3 +2301,15 @@ Feature: Create a share link for a resource """ And the public should be able to download file "textfile.txt" from the last link share with password "%public%" and the content should be "to share" And the public download of file "textfile.txt" from the last link share with password "$heLlo*1234*" should fail with HTTP status code "401" using shareNg + + + Scenario: remove link share of a project drive + Given using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "projectSpace" with the default quota using the Graph API + And user "Alice" has created the following space link share: + | space | projectSpace | + | permissionsRole | view | + | password | $heLlo*1234* | + When user "Alice" deletes the last link share of space "projectSpace" using permissions endpoint of the Graph API + Then the HTTP status code should be "204" \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index f3ab0a013ad..bdd1f7824d2 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -1556,4 +1556,16 @@ public function userTriesToListThePermissionsOfSpaceOwnedByUsingRootEndpointOfTh ); $this->featureContext->setResponse($response); } + + /** + * @When user :user deletes the last link share of space :space using permissions endpoint of the Graph API + * + * @param string $user + * @param string $space + * + * @return void + */ + public function userDeletsTheLinkShare(string $user, string $space):void { + $this->featureContext->setResponse($this->removeAccessToSpaceItem($user, 'link', $space, '')); + } }