uploadToPublicLinkShare.feature: Used sharingNG for sharing in given step

This commit is contained in:
Prarup Gurung
2024-05-17 12:34:34 +05:45
parent fec9de257f
commit b2de5661bf
3 changed files with 55 additions and 38 deletions

View File

@@ -152,7 +152,6 @@ default:
- TrashbinContext:
- WebDavPropertiesContext:
- OcisConfigContext:
- SpacesContext:
- SharingNgContext:
coreApiShareUpdateToShares:

View File

@@ -722,7 +722,7 @@ class SharingNgContext implements Context {
* @return void
* @throws Exception
*/
public function userSetsOrUpdatesFollowingPasswordForLastLinkShareUsingTheGraphApi(string $user, TableNode $body):void {
public function userSetsOrUpdatesFollowingPasswordForLastLinkShareUsingTheGraphApi(string $user, TableNode $body):void {
$this->featureContext->setResponse(
$this->setLinkSharePassword(
$user,

View File

@@ -12,10 +12,12 @@ Feature: upload to a public link share
Scenario Outline: uploading file to a public upload-only share using public API that was deleted does not work
Given using <dav-path-version> DAV path
And user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | create |
| password | %public% |
And using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
And user "Alice" has deleted folder "/FOLDER"
When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API
And the HTTP status code should be "404"
@@ -33,19 +35,23 @@ Feature: upload to a public link share
@issue-1269
Scenario: uploading file to a public read-only share folder with public API does not work
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | read |
| password | %public% |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | view |
| password | %public% |
When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API
And the HTTP status code should be "403"
Scenario: uploading to a public upload-only share with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | create |
| password | %public% |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"
@@ -54,60 +60,72 @@ Feature: upload to a public link share
Scenario: uploading to a public upload-only share with password with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
| permissions | create |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"
Scenario: uploading to a public read/write share with password with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
| permissions | change |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | edit |
| password | %public% |
When the public uploads file "test.txt" with password "%public%" and content "test-file" using the new public WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test-file"
@skipOnReva
Scenario: uploading file to a public shared folder with read/write permission when the sharer has insufficient quota does not work with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | change |
| password | %public% |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | edit |
| password | %public% |
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API
Then the HTTP status code should be "507"
@skipOnReva
Scenario: uploading file to a public shared folder with upload-only permission when the sharer has insufficient quota does not work with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | create |
| password | %public% |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API
Then the HTTP status code should be "507"
@smokeTest
Scenario: uploading to a public upload-write and no edit and no overwrite share with public API
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | uploadwriteonly |
| password | %public% |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
When the public uploads file "test.txt" with password "%public%" and content "test2" using the new public WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test2"
@smokeTest @issue-1267
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
| path | FOLDER |
| permissions | uploadwriteonly |
| password | %public% |
Given using SharingNG
And user "Alice" has created the following resource link share:
| resource | FOLDER |
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
When the public uploads file "test.txt" with password "%public%" and content "test" using the new public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions