add tests for fake office

This commit is contained in:
amrita
2024-08-29 12:29:39 +05:45
parent 483924a583
commit 451f288ae3
4 changed files with 238 additions and 1 deletions

View File

@@ -0,0 +1,142 @@
Feature: check file info on wopi
As a user
I want to request file information on wopi server
So that I can make sure that the response contains all the relevant values
Background:
Given user "Alice" has been created with default attributes and without skeleton files
Scenario: check file info for fake office
Given user "Alice" has uploaded file with content "hello world" to "/textfile0.txt"
When user "Alice" request information of file "textfile0.txt" on space "Personal" for "FakeOffice"
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"BaseFileName",
"OwnerId",
"Size",
"UserId",
"Version",
"SupportsCobalt",
"SupportsContainers",
"SupportsDeleteFile",
"SupportsEcosystem",
"SupportsExtendedLockLength",
"SupportsFolders",
"SupportsGetLock",
"SupportsLocks",
"SupportsRename",
"SupportsUpdate",
"SupportsUserInfo",
"UserFriendlyName",
"ReadOnly",
"RestrictedWebViewOnly",
"UserCanAttend",
"UserCanNotWriteRelative",
"UserCanPresent",
"UserCanRename",
"UserCanWrite",
"AllowAdditionalMicrosoftServices",
"AllowExternalMarketplace",
"DisablePrint",
"DisableTranslation",
"BreadcrumbDocName"
],
"properties": {
"BaseFileName": {
"const": "textfile0.txt"
},
"OwnerId": {
"type": "string",
"pattern": "^[0-9a-fA-F]{32,}$"
},
"Size": {
"const": 11
},
"UserId": {
"type": "string",
"pattern": "^[0-9a-fA-F]{32,}$"
},
"Version": {
"type": "string",
"pattern": "^\\d{10,12}\\.\\d+$"
},
"SupportsCobalt": {
"const": false
},
"SupportsContainers": {
"const": false
},
"SupportsDeleteFile": {
"const": true
},
"SupportsEcosystem": {
"const": false
},
"SupportsExtendedLockLength": {
"const": true
},
"SupportsFolders": {
"const": false
},
"SupportsGetLock": {
"const": true
},
"SupportsLocks": {
"const": true
},
"SupportsRename": {
"const": true
},
"SupportsUpdate": {
"const": true
},
"SupportsUserInfo": {
"const": false
},
"UserFriendlyName": {
"const": "Alice Hansen"
},
"ReadOnly": {
"const": false
},
"RestrictedWebViewOnly": {
"const": false
},
"UserCanAttend": {
"const": false
},
"UserCanNotWriteRelative": {
"const": false
},
"UserCanPresent": {
"const": false
},
"UserCanRename": {
"const": true
},
"UserCanWrite": {
"const": true
},
"AllowAdditionalMicrosoftServices": {
"const": false
},
"AllowExternalMarketplace": {
"const": false
},
"DisablePrint": {
"const": false
},
"DisableTranslation": {
"const": false
},
"BreadcrumbDocName": {
"const": "textfile0.txt"
}
}
}
"""