Skip to content

Commit

Permalink
Merge pull request #9967 from owncloud/create-file-in-shared-received…
Browse files Browse the repository at this point in the history
…-folder

[tests-only][full-ci] added test to create .odt file inside shared folder using `/app/new` endpoint
  • Loading branch information
PrajwolAmatya committed Sep 17, 2024
2 parents 4d5168f + 5af9ff5 commit e40c5be
Showing 1 changed file with 66 additions and 1 deletion.
67 changes: 66 additions & 1 deletion tests/acceptance/features/apiCollaboration/wopi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ Feature: collaboration (wopi)
| Manager |


Scenario: user with Viewer role tries to create a text file inside shared project space using wopi endpoint
Scenario: user with Viewer role tries to create 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
Expand Down Expand Up @@ -859,3 +859,68 @@ Feature: collaboration (wopi)
| simple.odt |
And for user "Brian" folder "testFolder" of the space "new-space" should not contain these files:
| simple.odt |


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 |


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
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 calling InitiateFileUpload"
}
}
}
"""
And as "Alice" file "testFolder/simple.odt" should not exist
And as "Brian" file "Shares/testFolder/simple.odt" should not exist

0 comments on commit e40c5be

Please sign in to comment.