[test-only] apiTest. check parentId in the Propfind response (#6759)

* check parentId in the Propfind response

* split test
This commit is contained in:
Viktor Scharf
2023-07-12 09:12:34 +02:00
committed by GitHub
parent 3009ea192f
commit f6e8d3ee84
2 changed files with 64 additions and 1 deletions

View File

@@ -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 | <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_permission> |
| 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 | <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_permission> |
| 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 | <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_permission> |
| oc:size | 12 |
Examples:
| role | oc_permission |
| manager | RDNVWZP |
| editor | DNVW |
| viewer | |

View File

@@ -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(),