Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] split public link tests into separate files for new/old dav #38056

Merged
merged 1 commit into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Feature: reshare as public link
| 1 | 200 |
| 2 | 404 |


Scenario Outline: creating a public link from a share with share+read only permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand All @@ -36,17 +37,15 @@ Feature: reshare as public link
| publicUpload | false |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public shared folder using the old public WebDAV API
And the downloaded content should be "some content"
And the public should be able to download file "file.txt" from inside the last public shared folder using the new public WebDAV API
And the downloaded content should be "some content"
But uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
But uploading a file should not work using the new public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: creating an upload public link from a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand Down Expand Up @@ -78,6 +77,7 @@ Feature: reshare as public link
| 1 | 200 |
| 2 | 404 |


Scenario Outline: creating a public link from a share with share+read+write permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand All @@ -89,17 +89,15 @@ Feature: reshare as public link
| publicUpload | false |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public shared folder using the old public WebDAV API
And the downloaded content should be "some content"
And the public should be able to download file "file.txt" from inside the last public shared folder using the new public WebDAV API
And the downloaded content should be "some content"
But uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
But uploading a file should not work using the new public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: creating an upload public link from a share with share+read+write permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand All @@ -112,17 +110,15 @@ Feature: reshare as public link
| publicUpload | true |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public shared folder using the old public WebDAV API
And the downloaded content should be "some content"
And the public should be able to download file "file.txt" from inside the last public shared folder using the new public WebDAV API
And the downloaded content should be "some content"
And uploading a file should work using the old public WebDAV API
And uploading a file should work using the new public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: creating an upload public link from a sub-folder of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand All @@ -140,6 +136,7 @@ Feature: reshare as public link
| 1 | 200 |
| 2 | 404 |


Scenario Outline: increasing permissions of a public link of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand All @@ -154,13 +151,13 @@ Feature: reshare as public link
| permissions | read,update,create,delete |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |


Scenario Outline: increasing permissions of a public link from a sub-folder of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
Expand All @@ -171,13 +168,11 @@ Feature: reshare as public link
| path | /Shares/test/sub |
| permissions | read |
| publicUpload | false |
And uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
When user "Brian" updates the last share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
Examples:
| ocs_api_version | http_status_code |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@api @files_sharing-app-required @public_link_share-feature-required
Feature: reshare as public link
As a user
I want to create public link shares from files/folders shared with me
So that I can give controlled access to others

Background:
Given user "Alice" has been created with default attributes and skeleton files
And user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled


Scenario Outline: creating a public link from a share with share+read only permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has uploaded file with content "some content" to "/test/file.txt"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/test" offered by user "Alice"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| publicUpload | false |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public shared folder using the old public WebDAV API
And the downloaded content should be "some content"
But uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: creating a public link from a share with share+read+write permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has uploaded file with content "some content" to "/test/file.txt"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
And user "Brian" has accepted share "/test" offered by user "Alice"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| publicUpload | false |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public shared folder using the old public WebDAV API
And the downloaded content should be "some content"
But uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: creating an upload public link from a share with share+read+write permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has uploaded file with content "some content" to "/test/file.txt"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
And user "Brian" has accepted share "/test" offered by user "Alice"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| permissions | read,update,create,delete |
| publicUpload | true |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public shared folder using the old public WebDAV API
And the downloaded content should be "some content"
And uploading a file should work using the old public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: increasing permissions of a public link of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has created folder "/test/sub"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/test" offered by user "Alice"
And user "Brian" has created a public link share with settings
| path | /Shares/test |
| permissions | read |
| publicUpload | false |
When user "Brian" updates the last share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |


Scenario Outline: increasing permissions of a public link from a sub-folder of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has created folder "/test/sub"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/test" offered by user "Alice"
And user "Brian" has created a public link share with settings
| path | /Shares/test/sub |
| permissions | read |
| publicUpload | false |
And uploading a file should not work using the old public WebDAV API
When user "Brian" updates the last share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |