From 532ad683d5cdc463f1f81a1ef02c81a251a680a1 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Mon, 26 Aug 2024 11:39:02 +0545 Subject: [PATCH 1/2] added test for sharee to open file with /app/open endpoint --- tests/acceptance/config/behat.yml | 1 + .../features/apiCollaboration/wopi.feature | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 930e5861a5c..cb61eb29e4c 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -406,6 +406,7 @@ default: context: *common_ldap_suite_context contexts: - FeatureContext: *common_feature_context_params + - SharingNgContext: cliCommands: paths: diff --git a/tests/acceptance/features/apiCollaboration/wopi.feature b/tests/acceptance/features/apiCollaboration/wopi.feature index 6cefb26130e..d434302ad97 100644 --- a/tests/acceptance/features/apiCollaboration/wopi.feature +++ b/tests/acceptance/features/apiCollaboration/wopi.feature @@ -118,3 +118,56 @@ Feature: collaboration (wopi) } } """ + + + Scenario Outline: sharee open file with .odt extension + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file "filesForUpload/simple.odt" to "simple.odt" + And we save it into "FILEID" + And user "Alice" has sent the following resource share invitation: + | resource | simple.odt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + When user "Brian" sends HTTP method "POST" to URL "" + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "app_url", + "method", + "form_parameters" + ], + "properties": { + "app_url": { + "type": "string", + "pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}$" + }, + "method": { + "const": "POST" + }, + "form_parameters": { + "type": "object", + "required": [ + "access_token", + "access_token_ttl" + ], + "properties": { + "access_token": { + "type": "string" + }, + "access_token_ttl": { + "type": "string" + } + } + } + } + } + """ + Examples: + | app-endpoint | + | /app/open?file_id=<>&app_name=FakeOffice | + | /app/open?file_id=<> | From 326663509dbb40b5799893c5f0578382bb41db74 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Wed, 28 Aug 2024 15:34:50 +0545 Subject: [PATCH 2/2] add issue tag --- tests/acceptance/features/apiCollaboration/wopi.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiCollaboration/wopi.feature b/tests/acceptance/features/apiCollaboration/wopi.feature index d434302ad97..6a468332ff2 100644 --- a/tests/acceptance/features/apiCollaboration/wopi.feature +++ b/tests/acceptance/features/apiCollaboration/wopi.feature @@ -94,7 +94,7 @@ Feature: collaboration (wopi) } """ - + @issue-9928 Scenario: open text file 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"