From b36043488cf0c5ef7ab4ef3caa8774f68178b4e1 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Mon, 18 Mar 2024 15:48:31 +0545 Subject: [PATCH 1/2] Added PROPFIND tests as sharee with new davpath --- .../acceptance/features/apiCors/cors.feature | 1 + .../apiSharingNg/propfindShares.feature | 43 ++++++++++++++++++- .../features/bootstrap/SpacesContext.php | 7 +-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/features/apiCors/cors.feature b/tests/acceptance/features/apiCors/cors.feature index acc8dd4900..b6135b52b8 100644 --- a/tests/acceptance/features/apiCors/cors.feature +++ b/tests/acceptance/features/apiCors/cors.feature @@ -83,6 +83,7 @@ Feature: CORS headers @issue-8231 Scenario: CORS headers should be returned when setting CORS domain sending origin header in the Webdav api + Given using spaces DAV path When user "Alice" sends PROPFIND request to space "Alice Hansen" with headers using the WebDAV API | header | value | | Origin | https://aphno.badal | diff --git a/tests/acceptance/features/apiSharingNg/propfindShares.feature b/tests/acceptance/features/apiSharingNg/propfindShares.feature index 5897c8040b..70c54f16f2 100644 --- a/tests/acceptance/features/apiSharingNg/propfindShares.feature +++ b/tests/acceptance/features/apiSharingNg/propfindShares.feature @@ -12,7 +12,8 @@ Feature: propfind a shares @issue-4421 Scenario Outline: sharee PROPFIND same name shares shared by multiple users - Given user "Alice" has uploaded file with content "to share" to "textfile.txt" + Given using spaces DAV path + And user "Alice" has uploaded file with content "to share" to "textfile.txt" And user "Alice" has created folder "folderToShare" And user "Carol" has uploaded file with content "to share" to "textfile.txt" And user "Carol" has created folder "folderToShare" @@ -45,3 +46,43 @@ Feature: propfind a shares | path | path2 | | textfile.txt | textfile (1).txt | | folderToShare | folderToShare (1) | + + @issue-4421 + Scenario Outline: sharee PROPFIND same name shares shared by multiple users using new dav path + Given using new DAV path + And user "Alice" has uploaded file with content "to share" to "textfile.txt" + And user "Alice" has created folder "folderToShare" + And user "Carol" has uploaded file with content "to share" to "textfile.txt" + And user "Carol" has created folder "folderToShare" + And user "Alice" has sent the following share invitation: + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Carol" has sent the following share invitation: + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + When user "Brian" sends PROPFIND request from the space "Shares" to the resource "Shares" using the WebDAV API + Then the HTTP status code should be "207" + And the "PROPFIND" response to user "Brian" should contain a space "Shares" with these key and value pairs: + | key | value | + | oc:fileid | UUIDof:Shares | + | oc:name | Shares | + And the "PROPFIND" response to user "Brian" should contain a mountpoint "Shares" with these key and value pairs: + | key | value | + | oc:fileid | UUIDof: | + | oc:name | | + | oc:permissions | SR | + And the "PROPFIND" response to user "Brian" should contain a mountpoint "Shares" with these key and value pairs: + | key | value | + | oc:fileid | UUIDof: | + | oc:name | | + | oc:permissions | SR | + Examples: + | path | path2 | + | textfile.txt | textfile (1).txt | + | folderToShare | folderToShare (1) | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 4ec063d2df..d797366612 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -3617,11 +3617,12 @@ class SpacesContext implements Context { /** * @When /^user "([^"]*)" sends PROPFIND request from the space "([^"]*)" to the resource "([^"]*)" with depth "([^"]*)" using the WebDAV API$/ + * @When user :user sends PROPFIND request from the space :spaceName to the resource :resource using the WebDAV API * * @param string $user * @param string $spaceName * @param string $resource - * @param string $folderDepth + * @param string|null $folderDepth * * @return void * @@ -3629,7 +3630,7 @@ class SpacesContext implements Context { * * @throws GuzzleException */ - public function userSendsPropfindRequestFromTheSpaceToTheResourceWithDepthUsingTheWebdavApi(string $user, string $spaceName, string $resource, string $folderDepth): void { + public function userSendsPropfindRequestFromTheSpaceToTheResourceWithDepthUsingTheWebdavApi(string $user, string $spaceName, string $resource, ?string $folderDepth = "1"): void { $this->featureContext->setResponse( $this->sendPropfindRequestToSpace($user, $spaceName, $resource, null, $folderDepth) ); @@ -3705,7 +3706,7 @@ class SpacesContext implements Context { $this->featureContext->getStepLineRef(), $folderDepth, "files", - WebDavHelper::DAV_VERSION_SPACES, + $this->featureContext->getDavPathVersion(), null, $headers ); From d79af6896898348a072c91c6dee2c350f8b9143f Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Tue, 19 Mar 2024 15:14:52 +0545 Subject: [PATCH 2/2] Added PROPFIND tests as sharee with old davpath --- .../apiSharingNg/propfindShares.feature | 80 ++++++++++--------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/tests/acceptance/features/apiSharingNg/propfindShares.feature b/tests/acceptance/features/apiSharingNg/propfindShares.feature index 70c54f16f2..8a8188f170 100644 --- a/tests/acceptance/features/apiSharingNg/propfindShares.feature +++ b/tests/acceptance/features/apiSharingNg/propfindShares.feature @@ -18,54 +18,54 @@ Feature: propfind a shares And user "Carol" has uploaded file with content "to share" to "textfile.txt" And user "Carol" has created folder "folderToShare" And user "Alice" has sent the following share invitation: - | resource | | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | And user "Carol" has sent the following share invitation: - | resource | | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | When user "Brian" sends PROPFIND request to space "Shares" using the WebDAV API Then the HTTP status code should be "207" And the "PROPFIND" response to user "Brian" should contain a space "Shares" with these key and value pairs: | key | value | | oc:fileid | UUIDof:Shares | And the "PROPFIND" response to user "Brian" should contain a mountpoint "Shares" with these key and value pairs: - | key | value | - | oc:name | | - | oc:permissions | SR | + | key | value | + | oc:name | | + | oc:permissions | SR | And the "PROPFIND" response to user "Brian" should contain a mountpoint "Shares" with these key and value pairs: - | key | value | - | oc:name | | - | oc:permissions | SR | + | key | value | + | oc:name | | + | oc:permissions | SR | Examples: - | path | path2 | + | resource | resource-2 | | textfile.txt | textfile (1).txt | | folderToShare | folderToShare (1) | @issue-4421 Scenario Outline: sharee PROPFIND same name shares shared by multiple users using new dav path - Given using new DAV path + Given using DAV path And user "Alice" has uploaded file with content "to share" to "textfile.txt" And user "Alice" has created folder "folderToShare" And user "Carol" has uploaded file with content "to share" to "textfile.txt" And user "Carol" has created folder "folderToShare" And user "Alice" has sent the following share invitation: - | resource | | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | And user "Carol" has sent the following share invitation: - | resource | | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | When user "Brian" sends PROPFIND request from the space "Shares" to the resource "Shares" using the WebDAV API Then the HTTP status code should be "207" And the "PROPFIND" response to user "Brian" should contain a space "Shares" with these key and value pairs: @@ -73,16 +73,18 @@ Feature: propfind a shares | oc:fileid | UUIDof:Shares | | oc:name | Shares | And the "PROPFIND" response to user "Brian" should contain a mountpoint "Shares" with these key and value pairs: - | key | value | - | oc:fileid | UUIDof: | - | oc:name | | - | oc:permissions | SR | + | key | value | + | oc:fileid | UUIDof: | + | oc:name | | + | oc:permissions | SR | And the "PROPFIND" response to user "Brian" should contain a mountpoint "Shares" with these key and value pairs: - | key | value | - | oc:fileid | UUIDof: | - | oc:name | | - | oc:permissions | SR | + | key | value | + | oc:fileid | UUIDof: | + | oc:name | | + | oc:permissions | SR | Examples: - | path | path2 | - | textfile.txt | textfile (1).txt | - | folderToShare | folderToShare (1) | + | dav-path-version | resource | resource-2 | + | old | textfile.txt | textfile (1).txt | + | old | folderToShare | folderToShare (1) | + | new | textfile.txt | textfile (1).txt | + | new | folderToShare | folderToShare (1) |