Extended public link tests to have more checks

This commit is contained in:
Swikriti Tripathi
2022-12-16 10:08:03 +05:45
committed by Phil Davis
parent 5df888affd
commit eab79a427f
3 changed files with 152 additions and 119 deletions

View File

@@ -79,6 +79,15 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiCors/cors.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L67)
- [apiCors/cors.feature:68](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L68)
#### [POST response does not return correct path when creating public link](https://github.com/owncloud/ocis/issues/5139)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:62](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L62)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L63)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:64](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L64)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L90)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L160)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L161)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:162](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L162)
#### [Public cannot download folder via the public link of the folder inside the project space](https://github.com/owncloud/ocis/issues/5229)
- [apiSpacesShares/publicLinkDownload.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature#L30)

View File

@@ -1,103 +1,103 @@
@api @skipOnOcV10
Feature: Share spaces via link
As the manager of a space
I want to be able to share a space via public link
As the manager of a space
I want to be able to share a space via public link
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
And using spaces DAV path
And the administrator has given "Alice" the role "Space Admin" using the settings api
And user "Alice" has created a space "share space" with the default quota using the GraphApi
And user "Alice" has uploaded a file inside space "share space" with content "some content" to "test.txt"
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
And using spaces DAV path
And the administrator has given "Alice" the role "Space Admin" using the settings api
And user "Alice" has created a space "share space" with the default quota using the GraphApi
And user "Alice" has uploaded a file inside space "share space" with content "some content" to "test.txt"
Scenario Outline: A manager can share a space to public via link with different permissions
When user "Alice" creates a public link share of the space "share space" with settings:
| permissions | <permissions> |
| password | <password> |
| name | <linkName> |
| expireDate | <expireDate> |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
And the fields of the last response to user "Alice" should include
| item_type | folder |
| mimetype | httpd/unix-directory |
| file_target | / |
| path | / |
| permissions | <expectedPermissions> |
| share_type | public_link |
| displayname_owner | %displayname% |
| uid_owner | %username% |
| name | <linkName> |
And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "<password>"
And the downloaded content should be "some content"
But the public should not be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass"
Examples:
| permissions | expectedPermissions | password | linkName | expireDate |
| 1 | read | 123234 | link | 2042-03-25T23:59:59+0100 |
| 5 | read,create | qwerty 123 | | 2042-03-25T23:59:59+0100 |
| 15 | read,update,create,delete | d*V^o*Y03R9n8Z | link | |
Scenario Outline: A manager can share a space to public via link with different permissions
When user "Alice" creates a public link share of the space "share space" with settings:
| permissions | <permissions> |
| password | <password> |
| name | <linkName> |
| expireDate | <expireDate> |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
And the fields of the last response to user "Alice" should include
| item_type | folder |
| mimetype | httpd/unix-directory |
| file_target | / |
| path | / |
| permissions | <expectedPermissions> |
| share_type | public_link |
| displayname_owner | %displayname% |
| uid_owner | %username% |
| name | <linkName> |
And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "<password>"
And the downloaded content should be "some content"
But the public should not be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass"
Examples:
| permissions | expectedPermissions | password | linkName | expireDate |
| 1 | read | 123234 | link | 2042-03-25T23:59:59+0100 |
| 5 | read,create | qwerty 123 | | 2042-03-25T23:59:59+0100 |
| 15 | read,update,create,delete | d*V^o*Y03R9n8Z | link | |
Scenario: An uploader should be able to upload a file
When user "Alice" creates a public link share of the space "share space" with settings:
| permissions | 4 |
| password | 123 |
| name | forUpload |
| expireDate | 2042-03-25T23:59:59+0100 |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
And the fields of the last response to user "Alice" should include
| item_type | folder |
| mimetype | httpd/unix-directory |
| file_target | / |
| path | / |
| permissions | create |
| share_type | public_link |
| displayname_owner | %displayname% |
| uid_owner | %username% |
| name | forUpload |
And the public should be able to upload file "lorem.txt" into the last public link shared folder using the new public WebDAV API with password "123"
And for user "Alice" the space "share space" should contain these entries:
| lorem.txt |
Scenario: An uploader should be able to upload a file
When user "Alice" creates a public link share of the space "share space" with settings:
| permissions | 4 |
| password | 123 |
| name | forUpload |
| expireDate | 2042-03-25T23:59:59+0100 |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
And the fields of the last response to user "Alice" should include
| item_type | folder |
| mimetype | httpd/unix-directory |
| file_target | / |
| path | / |
| permissions | create |
| share_type | public_link |
| displayname_owner | %displayname% |
| uid_owner | %username% |
| name | forUpload |
And the public should be able to upload file "lorem.txt" into the last public link shared folder using the new public WebDAV API with password "123"
And for user "Alice" the space "share space" should contain these entries:
| lorem.txt |
Scenario Outline: An user without manager role cannot share a space to public via link
Given user "Alice" has shared a space "share space" to user "Brian" with role "<role>"
When user "Brian" creates a public link share of the space "share space" with settings:
| permissions | 1 |
Then the HTTP status code should be "404"
And the OCS status code should be "404"
And the OCS status message should be "No share permission"
And for user "Alice" the space "share space" should not contain the last created public link
Examples:
| role |
| viewer |
| editor |
Scenario Outline: An user without manager role cannot share a space to public via link
Given user "Alice" has shared a space "share space" to user "Brian" with role "<role>"
When user "Brian" creates a public link share of the space "share space" with settings:
| permissions | 1 |
Then the HTTP status code should be "404"
And the OCS status code should be "404"
And the OCS status message should be "No share permission"
And for user "Alice" the space "share space" should not contain the last created public link
Examples:
| role |
| viewer |
| editor |
Scenario: An user with manager role can share a space to public via link
Given user "Alice" has shared a space "share space" to user "Brian" with role "manager"
When user "Brian" creates a public link share of the space "share space" with settings:
| permissions | 1 |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And for user "Alice" the space "share space" should contain the last created public link
Scenario: An user with manager role can share a space to public via link
Given user "Alice" has shared a space "share space" to user "Brian" with role "manager"
When user "Brian" creates a public link share of the space "share space" with settings:
| permissions | 1 |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And for user "Alice" the space "share space" should contain the last created public link
Scenario: A user cannot share a disabled space to public via link
Given user "Alice" has disabled a space "share space"
When user "Alice" creates a public link share of the space "share space" with settings:
| permissions | 1 |
Then the HTTP status code should be "404"
And the OCS status code should be "404"
And the OCS status message should be "Wrong path, file/folder doesn't exist"
And for user "Alice" the space "share space" should not contain the last created public link
Scenario: A user cannot share a disabled space to public via link
Given user "Alice" has disabled a space "share space"
When user "Alice" creates a public link share of the space "share space" with settings:
| permissions | 1 |
Then the HTTP status code should be "404"
And the OCS status code should be "404"
And the OCS status message should be "Wrong path, file/folder doesn't exist"
And for user "Alice" the space "share space" should not contain the last created public link

View File

@@ -1,21 +1,21 @@
@api @skipOnOcV10
Feature: Share a file or folder that is inside a space via public link
As an user with manager space role
I want to be able to share the data inside the space via public link
As an user with manager space role
I want to be able to share the data inside the space via public link
folder permissions:
| role | permissions |
| internal | 0 |
| viewer | 1 |
| uploader | 4 |
| contributor | 5 |
| editor | 15 |
folder permissions:
| role | permissions |
| internal | 0 |
| viewer | 1 |
| uploader | 4 |
| contributor | 5 |
| editor | 15 |
file permissions:
| role | permissions |
| internal | 0 |
| viewer | 1 |
| editor | 3 |
file permissions:
| role | permissions |
| internal | 0 |
| viewer | 1 |
| editor | 3 |
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
@@ -44,17 +44,24 @@ Feature: Share a file or folder that is inside a space via public link
And the OCS status code should be "200"
And the OCS status message should be "OK"
And the fields of the last response to user "Alice" should include
| path | <path> |
| item_type | <item_type> |
| mimetype | <mimetype> |
| file_target | <file_target> |
| path | /<entity> |
| permissions | <permissions> |
| share_type | public_link |
| displayname_owner | %displayname% |
| name | <name> |
Examples:
| entity | path | permissions | password | name | expireDate |
| folder | /folder |0 | | link | |
| folder | /folder |1 | 123 | link | 2042-03-25T23:59:59+0100 |
| folder | /folder |4 | | | |
| folder | /folder |5 | 200 | | 2042-03-25T23:59:59+0100 |
| folder | /folder |15 | | link | |
| folder/file.txt | /file.txt |0 | 123 | link | 2042-03-25T23:59:59+0100 |
| folder/file.txt | /file.txt |1 | 123 | link | 2042-03-25T23:59:59+0100 |
| folder/file.txt | /file.txt |3 | 123 | link | 2042-03-25T23:59:59+0100 |
| entity | file_target | permissions | password | name | expireDate | item_type | mimetype |
| folder | /folder | 0 | | link | | folder | httpd/unix-directory |
| folder | /folder | 1 | 123 | link | 2042-03-25T23:59:59+0100 | folder | httpd/unix-directory |
| folder | /folder | 4 | | | | folder | httpd/unix-directory |
| folder | /folder | 5 | 200 | | 2042-03-25T23:59:59+0100 | folder | httpd/unix-directory |
| folder | /folder | 15 | | link | | folder | httpd/unix-directory |
| folder/file.txt | /file.txt | 0 | 123 | link | 2042-03-25T23:59:59+0100 | file | text/plain |
| folder/file.txt | /file.txt | 1 | 123 | link | 2042-03-25T23:59:59+0100 | file | text/plain |
| folder/file.txt | /file.txt | 3 | 123 | link | 2042-03-25T23:59:59+0100 | file | text/plain |
Scenario Outline: An user participant of the project space with space manager role can share an entity inside project space via public link
@@ -69,12 +76,18 @@ Feature: Share a file or folder that is inside a space via public link
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
And the fields of the last response to user "Alice" should include
| path | <path> |
And the fields of the last response to user "Brian" should include
| item_type | <item_type> |
| mimetype | <mimetype> |
| file_target | <file_target> |
| path | /<entity> |
| share_type | public_link |
| displayname_owner | %displayname% |
| name | public link |
Examples:
| entity | path |
| folder | /folder |
| folder/file.txt | /file.txt |
| entity | file_target | item_type | mimetype |
| folder | /folder | folder | httpd/unix-directory |
| folder/file.txt | /file.txt | file | text/plain |
Scenario Outline: An user participant of the project space without space manager role cannot share an entity inside project space via public link
@@ -130,7 +143,18 @@ Feature: Share a file or folder that is inside a space via public link
| path | folder/file.txt |
| shareType | 3 |
| permissions | 1 |
Then for user "Brian" the space "share sub-item" should contain the last created public link of the file "folder/file.txt"
Then the fields of the last response to user "Alice" should include
| item_type | file |
| mimetype | text/plain |
| file_target | /file.txt |
| path | folder/file.txt |
| permissions | 1 |
| share_type | public_link |
| displayname_file_owner | %displayname% |
| displayname_owner | %displayname% |
| uid_file_owner | %username% |
| uid_owner | %username% |
And for user "Brian" the space "share sub-item" should contain the last created public link of the file "folder/file.txt"
Examples:
| spaceRole |
| editor |