2024-08-26 16:37:50 +05:45
Feature: collaboration (wopi)
2024-08-23 11:36:51 +05:45
As a user
I want to access files with collaboration service apps
2024-08-26 10:00:58 +05:45
So that I can collaborate with other users
2024-08-21 16:44:55 +05:45
2024-08-23 16:14:29 +05:45
Background:
2024-11-29 09:39:21 +05:45
Given these users have been created with default attributes:
2024-08-29 16:07:49 +05:45
| username |
| Alice |
| Brian |
2024-08-23 16:14:29 +05:45
2024-08-21 16:44:55 +05:45
2024-08-26 16:37:50 +05:45
Scenario Outline: open file with .odt extension
2024-08-23 16:14:29 +05:45
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
2024-08-23 11:36:51 +05:45
And we save it into " FILEID "
2024-08-23 11:57:49 +05:45
When user " Alice " sends HTTP method " POST " to URL " <app-endpoint> "
2024-08-21 16:44:55 +05:45
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",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-08-21 16:44:55 +05:45
},
"method": {
"const": "POST"
},
"form_parameters": {
"type": "object",
"required": [
"access_token",
"access_token_ttl"
],
"properties": {
"access_token": {
"type": "string"
},
"access_token_ttl": {
"type": "string"
}
}
}
}
}
"""
2024-08-23 11:36:51 +05:45
Examples:
2024-08-23 11:57:49 +05:45
| app-endpoint |
2024-08-23 11:36:51 +05:45
| /app/open?file_id= <<FILEID> >&app_name=FakeOffice |
| /app/open?file_id= <<FILEID> > |
2024-08-23 16:14:29 +05:45
Scenario: open text file 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?file_id= <<FILEID> >&app_name=FakeOffice "
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",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-08-23 16:14:29 +05:45
},
"method": {
"const": "POST"
},
"form_parameters": {
"type": "object",
"required": [
"access_token",
"access_token_ttl"
],
"properties": {
"access_token": {
"type": "string"
},
"access_token_ttl": {
"type": "string"
}
}
}
}
}
"""
2025-11-10 08:09:32 +01:00
2024-09-05 15:09:53 +05:45
Scenario: user tries to open text file without app name in url query (MIME type not registered in app-registry)
2024-08-23 16:14:29 +05:45
Given user " Alice " has uploaded file " filesForUpload/lorem.txt " to " lorem.txt "
And we save it into " FILEID "
2024-09-05 15:09:53 +05:45
When user " Alice " tries to send HTTP method " POST " to URL " /app/open?file_id= <<FILEID> > "
2025-11-10 08:09:32 +01:00
Then the HTTP status code should be " 200 "
2024-08-23 16:14:29 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
2025-11-10 08:09:32 +01:00
"app_url",
"method",
"form_parameters"
2024-08-23 16:14:29 +05:45
],
"properties": {
2025-11-10 08:09:32 +01:00
"app_url": {
"type": "string",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-08-23 16:14:29 +05:45
},
2025-11-10 08:09:32 +01:00
"method": {
"const": "POST"
},
"form_parameters": {
"type": "object",
"required": [
"access_token",
"access_token_ttl"
],
"properties": {
"access_token": {
"type": "string"
},
"access_token_ttl": {
"type": "string"
}
}
2024-08-23 16:14:29 +05:45
}
}
}
"""
2024-08-26 11:39:02 +05:45
Scenario Outline: sharee open file with .odt extension
2024-08-29 16:07:49 +05:45
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
2024-08-26 11:39:02 +05:45
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 " <app-endpoint> "
Then the HTTP status code should be " 200 "
And the JSON data of the response should match
2024-08-27 14:29:41 +05:45
"""
{
"type": "object",
"required": [
"app_url",
"method",
"form_parameters"
],
"properties": {
"app_url": {
"type": "string",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-08-27 14:29:41 +05:45
},
"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=FakeOffice |
| /app/open?file_id= <<FILEID> > |
Scenario Outline: public user opens file with .odt extension
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And we save it into " FILEID "
And user " Alice " has created the following resource link share:
| resource | simple.odt |
| space | Personal |
2025-01-10 12:20:47 +05:45
| permissionsRole | View |
2024-08-27 14:29:41 +05:45
| password | %public% |
When the public sends HTTP method " POST " to URL " <app-endpoint> " with password " %public% "
Then the HTTP status code should be " 200 "
And the JSON data of the response should match
2024-08-26 11:39:02 +05:45
"""
{
"type": "object",
"required": [
"app_url",
"method",
"form_parameters"
],
"properties": {
"app_url": {
"type": "string",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-08-26 11:39:02 +05:45
},
"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=FakeOffice |
| /app/open?file_id= <<FILEID> > |
2024-08-27 14:44:52 +05:45
@issue-9928
2024-09-05 15:09:53 +05:45
Scenario Outline: user tries to open unsupported file format
2024-08-27 14:44:52 +05:45
Given user " Alice " has uploaded file " filesForUpload/simple.pdf " to " simple.pdf "
And we save it into " FILEID "
2025-11-10 08:09:32 +01:00
When user " Alice " tries to send HTTP method " POST " to URL " /app/open?file_id= <<FILEID> >&app_name=FakeOffice "
2024-08-27 14:44:52 +05:45
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"
}
}
}
"""
2024-08-27 14:49:59 +05:45
2024-09-05 15:09:53 +05:45
Scenario Outline: user tries to open deleted file
2024-08-27 14:49:59 +05:45
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And we save it into " FILEID "
And user " Alice " has deleted file " /simple.odt "
2024-09-05 15:09:53 +05:45
When user " Alice " tries to send HTTP method " POST " to URL " <app-endpoint> "
2024-08-27 14:49:59 +05:45
Then the HTTP status code should be " 404 "
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"const": "RESOURCE_NOT_FOUND"
},
"message": {
"const": "file does not exist"
}
}
}
"""
Examples:
| app-endpoint |
| /app/open?file_id= <<FILEID> >&app_name=FakeOffice |
| /app/open?file_id= <<FILEID> > |
2024-08-28 15:32:20 +05:45
2024-09-02 09:58:37 +05:45
Scenario Outline: open file with .odt extension with different view mode
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
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",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-09-02 09:58:37 +05:45
},
"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=FakeOffice&view_mode=view |
| /app/open?file_id= <<FILEID> >&app_name=FakeOffice&view_mode=read |
| /app/open?file_id= <<FILEID> >&app_name=FakeOffice&view_mode=write |
2024-08-28 15:32:20 +05:45
@issue-9495
Scenario Outline: open file with .odt extension (open-with-web)
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
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": [
"uri"
],
"properties": {
"uri": {
"type": "string",
"pattern": "%base_url%/external\\? <url-query> contextRouteName=files-spaces-personal&fileId=%uuidv4_pattern%%24%uuidv4_pattern%%21%uuidv4_pattern%$"
}
}
}
"""
Examples:
2026-03-03 16:49:43 +05:45
| app-endpoint | url-query |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice | app=FakeOffice& |
| /app/open-with-web?file_id= <<FILEID> > | app=(FakeOffice\|Collabora\|OnlyOffice)& |
2024-08-29 15:22:42 +05:45
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= <<FILEID> >&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%$"
}
}
}
"""
2025-11-10 08:09:32 +01:00
2024-09-05 15:09:53 +05:45
Scenario: user tries to open text file using open-with-web without app name in url query (MIME type not registered in app-registry)
2024-08-29 15:22:42 +05:45
Given user " Alice " has uploaded file " filesForUpload/lorem.txt " to " lorem.txt "
And we save it into " FILEID "
2024-09-05 15:09:53 +05:45
When user " Alice " tries to send HTTP method " POST " to URL " /app/open-with-web?file_id= <<FILEID> > "
2025-11-10 08:09:32 +01:00
Then the HTTP status code should be " 200 "
2024-08-29 15:22:42 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
2025-11-10 08:09:32 +01:00
"uri"
2024-08-29 15:22:42 +05:45
],
"properties": {
2025-11-10 08:09:32 +01:00
"uri": {
"type": "string",
2026-03-03 16:49:43 +05:45
"pattern": "%base_url%/external\\?app=(FakeOffice|Collabora|OnlyOffice)&contextRouteName=files-spaces-personal&fileId=%uuidv4_pattern%%24%uuidv4_pattern%%21%uuidv4_pattern%$"
2024-08-29 15:22:42 +05:45
}
}
}
"""
2024-09-03 10:38:47 +05:45
Scenario Outline: public user opens file with .odt extension (open-with-web)
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And we save it into " FILEID "
And user " Alice " has created the following resource link share:
| resource | simple.odt |
| space | Personal |
2025-01-10 12:20:47 +05:45
| permissionsRole | View |
2024-09-03 10:38:47 +05:45
| password | %public% |
When the public sends HTTP method " POST " to URL " <app-endpoint> " with password " %public% "
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\\? <url-query> contextRouteName=files-spaces-personal&fileId=%uuidv4_pattern%%24%uuidv4_pattern%%21%uuidv4_pattern%$"
}
}
}
"""
Examples:
2026-03-03 16:49:43 +05:45
| app-endpoint | url-query |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice | app=FakeOffice& |
| /app/open-with-web?file_id= <<FILEID> > | app=(FakeOffice\|Collabora\|OnlyOffice)& |
2024-08-29 16:07:49 +05:45
Scenario Outline: sharee open file with .odt extension (open-with-web)
Given 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 " <app-endpoint> "
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\\? <url-query> contextRouteName=files-spaces-personal&fileId=%uuidv4_pattern%%24%uuidv4_pattern%%21%uuidv4_pattern%$"
}
}
}
"""
Examples:
2026-03-03 16:49:43 +05:45
| app-endpoint | url-query |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice | app=FakeOffice& |
| /app/open-with-web?file_id= <<FILEID> > | app=(FakeOffice\|Collabora\|OnlyOffice)& |
2024-09-03 12:13:00 +05:45
Scenario Outline: open file with .odt extension with different view mode (open-with-web)
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
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": [
"uri"
],
"properties": {
"uri": {
"type": "string",
"pattern": "%base_url%/external\\?app=FakeOffice&contextRouteName=files-spaces-personal&fileId=%uuidv4_pattern%%24%uuidv4_pattern%%21%uuidv4_pattern%$"
}
}
}
"""
Examples:
| app-endpoint |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice&view_mode=view |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice&view_mode=read |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice&view_mode=write |
2024-09-05 14:47:07 +05:45
@issue-9928
2024-09-05 15:09:53 +05:45
Scenario Outline: user tries to open unsupported file format (open-with-web)
2024-09-05 14:47:07 +05:45
Given user " Alice " has uploaded file " filesForUpload/simple.pdf " to " simple.pdf "
And we save it into " FILEID "
2025-11-10 08:09:32 +01:00
When user " Alice " tries to send HTTP method " POST " to URL " /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice "
2024-09-05 14:47:07 +05:45
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"
}
}
}
"""
2024-09-05 15:09:53 +05:45
Scenario Outline: user tries to open deleted file (open-with-web)
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And we save it into " FILEID "
And user " Alice " has deleted file " /simple.odt "
When user " Alice " tries to send HTTP method " POST " to URL " <app-endpoint> "
Then the HTTP status code should be " 404 "
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"const": "RESOURCE_NOT_FOUND"
},
"message": {
"const": "file does not exist"
}
}
}
"""
Examples:
| app-endpoint |
| /app/open-with-web?file_id= <<FILEID> >&app_name=FakeOffice |
| /app/open-with-web?file_id= <<FILEID> > |
2024-09-02 14:52:36 +05:45
Scenario: create a text file using wopi endpoint in Personal space
Given user " Alice " has created folder " testFolder "
When user " Alice " creates a file " testfile.txt " inside folder " testFolder " in space " Personal " 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/testfile.txt " should exist
Scenario Outline: sharee with permission Editor/Uploader creates text file inside shared folder
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 | <permissions-role> |
When user " Brian " creates a file " testFile.txt " 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/testFile.txt " should exist
And as " Brian " file " Shares/testFolder/testFile.txt " should exist
Examples:
| permissions-role |
| Editor |
| Uploader |
2024-09-27 12:14:11 +05:45
@issue-10126
2024-09-02 14:52:36 +05:45
Scenario: sharee with permission Viewer tries to create text file inside shared folder
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 " testFile.txt " inside folder " testFolder " in space " Shares " using wopi endpoint
2024-09-24 12:41:44 +02:00
Then the HTTP status code should be " 403 "
2024-09-25 17:14:11 +02:00
And the JSON data of the response should match
2024-09-02 14:52:36 +05:45
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
2024-09-24 12:41:44 +02:00
"const": "PERMISSION_DENIED"
2024-09-02 14:52:36 +05:45
},
"message": {
2024-09-24 12:41:44 +02:00
"const": "permission denied to create the file"
2024-09-02 14:52:36 +05:45
}
}
}
"""
And as " Alice " file " testFolder/testFile.txt " should not exist
And as " Brian " file " Shares/testFolder/testFile.txt " should not exist
Scenario: space admin creates a text file in 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
And user " Alice " has created a folder " testFolder " in space " new-space "
When user " Alice " creates a file " testFile.txt " inside folder " testFolder " in space " new-space " 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 for user " Alice " folder " testFolder " of the space " new-space " should contain these files:
| testFile.txt |
Scenario Outline: user with Space Editor/Manager role creates a text 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
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user " Brian " creates a file " testFile.txt " inside folder " testFolder " in space " new-space " 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 for user " Alice " folder " testFolder " of the space " new-space " should contain these files:
| testFile.txt |
And for user " Brian " folder " testFolder " of the space " new-space " should contain these files:
| testFile.txt |
Examples:
| permissions-role |
| Space Editor |
| Manager |
2024-09-27 12:14:11 +05:45
@issue-10126
2024-09-02 14:52:36 +05:45
Scenario: user with Viewer role tries to create a text 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
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user " Brian " tries to create a file " testFile.txt " inside folder " testFolder " in space " new-space " using wopi endpoint
2024-09-24 12:41:44 +02:00
Then the HTTP status code should be " 403 "
2024-09-02 14:52:36 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
2024-09-24 12:41:44 +02:00
"const": "PERMISSION_DENIED"
2024-09-02 14:52:36 +05:45
},
"message": {
2024-09-24 12:41:44 +02:00
"const": "permission denied to create the file"
2024-09-02 14:52:36 +05:45
}
}
}
"""
And for user " Alice " folder " testFolder " of the space " new-space " should not contain these files:
| testFile.txt |
And for user " Brian " folder " testFolder " of the space " new-space " should not contain these files:
| testFile.txt |
2024-09-02 16:42:05 +05:45
Scenario: create a odt file using app endpoint in Personal space
Given user " Alice " has created folder " testFolder "
When user " Alice " creates a file " simple.odt " inside folder " testFolder " in space " Personal " 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
Scenario: space admin creates a odt file in 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
And user " Alice " has created a folder " testFolder " in space " new-space "
When user " Alice " creates a file " simple.odt " inside folder " testFolder " in space " new-space " 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 for user " Alice " folder " testFolder " of the space " new-space " should contain these files:
| simple.odt |
Scenario Outline: user with Space Editor/Manager role creates 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
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user " Brian " creates a file " simple.odt " inside folder " testFolder " in space " new-space " 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 for user " Alice " folder " testFolder " of the space " new-space " should contain these files:
| simple.odt |
And for user " Brian " folder " testFolder " of the space " new-space " should contain these files:
| simple.odt |
Examples:
| permissions-role |
| Space Editor |
| Manager |
2024-09-27 12:14:11 +05:45
@issue-10126
2024-09-03 09:55:40 +05:45
Scenario: user with Viewer role tries to create a odt file inside shared project space using wopi endpoint
2024-09-02 16:42:05 +05:45
Given using spaces DAV path
And the administrator has assigned the role " Space Admin " to user " Alice " using the Graph API
2026-08-14 12:11:34 +05:45
And user " Alice " has created a space " new-space " with retry with the default quota using the Graph API
2024-09-02 16:42:05 +05:45
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user " Brian " tries to create a file " simple.odt " inside folder " testFolder " in space " new-space " using wopi endpoint
2024-09-24 12:41:44 +02:00
Then the HTTP status code should be " 403 "
2024-09-02 16:42:05 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
2024-09-24 12:41:44 +02:00
"const": "PERMISSION_DENIED"
2024-09-02 16:42:05 +05:45
},
"message": {
2024-09-24 12:41:44 +02:00
"const": "permission denied to create the file"
2024-09-02 16:42:05 +05:45
}
}
}
"""
And for user " Alice " folder " testFolder " of the space " new-space " should not contain these files:
| simple.odt |
And for user " Brian " folder " testFolder " of the space " new-space " should not contain these files:
| simple.odt |
2024-09-03 09:55:40 +05:45
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 | <permissions-role> |
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 |
2024-09-27 12:14:11 +05:45
@issue-10126
2024-09-03 09:55:40 +05:45
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
2024-09-24 12:41:44 +02:00
Then the HTTP status code should be " 403 "
2024-09-03 09:55:40 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
2024-09-24 12:41:44 +02:00
"const": "PERMISSION_DENIED"
2024-09-03 09:55:40 +05:45
},
"message": {
2024-09-24 12:41:44 +02:00
"const": "permission denied to create the file"
2024-09-03 09:55:40 +05:45
}
}
}
"""
And as " Alice " file " testFolder/simple.odt " should not exist
And as " Brian " file " Shares/testFolder/simple.odt " should not exist
2024-09-17 09:43:45 +05:45
2025-09-19 17:19:34 +02:00
2024-09-17 09:43:45 +05:45
Scenario Outline: public user with permission edit/upload/createOnly creates odt file inside public folder using wopi endpoint
Given user " Alice " has created folder " publicFolder "
And user " Alice " has created the following resource link share:
| resource | publicFolder |
| space | Personal |
| permissionsRole | <permissions-role> |
| password | %public% |
When the public creates a file " simple.odt " inside the last shared public link folder with password " %public% " 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 " publicFolder/simple.odt " should exist
Examples:
| permissions-role |
2025-01-10 12:20:47 +05:45
| Edit |
| Upload |
| File Drop |
2024-09-17 09:43:45 +05:45
2025-09-19 16:15:07 +02:00
@issue-10126
2024-09-17 09:43:45 +05:45
Scenario: public user with permission view tries to creates odt file inside public folder using wopi endpoint
Given user " Alice " has created folder " publicFolder "
And user " Alice " has created the following resource link share:
| resource | publicFolder |
| space | Personal |
2025-01-10 12:20:47 +05:45
| permissionsRole | View |
2024-09-17 09:43:45 +05:45
| password | %public% |
When the public tries to create a file " simple.odt " inside the last shared public link folder with password " %public% " using wopi endpoint
2024-09-24 12:41:44 +02:00
Then the HTTP status code should be " 403 "
2024-09-17 09:43:45 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
2024-09-24 12:41:44 +02:00
"const": "PERMISSION_DENIED"
2024-09-17 09:43:45 +05:45
},
"message": {
2024-09-24 12:41:44 +02:00
"const": "permission denied to create the file"
2024-09-17 09:43:45 +05:45
}
}
}
"""
And as " Alice " file " publicFolder/simple.odt " should not exist
2024-09-17 10:02:02 +05:45
Scenario: user tries to create odt file inside deleted parent folder using wopi endpoint
Given user " Alice " has created folder " testFolder "
And user " Alice " has stored id of folder " testFolder "
And user " Alice " has deleted folder " testFolder "
When user " Alice " tries to create a file " simple.odt " inside deleted folder using wopi endpoint
Then the HTTP status code should be " 404 "
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"const": "RESOURCE_NOT_FOUND"
},
"message": {
"const": "the parent container is not accessible or does not exist"
}
}
}
"""
2024-09-17 17:05:53 +05:45
2025-09-19 16:15:07 +02:00
@issue-8691
2024-09-17 17:05:53 +05:45
Scenario Outline: public user with permission edit/upload/createOnly creates odt file inside folder of public 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
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " has created the following space link share:
| space | new-space |
| permissionsRole | <permissions-role> |
| password | %public% |
When the public creates a file " simple.odt " inside folder " testFolder " in the last shared public link space with password " %public% " 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 for user " Alice " folder " testFolder " of the space " new-space " should contain these files:
| simple.odt |
Examples:
| permissions-role |
2025-01-21 11:54:57 +05:45
| Edit |
| Upload |
| File Drop |
2024-09-17 17:05:53 +05:45
2025-09-19 16:15:07 +02:00
@issue-8691 @issue-10126
2024-09-17 17:05:53 +05:45
Scenario: public user with permission view tries to create odt file inside folder of public 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
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " has created the following space link share:
| space | new-space |
2025-01-21 11:54:57 +05:45
| permissionsRole | View |
2024-09-17 17:05:53 +05:45
| password | %public% |
When the public tries to create a file " simple.odt " inside folder " testFolder " in the last shared public link space with password " %public% " using wopi endpoint
2024-09-24 12:41:44 +02:00
Then the HTTP status code should be " 403 "
2024-09-17 17:05:53 +05:45
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
2024-09-24 12:41:44 +02:00
"const": "PERMISSION_DENIED"
2024-09-17 17:05:53 +05:45
},
"message": {
2024-09-24 12:41:44 +02:00
"const": "permission denied to create the file"
2024-09-17 17:05:53 +05:45
}
}
}
"""
And for user " Alice " folder " testFolder " of the space " new-space " should not contain these files:
| simple.odt |
2024-11-19 20:49:42 +05:45
2024-11-21 16:18:36 +05:45
Scenario Outline: create a file using a template
Given using spaces DAV path
And user " Alice " has uploaded file " filesForUpload/ <template> " to " <template> "
2024-11-19 20:49:42 +05:45
And we save it into " TEMPLATEID "
2024-11-21 16:18:36 +05:45
And user " Alice " has created a file " <target> " using wopi endpoint
2024-11-19 20:49:42 +05:45
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",
2026-03-03 16:49:43 +05:45
"pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}"
2024-11-19 20:49:42 +05:45
},
"method": {
"const": "POST"
},
"form_parameters": {
"type": "object",
"required": [
"access_token",
"access_token_ttl"
],
"properties": {
"access_token": {
"type": "string"
},
"access_token_ttl": {
"type": "string"
}
}
}
}
}
"""
Examples:
2024-11-21 16:18:36 +05:45
| app-endpoint | template | target |
| /app/open?file_id= <<FILEID> >&app_name=Collabora&view_mode=write&template_id= <<TEMPLATEID> > | template.ott | template.odt |
| /app/open?file_id= <<FILEID> >&app_name=OnlyOffice&view_mode=write&template_id= <<TEMPLATEID> > | template.dotx | template.docx |
2026-09-07 17:05:46 +05:45
Scenario Outline: lock request on file opened with different view modes
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And user " Alice " has sent the following app-open request:
| resource | simple.odt |
| space | Personal |
| app | FakeOffice |
| viewMode | <view-mode> |
When user " Alice " sends a lock request with lock id " abcdef123 " to the last opened file using wopi endpoint
Then the HTTP status code should be " 200 "
Examples:
| view-mode |
| view |
| read |
| write |
Scenario Outline: lock request with different lock id on file opened with different view modes
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And user " Alice " has sent the following app-open request:
| resource | simple.odt |
| space | Personal |
| app | FakeOffice |
| viewMode | <view-mode> |
When user " Alice " sends a lock request with lock id " abcdef123 " to the last opened file using wopi endpoint
Then the HTTP status code should be " 200 "
When user " Alice " sends a lock request with lock id " different-lock-id " to the last opened file using wopi endpoint
Then the HTTP status code should be " <http-status-code> "
Examples:
| view-mode | http-status-code |
| view | 200 |
| read | 200 |
| write | 409 |
Scenario: sharee with viewer permissions role sends lock request on shared file
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And user " Alice " has sent the following resource share invitation:
| resource | simple.odt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user " Brian " has sent the following app-open request:
| resource | simple.odt |
| space | Shares |
| app | FakeOffice |
When user " Brian " sends a lock request with lock id " abcdef123 " to the last opened file using wopi endpoint
Then the HTTP status code should be " 200 "
Scenario: space viewer sends lock request on shared file
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
And user " Alice " has created a folder " testFolder " in space " new-space "
And user " Alice " creates a file " simple.odt " inside folder " testFolder " in space " new-space " using wopi endpoint
And user " Alice " has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
And user " Brian " has sent the following app-open request:
| resource | testFolder/simple.odt |
| space | new-space |
| app | FakeOffice |
When user " Brian " sends a lock request with lock id " abcdef123 " to the last opened file using wopi endpoint
Then the HTTP status code should be " 200 "
Scenario: public link viewer sends lock request on shared file
Given user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And user " Alice " has created the following resource link share:
| resource | simple.odt |
| space | Personal |
| permissionsRole | View |
| password | %public% |
And the public has sent the following app-open request:
| owner | Alice |
| resource | simple.odt |
| space | Personal |
| app | FakeOffice |
When the public sends a lock request with lock id " abcdef123 " to the last opened file using wopi endpoint
Then the HTTP status code should be " 200 "
2026-10-01 11:03:09 +05:45
Scenario: brute-force protection must apply to max failed attempt on /app/open
And user " Alice " has uploaded file " filesForUpload/simple.odt " to " simple.odt "
And we save it into " FILEID "
And user " Alice " has created the following resource link share:
| resource | simple.odt |
| space | Personal |
| permissionsRole | View |
| password | %public% |
When the public sends HTTP method " POST " to URL " /app/open?file_id= <<FILEID> > " with password " %public% "
Then the HTTP status code should be " 200 "
# For this test using the default STORAGE_PUBLICLINK_BRUTEFORCE_MAXATTEMPTS (5)
# instead of lowering it via an env-config restart: a restart wipes oCIS's in-memory,
# non-persistent app registry, and the FakeOffice/Collabora/OnlyOffice app providers this
# suite depends on only ever register once, at their own startup - they never
# re-register - so losing that registration here would permanently break every other
# scenario in this file for the rest of the test run
# After the exceeding max attempts the public request to /app/open with correct password should return 401
When the public sends HTTP method " POST " to URL " /app/open?file_id= <<FILEID> > " with password " wrong-pw " for 6 times
Then the HTTP status code of responses on each endpoint should be " 401, 401, 401, 401, 401, 401 " respectively
When the public sends HTTP method " POST " to URL " /app/open?file_id= <<FILEID> > " with password " %public% "
Then the HTTP status code should be " 401 "