add test for template

This commit is contained in:
amrita
2024-11-28 10:44:44 +05:45
parent 46d397d74f
commit 62b314dc91
5 changed files with 139 additions and 1 deletions
@@ -1862,3 +1862,19 @@ Feature: check file info with different wopi apps
Then the HTTP status code should be "200"
And the response should not contain the following MIME types:
| application/octet-stream |
Scenario: check that '/app/list' contain WebOffice template
When user "Alice" sends HTTP method "GET" to URL "/app/list"
Then the HTTP status code should be "200"
And the app list response should contain the following information:
| mimeType | onlyOffice | collabora |
| application/vnd.ms-powerpoint.template.macroenabled.12 | pptx | |
| application/vnd.oasis.opendocument.presentation-template | pptx | odp |
| application/vnd.openxmlformats-officedocument.spreadsheetml.template | xlsx | |
| application/vnd.oasis.opendocument.spreadsheet-template | xlsx | ods |
| application/vnd.openxmlformats-officedocument.presentationml.template | pptx | |
| application/vnd.openxmlformats-officedocument.wordprocessingml.template | docx | |
| application/vnd.ms-word.template.macroenabled.12 | docx | |
| application/vnd.oasis.opendocument.text-template | docx | odt |
| application/vnd.ms-excel.template.macroenabled.12 | xlsx | |
@@ -1080,3 +1080,51 @@ Feature: collaboration (wopi)
"""
And for user "Alice" folder "testFolder" of the space "new-space" should not contain these files:
| simple.odt |
Scenario Outline: open file with .potx extension and template
Given user "Alice" has uploaded file "filesForUpload/template.xltx" to "template.xltx"
And we save it into "TEMPLATEID"
And user "Alice" has created a file "template.pptx" in space "Personal" using wopi endpoint
And we save it into "FILEID"
When user "Alice" sends HTTP method "POST" to URL "<app-endpoint>"
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=<<FILEID>>&app_name=Collabora&view_mode=write&template_id=<<TEMPLATEID>> |
| /app/open?file_id=<<FILEID>>&app_name=OnlyOffice&view_mode=write&template_id=<<TEMPLATEID>> |