2021-10-29 10:46:20 +02:00
Feature: Upload files into a space
2023-04-20 15:30:13 +05:45
As a user
2022-07-08 05:18:40 +02:00
I want to be able to create folders and files in the space
2023-04-17 17:05:12 +05:45
So that I can store various information in them
2021-10-29 10:46:20 +02:00
Background:
2024-11-29 09:39:21 +05:45
Given these users have been created with default attributes:
2022-07-08 05:18:40 +02:00
| username |
| Alice |
| Brian |
| Bob |
2023-06-15 15:56:48 +02:00
And the administrator has assigned the role " Space Admin " to user " Alice " using the Graph API
2022-07-08 05:18:40 +02:00
And user " Alice " has created a space " Project Ceres " of type " project " with quota " 2000 "
2022-09-14 13:38:15 +05:45
And using spaces DAV path
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: user creates a folder in the space via the Graph API
2024-05-13 16:15:12 +05:45
Given user " Alice " has sent the following space share invitation:
| space | Project Ceres |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
2022-07-08 05:18:40 +02:00
When user " Brian " creates a folder " mainFolder " in space " Project Ceres " using the WebDav Api
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
And for user " Brian " the space " Project Ceres " <should-or-not> contain these entries:
2022-07-08 05:18:40 +02:00
| mainFolder |
Examples:
2024-05-13 16:15:12 +05:45
| space-role | http-status-code | should-or-not |
| Manager | 201 | should |
| Space Editor | 201 | should |
| Space Viewer | 403 | should not |
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: user uploads a file in shared space via the Graph API
2024-05-13 16:15:12 +05:45
Given user " Alice " has sent the following space share invitation:
| space | Project Ceres |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
2022-07-08 05:18:40 +02:00
When user " Brian " uploads a file inside space " Project Ceres " with content " Test " to " test.txt " using the WebDAV API
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
And for user " Brian " the space " Project Ceres " <should-or-not> contain these entries:
2022-07-08 05:18:40 +02:00
| test.txt |
Examples:
2024-05-13 16:15:12 +05:45
| space-role | http-status-code | should-or-not |
| Manager | 201 | should |
| Space Editor | 201 | should |
| Space Viewer | 403 | should not |
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario: user can create subfolders in a space via the Graph API
2022-07-08 05:18:40 +02:00
When user " Alice " creates a subfolder " mainFolder/subFolder1/subFolder2 " in space " Project Ceres " using the WebDav Api
2021-11-09 14:31:11 +01:00
Then the HTTP status code should be " 201 "
2021-12-02 10:05:28 +01:00
And for user " Alice " the space " Project Ceres " should contain these entries:
2022-01-25 14:59:15 +01:00
| mainFolder |
2022-07-08 05:18:40 +02:00
And for user " Alice " folder " mainFolder/subFolder1/ " of the space " Project Ceres " should contain these entries:
2022-01-25 14:59:15 +01:00
| subFolder2 |
2022-01-25 20:57:02 +01:00
2023-04-17 17:05:12 +05:45
Scenario: user can create a folder and upload a file to a space
2022-07-08 05:18:40 +02:00
When user " Alice " creates a folder " NewFolder " in space " Project Ceres " using the WebDav Api
2021-10-29 10:46:20 +02:00
Then the HTTP status code should be " 201 "
2022-07-08 05:18:40 +02:00
And user " Alice " uploads a file inside space " Project Ceres " with content " Test " to " test.txt " using the WebDAV API
2023-08-22 16:14:36 +05:45
And the HTTP status code should be " 201 "
2022-07-08 05:18:40 +02:00
And for user " Alice " the space " Project Ceres " should contain these entries:
| NewFolder |
| test.txt |
2021-10-29 10:46:20 +02:00
2022-01-25 20:57:02 +01:00
2023-04-17 17:05:12 +05:45
Scenario: user cannot create a folder or a file in a space if they do not have permission
2022-07-08 05:18:40 +02:00
When user " Bob " creates a folder " forAlice " in space " Project Ceres " owned by the user " Alice " using the WebDav Api
2021-11-09 14:31:11 +01:00
Then the HTTP status code should be " 404 "
2022-07-08 05:18:40 +02:00
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 |
2023-05-25 14:47:32 +02:00
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
2024-03-21 09:14:50 +05:45
When user " Alice " tries to create subfolder " <folder-name> " in a nonexistent folder of the space " Project Ceres " using the WebDav Api
2023-05-25 14:47:32 +02:00
Then the HTTP status code should be " 409 "
Examples:
2024-03-21 09:14:50 +05:45
| folder-name |
2023-05-25 14:47:32 +02:00
| foo/bar |
| foo/bar/baz |
2024-12-09 16:16:30 +05:45
2025-09-19 16:15:07 +02:00
@issue-10469
2024-12-09 16:16:30 +05:45
Scenario: public uploads a zero byte file to a public share folder
Given using SharingNG
And user " Alice " has created folder " /uploadFolder "
And user " Alice " has created the following resource link share:
| resource | uploadFolder |
| space | Personal |
2025-01-10 12:20:47 +05:45
| permissionsRole | File Drop |
2024-12-09 16:16:30 +05:45
| password | %public% |
When the public uploads file " filesForUpload/zerobyte.txt " to " textfile.txt " inside last link shared folder with password " %public% " using the public WebDAV API
Then the HTTP status code should be " 201 "
And for user " Alice " folder " uploadFolder " of the space " Personal " should contain these files:
| textfile.txt |
And for user " Alice " folder " uploadFolder " of the space " Personal " should not contain these files:
| textfile (1).txt |
2024-12-30 17:07:34 +05:45
| textfile (2).txt |
2024-12-09 16:16:30 +05:45
2025-09-19 16:15:07 +02:00
@issue-10469
2024-12-09 16:16:30 +05:45
Scenario: public uploads a zero byte file to a public share folder inside project space
Given using SharingNG
And user " Alice " has created a folder " /uploadFolder " in space " Project Ceres "
And user " Alice " has created the following resource link share:
2024-12-10 13:56:34 +05:45
| resource | uploadFolder |
| space | Project Ceres |
2025-01-10 12:20:47 +05:45
| permissionsRole | File Drop |
2024-12-10 13:56:34 +05:45
| password | %public% |
2024-12-09 16:16:30 +05:45
When the public uploads file " filesForUpload/zerobyte.txt " to " textfile.txt " inside last link shared folder with password " %public% " using the public WebDAV API
Then the HTTP status code should be " 201 "
And for user " Alice " folder " uploadFolder " of the space " Project Ceres " should contain these files:
| textfile.txt |
And for user " Alice " folder " uploadFolder " of the space " Project Ceres " should not contain these files:
| textfile (1).txt |
2024-12-30 17:07:34 +05:45
| textfile (2).txt |
2024-12-09 16:16:30 +05:45
2025-09-19 16:15:07 +02:00
@issue-10469
2024-12-09 16:16:30 +05:45
Scenario: public uploads a zero byte file to a public share project space
Given using SharingNG
And user " Alice " has created the following space link share:
2024-12-10 13:56:34 +05:45
| space | Project Ceres |
2025-01-21 11:54:57 +05:45
| permissionsRole | File Drop |
2024-12-10 13:56:34 +05:45
| password | %public% |
2024-12-09 16:16:30 +05:45
When the public uploads file " filesForUpload/zerobyte.txt " to " textfile.txt " inside last link shared folder with password " %public% " using the public WebDAV API
Then the HTTP status code should be " 201 "
And for user " Alice " the space " Project Ceres " should contain these files:
| textfile.txt |
And for user " Alice " the space " Project Ceres " should not contain these files:
| textfile (1).txt |
2024-12-30 17:07:34 +05:45
| textfile (2).txt |