mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-28 16:29:09 -04:00
121 lines
3.5 KiB
Gherkin
121 lines
3.5 KiB
Gherkin
Feature: collaboration (wopi)
|
|
As a user
|
|
I want to access files with collaboration service apps
|
|
So that I can collaborate with other users
|
|
|
|
Background:
|
|
Given user "Alice" has been created with default attributes and without skeleton files
|
|
|
|
|
|
Scenario Outline: open file with .odt extension
|
|
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",
|
|
"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=FakeOffice |
|
|
| /app/open?file_id=<<FILEID>> |
|
|
|
|
|
|
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",
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
|
|
|
|
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"
|
|
When user "Alice" sends HTTP method "POST" to URL "/app/open?file_id=<<FILEID>>"
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
"""
|