Skip to content

Commit

Permalink
Add tests removed by core pr-40276
Browse files Browse the repository at this point in the history
  • Loading branch information
SwikritiT committed Aug 12, 2022
1 parent 02adcbd commit 7e983da
Showing 1 changed file with 170 additions and 1 deletion.
171 changes: 170 additions & 1 deletion tests/acceptance/features/apiSpaces/shareOperations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,173 @@ Feature: sharing
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "15"
And the single response should contain a property "ocs:share-permissions" with value "15"


Scenario: Uploading file to a group read-only share folder does not work
Given using spaces DAV path
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 created a share with settings
| path | FOLDER |
| shareType | group |
| permissions | read |
| shareWith | grp1 |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/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


Scenario: Uploading file to a user upload-only share folder works
Given using spaces DAV path
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | create |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/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:
"""
new description
"""

Scenario: Uploading file to a group upload-only share folder works
Given using spaces DAV path
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | group |
| permissions | create |
| shareWith | grp1 |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/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:
"""
new description
"""

Scenario: Uploading file to a user read/write share folder works
Given using spaces DAV path
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | change |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/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:
"""
new description
"""

Scenario: Uploading file to a group read/write share folder works
Given using spaces DAV path
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 created a share with settings
| path | FOLDER |
| shareType | group |
| permissions | change |
| shareWith | grp1 |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/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:
"""
new description
"""

Scenario: Check quota of owners parent directory of a shared file
Given using spaces DAV path
And the quota of user "Brian" has been set to "0"
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/myfile.txt"
And user "Alice" has shared file "myfile.txt" with user "Brian"
And user "Brian" has accepted share "/myfile.txt" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/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:
"""
new description
"""


Scenario: Uploading to a user shared folder with read/write permission when the sharer has unsufficient quota does not work
Given using spaces DAV path
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | change |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
And the quota of user "Alice" has been set to "0"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist


Scenario: Uploading to a user shared folder with upload-only permission when the sharer has insufficient quota does not work
Given using spaces DAV path
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | create |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
And the quota of user "Alice" has been set to "0"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist


Scenario: Uploading to a group shared folder with upload-only permission when the sharer has insufficient quota does not work
Given using spaces DAV path
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 created a share with settings
| path | FOLDER |
| shareType | group |
| permissions | create |
| shareWith | grp1 |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
And the quota of user "Alice" has been set to "0"
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist


Scenario Outline: Sharer can download file uploaded with different permission by sharee to a shared folder
Given using spaces DAV path
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | <permissions> |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads a file inside space "Shares Jail" with content "some content" to "/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:
| permissions |
| change |
| create |

0 comments on commit 7e983da

Please sign in to comment.