Files
opencloud/tests/acceptance/features/apiSpaces/uploadSpaces.feature
Salipa Gurung b2edca2619 [tests-only] [full-ci] Use sharingNG in remaining feature file of apiSpaces folder (#9122)
* update given step using sharingNg in restoreSpaces.feature

* update given step using sharingNg in setQuota.feature

* update given step using sharingNg in tag.feature

* update given step using sharingNg in trashBin.feature

* update given step using sharingNg in tusUpload.feature

* update given step using sharingNg in uploadSpaces.feature
2024-05-13 16:15:12 +05:45

96 lines
4.5 KiB
Gherkin

Feature: Upload files into a space
As a user
I want to be able to create folders and files in the space
So that I can store various information in them
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
| Bob |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "Project Ceres" of type "project" with quota "2000"
And using spaces DAV path
Scenario Outline: user creates a folder in the space via the Graph API
Given user "Alice" has sent the following space share invitation:
| space | Project Ceres |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
When user "Brian" creates a folder "mainFolder" in space "Project Ceres" using the WebDav Api
Then the HTTP status code should be "<http-status-code>"
And for user "Brian" the space "Project Ceres" <should-or-not> contain these entries:
| mainFolder |
Examples:
| space-role | http-status-code | should-or-not |
| Manager | 201 | should |
| Space Editor | 201 | should |
| Space Viewer | 403 | should not |
Scenario Outline: user uploads a file in shared space via the Graph API
Given user "Alice" has sent the following space share invitation:
| space | Project Ceres |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
When user "Brian" uploads a file inside space "Project Ceres" with content "Test" to "test.txt" using the WebDAV API
Then the HTTP status code should be "<http-status-code>"
And for user "Brian" the space "Project Ceres" <should-or-not> contain these entries:
| test.txt |
Examples:
| space-role | http-status-code | should-or-not |
| Manager | 201 | should |
| Space Editor | 201 | should |
| Space Viewer | 403 | should not |
Scenario: user can create subfolders in a space via the Graph API
When user "Alice" creates a subfolder "mainFolder/subFolder1/subFolder2" in space "Project Ceres" using the WebDav Api
Then the HTTP status code should be "201"
And for user "Alice" the space "Project Ceres" should contain these entries:
| mainFolder |
And for user "Alice" folder "mainFolder/subFolder1/" of the space "Project Ceres" should contain these entries:
| subFolder2 |
Scenario: user can create a folder and upload a file to a space
When user "Alice" creates a folder "NewFolder" in space "Project Ceres" using the WebDav Api
Then the HTTP status code should be "201"
And user "Alice" uploads a file inside space "Project Ceres" with content "Test" to "test.txt" using the WebDAV API
And the HTTP status code should be "201"
And for user "Alice" the space "Project Ceres" should contain these entries:
| NewFolder |
| test.txt |
Scenario: user cannot create a folder or a file in a space if they do not have permission
When user "Bob" creates a folder "forAlice" in space "Project Ceres" owned by the user "Alice" using the WebDav Api
Then the HTTP status code should be "404"
When user "Bob" uploads a file inside space "Project Ceres" owned by the user "Alice" with content "Test" to "test.txt" using the WebDAV API
Then the HTTP status code should be "404"
And for user "Alice" the space "Project Ceres" should not contain these entries:
| forAlice |
| test.txt |
Scenario: user cannot create folder with an existing name
Given user "Alice" has created a folder "NewFolder" in space "Project Ceres"
When user "Alice" creates a folder "NewFolder" in space "Project Ceres" using the WebDav Api
Then the HTTP status code should be "405"
Scenario Outline: user cannot create subfolder in a nonexistent folder
When user "Alice" tries to create subfolder "<folder-name>" in a nonexistent folder of the space "Project Ceres" using the WebDav Api
Then the HTTP status code should be "409"
Examples:
| folder-name |
| foo/bar |
| foo/bar/baz |