From 5af9ff5202551e0b91ed189d098f62d7a9c3d77e Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Tue, 3 Sep 2024 09:55:40 +0545 Subject: [PATCH] added test to create .odt file inside shared folder --- .../features/apiCollaboration/wopi.feature | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiCollaboration/wopi.feature b/tests/acceptance/features/apiCollaboration/wopi.feature index 4bb012da282..d2d5b916b73 100644 --- a/tests/acceptance/features/apiCollaboration/wopi.feature +++ b/tests/acceptance/features/apiCollaboration/wopi.feature @@ -825,7 +825,7 @@ Feature: collaboration (wopi) | Manager | - Scenario: user with Viewer role tries to create a text file inside shared project space using wopi endpoint + Scenario: user with Viewer role tries to create a odt file inside shared project space using wopi endpoint 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 "new-space" with the default quota using the Graph API @@ -859,3 +859,68 @@ Feature: collaboration (wopi) | simple.odt | And for user "Brian" folder "testFolder" of the space "new-space" should not contain these files: | simple.odt | + + + Scenario Outline: sharee with permission Editor/Uploader creates odt file inside shared folder using wopi endpoint + Given user "Alice" has created folder "testFolder" + And user "Alice" has sent the following resource share invitation: + | resource | testFolder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + When user "Brian" creates a file "simple.odt" inside folder "testFolder" in space "Shares" using wopi endpoint + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "file_id" + ], + "properties": { + "file_id": { + "type": "string", + "pattern": "^%file_id_pattern%$" + } + } + } + """ + And as "Alice" file "testFolder/simple.odt" should exist + And as "Brian" file "Shares/testFolder/simple.odt" should exist + Examples: + | permissions-role | + | Editor | + | Uploader | + + + Scenario: sharee with permission Viewer tries to create odt file inside shared folder using wopi endpoint + Given user "Alice" has created folder "testFolder" + And user "Alice" has sent the following resource share invitation: + | resource | testFolder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + When user "Brian" tries to create a file "simple.odt" inside folder "testFolder" in space "Shares" using wopi endpoint + Then the HTTP status code should be "500" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "const": "SERVER_ERROR" + }, + "message": { + "const": "error calling InitiateFileUpload" + } + } + } + """ + And as "Alice" file "testFolder/simple.odt" should not exist + And as "Brian" file "Shares/testFolder/simple.odt" should not exist