Skip to content

Commit

Permalink
Refactor share permission related scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Feb 2, 2023
1 parent 8e57f03 commit b68865a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 224 deletions.
10 changes: 4 additions & 6 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,16 @@ cannot share a folder with create permission
- [coreApiSharePublicLink2/copyFromPublicLink.feature:174](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L174)
- [coreApiSharePublicLink2/copyFromPublicLink.feature:189](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L189)
- [coreApiSharePublicLink2/copyFromPublicLink.feature:190](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L190)
- [coreApiSharePublicLink3/updatePublicLinkShare.feature:45](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShare.feature#L45)
- [coreApiSharePublicLink3/updatePublicLinkShare.feature:46](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShare.feature#L46)

#### [Upload-only shares must not overwrite but create a separate file](https://github.com/owncloud/ocis/issues/1267)

- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:24](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L24)
- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:273](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L273)
- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:10](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L10)
- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L176)

#### [Set quota over settings](https://github.com/owncloud/ocis/issues/1290)

- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L160)
- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:179](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L179)
- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:115](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L115)
- [coreApiSharePublicLink3/uploadToPublicLinkShare.feature:129](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink3/uploadToPublicLinkShare.feature#L129)


#### [deleting a file inside a received shared folder is moved to the trash-bin of the sharer not the receiver](https://github.com/owncloud/ocis/issues/1124)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: update a public link share
When user "Alice" updates the last public link share using the sharing API with
| expireDate | +3 days |
Then the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "Ok"
And the OCS status message should be "OK"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" should include
| id | A_STRING |
Expand All @@ -28,8 +28,8 @@ Feature: update a public link share
| token | A_STRING |
| uid_file_owner | %username% |
| displayname_file_owner | %displayname% |
| additional_info_owner | |
| additional_info_file_owner | |
| additional_info_owner | %emailaddress% |
| additional_info_file_owner | %emailaddress% |
| item_type | folder |
| item_source | A_STRING |
| path | /FOLDER |
Expand Down Expand Up @@ -419,11 +419,11 @@ Feature: update a public link share
And as "Alice" file "PARENT/CHILD/child.txt" should not exist
And as "Alice" file "PARENT/parent.txt" should not exist

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| ocs_api_version | public-webdav-api-version |
| 1 | old |
| 2 | old |
# @notToImplementOnOCIS @issue-ocis-2079
# Examples:
# | ocs_api_version | public-webdav-api-version |
# | 1 | old |
# | 2 | old |


Examples:
Expand Down Expand Up @@ -478,7 +478,7 @@ Feature: update a public link share
| spaces | 2 | 200 |


@skipOnOcV10

Scenario Outline: API responds with a full set of parameters when owner renames the file with a public link in ocis
Given using OCS API version "<ocs_api_version>"
And using <dav-path> DAV path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
@api @files_sharing-app-required @public_link_share-feature-required @issue-ocis-reva-315 @issue-ocis-reva-316
@api @files_sharing-app-required @public_link_share-feature-required @issue-ocis-reva-315 @issue-ocis-reva-316 @issue-ocis-2079

Feature: upload to a public link share

Background:
Given user "Alice" has been created with default attributes and without skeleton files
And user "Alice" has created folder "FOLDER"

@smokeTest @notToImplementOnOCIS @issue-ocis-2079
Scenario: Uploading same file to a public upload-only share multiple times via old API
# The old API needs to have the header OC-Autorename: 1 set to do the autorename
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | create |
When the public uploads file "test.txt" with content "test" using the old public WebDAV API
And the public uploads file "test.txt" with content "test2" with auto-rename mode using the old public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

@smokeTest @issue-ocis-reva-286
Scenario: Uploading same file to a public upload-only share multiple times via new API
# The new API does the autorename automatically in upload-only folders
Expand All @@ -44,19 +30,13 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test" using the <public-webdav-api-version> public WebDAV API
And the HTTP status code should be "404"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| dav-path | public-webdav-api-version |
| old | old |
| new | old |

@issue-ocis-reva-290
Examples:
| dav-path | public-webdav-api-version |
| old | new |
| new | new |

@personalSpace @skipOnOcV10
@personalSpace
Examples:
| dav-path | public-webdav-api-version |
| spaces | new |
Expand All @@ -69,11 +49,6 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test" using the <public-webdav-api-version> public WebDAV API
And the HTTP status code should be "403"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |

@issue-ocis-reva-292
Examples:
| public-webdav-api-version |
Expand All @@ -90,11 +65,6 @@ Feature: upload to a public link share
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |


Examples:
| public-webdav-api-version |
Expand All @@ -110,11 +80,6 @@ Feature: upload to a public link share
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |


Examples:
| public-webdav-api-version |
Expand All @@ -130,11 +95,6 @@ Feature: upload to a public link share
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |


Examples:
| public-webdav-api-version |
Expand All @@ -149,11 +109,6 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test-file" using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "507"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |

@issue-ocis-reva-195
Examples:
| public-webdav-api-version |
Expand All @@ -168,32 +123,12 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test-file" using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "507"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |

@issue-ocis-reva-195
Examples:
| public-webdav-api-version |
| new |


Scenario Outline: Uploading file to a public shared folder does not work when allow public uploads has been disabled after sharing the folder with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | create |
And parameter "shareapi_allow_public_upload" of app "core" has been set to "no"
When the public uploads file "test.txt" with content "test-file" using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "403"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |
| new |


Scenario Outline: Uploading file to a public shared folder does not work when allow public uploads has been disabled before sharing and again enabled after sharing the folder with public API
Given parameter "shareapi_allow_public_upload" of app "core" has been set to "no"
And user "Alice" has created a public link share with settings
Expand All @@ -202,11 +137,6 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test-file" using the <public-webdav-api-version> public WebDAV API
And the HTTP status code should be "403"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |

@issue-ocis-reva-41
Examples:
| public-webdav-api-version |
Expand All @@ -223,11 +153,6 @@ Feature: upload to a public link share
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |

@issue-ocis-reva-41
Examples:
| public-webdav-api-version |
Expand All @@ -242,33 +167,11 @@ Feature: upload to a public link share
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
| public-webdav-api-version |
| old |


Examples:
| public-webdav-api-version |
| new |

@smokeTest @notToImplementOnOCIS @issue-ocis-2079
Scenario: Uploading same file to a public upload-write and no edit and no overwrite share multiple times with old public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | uploadwriteonly |
When the public uploads file "test.txt" with content "test" using the old public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
When the public uploads file "test.txt" with content "test2" using the old public WebDAV API
# Uncomment these once the issue is fixed
# Then the HTTP status code should be "201"
# And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
# And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"
Then the HTTP status code should be "403"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"

@smokeTest @issue-ocis-reva-286
Scenario: Uploading same file to a public upload-write and no edit and no overwrite share multiple times with new public API
Given user "Alice" has created a public link share with settings
Expand Down

0 comments on commit b68865a

Please sign in to comment.