2022-08-23 17:05:12 +05:45
Feature: upload resources using TUS protocol
As a user
I want to be able to upload files
So that I can store and share files between multiple client systems
Background:
2024-11-29 09:39:21 +05:45
Given these users have been created with default attributes:
2022-08-23 17:05:12 +05:45
| username |
| Alice |
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-08-23 17:05:12 +05:45
And using spaces DAV path
Scenario: upload a file within the set quota to a project space
Given user " Alice " has created a space " Project Jupiter " of type " project " with quota " 10000 "
When user " Alice " uploads a file with content " uploaded content " to " /upload.txt " via TUS inside of the space " Project Jupiter " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 204 "
And for user " Alice " the space " Project Jupiter " should contain these entries:
2022-08-23 17:05:12 +05:45
| upload.txt |
Scenario: upload a file bigger than the set quota to a project space
Given user " Alice " has created a space " Project Jupiter " of type " project " with quota " 10 "
2023-01-06 08:59:02 +01:00
When user " Alice " creates a new TUS resource for the space " Project Jupiter " with content " file content is 24 bytes " using the WebDAV API with these headers:
| Upload-Length | 24 |
2022-08-23 17:05:12 +05:45
# dXBsb2FkLnR4dA== is the base64 encoded value of filename upload.txt
2023-01-06 08:59:02 +01:00
| Upload-Metadata | filename dXBsb2FkLnR4dA== |
| Content-Type | application/offset+octet-stream |
| Tus-Resumable | 1.0.0 |
| Tus-Extension | creation-with-upload |
2022-08-23 17:05:12 +05:45
Then the HTTP status code should be " 507 "
And for user " Alice " the space " Project Jupiter " should not contain these entries:
| upload.txt |
2023-05-24 17:12:19 +02:00
Scenario: upload the same file after renaming the first one
Given user " Alice " has uploaded a file with content " uploaded content " to " /upload.txt " via TUS inside of the space " Alice Hansen "
And user " Alice " has moved file " upload.txt " to " test.txt " in space " Alice Hansen "
When user " Alice " uploads a file with content " uploaded content " to " /upload.txt " via TUS inside of the space " Alice Hansen " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 204 "
And for user " Alice " the space " Alice Hansen " should contain these entries:
2023-05-24 17:12:19 +02:00
| test.txt |
| upload.txt |
2024-01-22 20:01:10 +05:45
2025-09-22 10:52:52 +02:00
2024-01-22 20:01:10 +05:45
Scenario Outline: upload a zero-byte file inside a shared folder
Given using <dav-path-version> DAV path
2024-11-29 09:39:21 +05:45
And user " Brian " has been created with default attributes
2024-01-22 20:01:10 +05:45
And user " Alice " has created folder " testFolder "
2024-05-13 16:15:12 +05:45
And user " Alice " has sent the following resource share invitation:
| resource | testFolder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
2024-07-25 18:09:28 +05:45
And user " Brian " has a share " testFolder " synced
2024-01-22 20:01:10 +05:45
When user " Brian " uploads file " filesForUpload/zerobyte.txt " to " Shares/testFolder/textfile.txt " using the TUS protocol on the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And the content of file " Shares/testFolder/textfile.txt " for user " Brian " should be ""
2024-01-22 20:01:10 +05:45
And the content of file " testFolder/textfile.txt " for user " Alice " should be ""
Examples:
| dav-path-version |
| old |
| new |
Scenario: upload a zero-byte file inside a shared folder (spaces dav path)
Given using spaces DAV path
2024-11-29 09:39:21 +05:45
And user " Brian " has been created with default attributes
2024-01-22 20:01:10 +05:45
And user " Alice " has created folder " testFolder "
2024-05-13 16:15:12 +05:45
And user " Alice " has sent the following resource share invitation:
| resource | testFolder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
2024-07-25 18:09:28 +05:45
And user " Brian " has a share " testFolder " synced
2024-01-22 20:01:10 +05:45
When user " Brian " uploads a file from " filesForUpload/zerobyte.txt " to " testFolder/textfile.txt " via TUS inside of the space " Shares " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And for user " Brian " the content of the file " testFolder/textfile.txt " of the space " Shares " should be ""
2024-01-22 20:01:10 +05:45
And for user " Alice " the content of the file " testFolder/textfile.txt " of the space " Personal " should be ""
Scenario: upload a zero-byte file inside a project space
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
When user " Alice " uploads a file from " filesForUpload/zerobyte.txt " to " textfile.txt " via TUS inside of the space " new-space " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And for user " Alice " the content of the file " textfile.txt " of the space " new-space " should be ""
2024-01-22 20:01:10 +05:45
2025-09-22 10:52:52 +02:00
@issue-8003
2024-01-22 20:01:10 +05:45
Scenario Outline: replace a shared file with zero-byte file
Given using <dav-path-version> DAV path
2024-11-29 09:39:21 +05:45
And user " Brian " has been created with default attributes
2024-01-22 20:01:10 +05:45
And user " Alice " has uploaded file with content " This is TUS upload " to " textfile.txt "
2024-05-13 16:15:12 +05:45
And user " Alice " has sent the following resource share invitation:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
2024-07-25 18:09:28 +05:45
And user " Brian " has a share " textfile.txt " synced
2024-01-22 20:01:10 +05:45
When user " Brian " uploads file " filesForUpload/zerobyte.txt " to " Shares/textfile.txt " using the TUS protocol on the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And the content of file " Shares/textfile.txt " for user " Brian " should be ""
2024-01-22 20:01:10 +05:45
And the content of file " textfile.txt " for user " Alice " should be ""
Examples:
| dav-path-version |
| old |
| new |
@issue-8003
Scenario: replace a shared file with zero-byte file (spaces dav path)
Given using spaces DAV path
2024-11-29 09:39:21 +05:45
And user " Brian " has been created with default attributes
2024-01-22 20:01:10 +05:45
And user " Alice " has uploaded file with content " This is TUS upload " to " textfile.txt "
2024-05-13 16:15:12 +05:45
And user " Alice " has sent the following resource share invitation:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
2024-07-25 18:09:28 +05:45
And user " Brian " has a share " textfile.txt " synced
2024-01-22 20:01:10 +05:45
When user " Brian " uploads a file from " filesForUpload/zerobyte.txt " to " textfile.txt " via TUS inside of the space " Shares " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And for user " Brian " the content of the file " textfile.txt " of the space " Shares " should be ""
2024-01-22 20:01:10 +05:45
And for user " Alice " the content of the file " textfile.txt " of the space " Personal " should be ""
@issue-8003
Scenario: replace a file inside a project space with zero-byte 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 uploaded a file inside space " new-space " with content " This is TUS upload " to " textfile.txt "
When user " Alice " uploads a file from " filesForUpload/zerobyte.txt " to " textfile.txt " via TUS inside of the space " new-space " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And for user " Alice " the content of the file " textfile.txt " of the space " new-space " should be ""
2024-01-22 20:01:10 +05:45
@issue-8003
Scenario: replace a file inside a shared project space with zero-byte file
Given using spaces DAV path
2024-11-29 09:39:21 +05:45
And user " Brian " has been created with default attributes
2024-01-22 20:01:10 +05:45
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 uploaded a file inside space " new-space " with content " This is TUS upload " to " textfile.txt "
2024-05-13 16:15:12 +05:45
And user " Alice " has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Editor |
2024-01-22 20:01:10 +05:45
When user " Brian " uploads a file from " filesForUpload/zerobyte.txt " to " textfile.txt " via TUS inside of the space " new-space " using the WebDAV API
2024-12-24 15:30:14 +05:45
Then the HTTP status code should be " 201 "
2025-02-11 17:01:57 +05:45
And the following headers should be set
| header | value |
| Access-Control-Expose-Headers | Tus-Resumable, Upload-Offset, Location |
2024-12-24 15:30:14 +05:45
And for user " Brian " the content of the file " textfile.txt " of the space " new-space " should be ""
2024-05-13 16:15:12 +05:45
And for user " Alice " the content of the file " textfile.txt " of the space " new-space " should be ""