From f6e8d3ee84cda64769dc10c6e6f1ced6c759e99a Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Wed, 12 Jul 2023 09:12:34 +0200 Subject: [PATCH] [test-only] apiTest. check parentId in the Propfind response (#6759) * check parentId in the Propfind response * split test --- .../features/apiContract/propfind.feature | 63 +++++++++++++++++++ .../features/bootstrap/SpacesContext.php | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiContract/propfind.feature b/tests/acceptance/features/apiContract/propfind.feature index 9fc39c5606..acc5115e03 100644 --- a/tests/acceptance/features/apiContract/propfind.feature +++ b/tests/acceptance/features/apiContract/propfind.feature @@ -50,3 +50,66 @@ Feature: Propfind test | manager | RDNVCKZP | | editor | DNVCK | | viewer | | + + + Scenario Outline: space member with a different role checks the PROPFIND request of the folder in the space + Given user "Alice" has created a folder "folderMain" in space "new-space" + And user "Alice" has shared a space "new-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" sends PROPFIND request from the space "new-space" to the resource "folderMain" using the WebDAV API + Then the HTTP status code should be "207" + And the "PROPFIND" response should contain a space "new-space" with these key and value pairs: + | key | value | + | oc:fileid | UUIDof:folderMain | + | oc:file-parent | UUIDof:new-space | + | oc:name | folderMain | + | oc:permissions | | + | oc:size | 0 | + Examples: + | role | oc_permission | + | manager | RDNVCKZP | + | editor | DNVCK | + | viewer | | + + + Scenario Outline: space member with a different role checks the PROPFIND request of the sub-folder in the space + Given user "Alice" has created a folder "folderMain/subFolder1/subFolder2" in space "new-space" + And user "Alice" has shared a space "new-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" sends PROPFIND request from the space "new-space" to the resource "folderMain/subFolder1/subFolder2" using the WebDAV API + Then the HTTP status code should be "207" + And the "PROPFIND" response should contain a space "new-space" with these key and value pairs: + | key | value | + | oc:fileid | UUIDof:folderMain/subFolder1/subFolder2 | + | oc:file-parent | UUIDof:folderMain/subFolder1 | + | oc:name | subFolder2 | + | oc:permissions | | + | oc:size | 0 | + Examples: + | role | oc_permission | + | manager | RDNVCKZP | + | editor | DNVCK | + | viewer | | + + + Scenario Outline: space member with a different role checks the PROPFIND request of the file in the space + Given user "Alice" has uploaded a file inside space "new-space" with content "some content" to "testfile.txt" + And user "Alice" has shared a space "new-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" sends PROPFIND request from the space "new-space" to the resource "testfile.txt" using the WebDAV API + Then the HTTP status code should be "207" + And the "PROPFIND" response should contain a space "new-space" with these key and value pairs: + | key | value | + | oc:fileid | UUIDof:testfile.txt | + | oc:file-parent | UUIDof:new-space | + | oc:name | testfile.txt | + | oc:permissions | | + | oc:size | 12 | + Examples: + | role | oc_permission | + | manager | RDNVWZP | + | editor | DNVW | + | viewer | | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index a2a88438fb..bea2fd4c80 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -3118,7 +3118,7 @@ class SpacesContext implements Context { */ public function userSendsPropfindRequestToSpace(string $user, string $spaceName, ?string $resource = ""): void { $this->setSpaceIDByName($user, $spaceName); - $properties = ['oc:permissions','oc:fileid','oc:share-types','oc:privatelink','d:resourcetype','oc:size','oc:name','d:getcontenttype', 'oc:tags']; + $properties = ['oc:permissions','oc:file-parent','oc:fileid','oc:share-types','oc:privatelink','d:resourcetype','oc:size','oc:name','d:getcontenttype', 'oc:tags']; $this->featureContext->setResponse( WebDavHelper::propfind( $this->featureContext->getBaseUrl(),