From 79ebb82bf74f153e2e0745d9e422115aa82e1153 Mon Sep 17 00:00:00 2001 From: pradip Date: Thu, 29 Aug 2024 15:22:42 +0545 Subject: [PATCH] test: add tests for opening text file in web --- .../features/apiCollaboration/wopi.feature | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/acceptance/features/apiCollaboration/wopi.feature b/tests/acceptance/features/apiCollaboration/wopi.feature index 4e2a9106c9..d0b738f5db 100644 --- a/tests/acceptance/features/apiCollaboration/wopi.feature +++ b/tests/acceptance/features/apiCollaboration/wopi.feature @@ -277,3 +277,50 @@ Feature: collaboration (wopi) | app-endpoint | url-query | | /app/open-with-web?file_id=<>&app_name=FakeOffice | app=FakeOffice& | | /app/open-with-web?file_id=<> | | + + + Scenario: open text file using open-with-web with app name in url query (MIME type not registered in app-registry) + Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "lorem.txt" + And we save it into "FILEID" + When user "Alice" sends HTTP method "POST" to URL "/app/open-with-web?file_id=<>&app_name=FakeOffice" + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "pattern": "%base_url%/external\\?app=FakeOffice&contextRouteName=files-spaces-personal&fileId=%uuidv4_pattern%%24%uuidv4_pattern%%21%uuidv4_pattern%$" + } + } + } + """ + + @issue-9928 + Scenario: open text file using open-with-web without app name in url query (MIME type not registered in app-registry) + Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "lorem.txt" + And we save it into "FILEID" + When user "Alice" sends HTTP method "POST" to URL "/app/open-with-web?file_id=<>" + 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 contacting the requested application, please use a different one or try again later" + } + } + } + """