Files

332 lines
14 KiB
Gherkin
Raw Permalink Normal View History

@skipOnReva
2023-01-02 17:26:54 +05:45
Feature: sharing
2023-05-05 15:05:47 +05:45
As a user
I want to upload resources to a folder shared to me
So that other people can access the resource
2023-01-02 17:26:54 +05:45
Background:
Given user "Alice" has been created with default attributes
2023-01-02 17:26:54 +05:45
Scenario Outline: uploading file to a user read-only share folder does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading file to a group read-only share folder does not work
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
And user "Brian" has a share "FOLDER" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading file to a user upload-only share folder works
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
2024-06-10 11:49:27 +05:45
"""
This is a testfile.
2023-01-02 17:26:54 +05:45
2024-06-10 11:49:27 +05:45
Cheers.
"""
2023-01-02 17:26:54 +05:45
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading file to a group upload-only share folder works
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Uploader |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
2024-06-10 11:49:27 +05:45
"""
This is a testfile.
2023-01-02 17:26:54 +05:45
2024-06-10 11:49:27 +05:45
Cheers.
"""
2023-01-02 17:26:54 +05:45
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
@smokeTest
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading file to a user read/write share folder works
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
2024-06-10 11:49:27 +05:45
"""
This is a testfile.
2023-01-02 17:26:54 +05:45
2024-06-10 11:49:27 +05:45
Cheers.
"""
2023-01-02 17:26:54 +05:45
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading file to a group read/write share folder works
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Editor |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
2024-06-10 11:49:27 +05:45
"""
This is a testfile.
2023-01-02 17:26:54 +05:45
2024-06-10 11:49:27 +05:45
Cheers.
"""
2023-01-02 17:26:54 +05:45
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
@smokeTest
2023-05-05 15:05:47 +05:45
Scenario Outline: check quota of owners parent directory of a shared file
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2025-02-12 16:17:23 +05:45
And user "Admin" has changed the quota of space "Brian Murphy" to "0"
2023-01-02 17:26:54 +05:45
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/myfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | myfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "myfile.txt" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/myfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/myfile.txt" for user "Alice" should be:
2024-06-10 11:49:27 +05:45
"""
This is a testfile.
2023-01-02 17:26:54 +05:45
2024-06-10 11:49:27 +05:45
Cheers.
"""
2023-01-02 17:26:54 +05:45
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading to a user shared folder with read/write permission when the sharer has insufficient quota does not work
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2025-02-12 16:17:23 +05:45
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading to a group shared folder with read/write permission when the sharer has insufficient quota does not work
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Editor |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2025-02-12 16:17:23 +05:45
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading to a user shared folder with upload-only permission when the sharer has insufficient quota does not work
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2025-02-12 16:17:23 +05:45
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: uploading to a group shared folder with upload-only permission when the sharer has insufficient quota does not work
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Uploader |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2025-02-12 16:17:23 +05:45
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |
2023-01-02 17:26:54 +05:45
2023-05-05 15:05:47 +05:45
Scenario Outline: sharer can download file uploaded with different permission by sharee to a shared folder
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
2024-07-22 15:00:11 +05:45
And user "Brian" has a share "FOLDER" synced
2023-01-02 17:26:54 +05:45
When user "Brian" uploads file with content "some content" to "/Shares/FOLDER/textFile.txt" using the WebDAV API
And user "Alice" downloads file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "some content"
Examples:
| dav-path-version | permissions-role |
| old | Editor |
| old | Uploader |
| new | Editor |
| new | Uploader |
| spaces | Editor |
| spaces | Uploader |
2023-01-02 17:26:54 +05:45
Scenario Outline: upload an empty file (size zero byte) to a shared folder
2023-07-12 12:42:32 +05:45
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
2023-01-02 17:26:54 +05:45
And user "Brian" has created folder "/folder-to-share"
And user "Brian" has sent the following resource share invitation:
| resource | folder-to-share |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | Editor |
2024-07-22 15:00:11 +05:45
And user "Alice" has a share "folder-to-share" synced
2023-01-02 17:26:54 +05:45
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "/Shares/folder-to-share/zerobyte.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/Shares/folder-to-share/zerobyte.txt" should exist
And the content of file "/Shares/folder-to-share/zerobyte.txt" for user "Alice" should be ""
Examples:
2023-07-12 12:42:32 +05:45
| dav-path-version |
| old |
| new |
| spaces |