diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 1fb90155d32..cf779af18b3 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -204,7 +204,7 @@ cannot share a folder with create permission #### [Public link enforce permissions](https://github.com/owncloud/ocis/issues/1269) -- [coreApiSharePublicLink1/createPublicLinkShare.feature:329](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature#L329) +- [coreApiSharePublicLink1/createPublicLinkShare.feature:328](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature#L328) #### [copying a folder within a public link folder to folder with same name as an already existing file overwrites the parent file](https://github.com/owncloud/ocis/issues/1232) @@ -340,7 +340,7 @@ API, search, favorites, config, capabilities, not existing endpoints, CORS and o - [coreApiAuthOcs/ocsGETAuth.feature:123](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature#L123) - [coreApiAuthOcs/ocsPOSTAuth.feature:10](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsPOSTAuth.feature#L10) - [coreApiAuthOcs/ocsPUTAuth.feature:10](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature#L10) -- [coreApiSharePublicLink1/createPublicLinkShare.feature:319](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature#L319) +- [coreApiSharePublicLink1/createPublicLinkShare.feature:318](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature#L318) #### [sending MKCOL requests to another or non-existing user's webDav endpoints as normal user should return 404](https://github.com/owncloud/ocis/issues/5049) diff --git a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature index c2c05825864..36869f78777 100644 --- a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature +++ b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature @@ -42,9 +42,9 @@ Feature: A manager of the space can edit public link | share_type | public_link | | displayname_owner | %displayname% | | name | | - 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 "" When the public downloads file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "" - Then the downloaded content should be "some content" + Then the HTTP status code should be "200" + And the downloaded content should be "some content" Examples: | permissions | expectedPermissions | password | linkName | | 5 | read,create | newPass | | diff --git a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature index 832a36a6c92..31aa7eb7667 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature @@ -36,9 +36,9 @@ Feature: Share spaces via link | displayname_owner | %displayname% | | uid_owner | %username% | | name | | - 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 "" When the public downloads file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "" - Then the downloaded content should be "some content" + Then the HTTP status code should be "200" + 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 | diff --git a/tests/acceptance/features/bootstrap/PublicWebDavContext.php b/tests/acceptance/features/bootstrap/PublicWebDavContext.php index bacb5315700..bdc802b484a 100644 --- a/tests/acceptance/features/bootstrap/PublicWebDavContext.php +++ b/tests/acceptance/features/bootstrap/PublicWebDavContext.php @@ -56,7 +56,7 @@ public function downloadPublicFileWithRange(string $range, string $publicWebDAVA } else { $path = ""; } - return $this->downloadTheFileInsideThePublicSharedFolder( + return $this->downloadFileFromPublicFolder( $path, $password, $range, @@ -79,7 +79,7 @@ public function downloadPublicFileWithRangeAndPassword(string $range, string $pa } else { $path = ""; } - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, $password, $range, @@ -232,7 +232,7 @@ public function thePublicRenamesFileFromTheLastPublicShareUsingThePasswordPasswo * @return void */ public function downloadPublicFileInsideAFolder(string $path, string $publicWebDAVAPIVersion = "old"):void { - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, "", "", @@ -251,7 +251,7 @@ public function downloadPublicFileInsideAFolder(string $path, string $publicWebD * @return void */ public function downloadPublicFileInsideAFolderWithPassword(string $path, string $publicWebDAVAPIVersion = "old", string $password = ""):void { - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, $password, "", @@ -260,26 +260,6 @@ public function downloadPublicFileInsideAFolderWithPassword(string $path, string $this->featureContext->setResponse($response); } - /** - * @param string $path - * @param string|null $password - * @param string $publicWebDAVAPIVersion - * - * @return ResponseInterface - */ - public function downloadTheFileInsideThePublicSharedFolderWithPassword( - string $path, - ?string $password = "", - string $publicWebDAVAPIVersion = "old" - ):ResponseInterface { - return $this->downloadTheFileInsideThePublicSharedFolder( - $path, - $password, - "", - $publicWebDAVAPIVersion - ); - } - /** * @When /^the public downloads file "([^"]*)" from inside the last public link shared folder with range "([^"]*)" using the (old|new) public WebDAV API$/ * @@ -290,7 +270,7 @@ public function downloadTheFileInsideThePublicSharedFolderWithPassword( * @return void */ public function downloadPublicFileInsideAFolderWithRange(string $path, string $range, string $publicWebDAVAPIVersion):void { - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, "", $range, @@ -307,7 +287,7 @@ public function downloadPublicFileInsideAFolderWithRange(string $path, string $r * * @return ResponseInterface */ - public function downloadTheFileInsideThePublicSharedFolder( + public function downloadFileFromPublicFolder( string $path, string $password, string $range, @@ -885,9 +865,10 @@ public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPasswordAn return; } - $response = $this->downloadTheFileInsideThePublicSharedFolderWithPassword( + $response = $this->downloadFileFromPublicFolder( $path, $password, + "", $publicWebDAVAPIVersion ); @@ -917,12 +898,12 @@ public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPasswordAn return; } - $response = $this->downloadTheFileInsideThePublicSharedFolderWithPassword( + $response = $this->downloadFileFromPublicFolder( $path, $password, + "", $publicWebDAVAPIVersion ); - $this->featureContext->checkDownloadedContentMatches($content, "", $response); $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); @@ -993,7 +974,7 @@ public function shouldBeAbleToDownloadRangeOfFileInsidePublicSharedFolderWithPas return; } - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, $password, $range, @@ -1025,7 +1006,7 @@ public function shouldNotBeAbleToDownloadRangeOfFileInsidePublicSharedFolderWith return; } - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, $password, $range, @@ -1252,7 +1233,7 @@ public function publiclyUploadingShouldWork(string $publicWebDAVAPIVersion):void $path, $publicWebDAVAPIVersion ); - $response = $this->downloadTheFileInsideThePublicSharedFolder( + $response = $this->downloadFileFromPublicFolder( $path, "", "", diff --git a/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature index 195e76a4070..67ca2eda7af 100644 --- a/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature @@ -59,13 +59,12 @@ Feature: create a public link share | uid_owner | %username% | | name | | And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data" - And the HTTP status code should be "200" - And the public download of the last publicly shared file using the new public WebDAV API with password "%regular%" should fail with HTTP status code "401" When the public downloads the last public link shared file with password "%regular%" using the new public WebDAV API - Then the value of the item "//s:message" in the response should match "/Username or password was incorrect/" - And the public download of the last publicly shared file using the new public WebDAV API without a password should fail with HTTP status code "401" + Then the HTTP status code should be "401" + And the value of the item "//s:message" in the response should match "/Username or password was incorrect/" When the public downloads the last public link shared file using the new public WebDAV API - Then the value of the item "//s:message" in the response should match "/No 'Authorization: Basic' header found/" + Then the HTTP status code should be "401" + And the value of the item "//s:message" in the response should match "/No 'Authorization: Basic' header found/" Examples: | ocs_api_version | ocs_status_code | | 1 | 100 | diff --git a/tests/acceptance/features/coreApiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature b/tests/acceptance/features/coreApiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature index 31dcdaa8cf2..48728c54c1a 100644 --- a/tests/acceptance/features/coreApiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature +++ b/tests/acceptance/features/coreApiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature @@ -37,9 +37,9 @@ Feature: reshare as public link | publicUpload | false | Then the OCS status code should be "" And the HTTP status code should be "200" - And the public should be able to download file "file.txt" from inside the last public link shared folder using the new public WebDAV API When the public downloads file "file.txt" from inside the last public link shared folder using the new public WebDAV API - Then the downloaded content should be "some content" + Then the HTTP status code should be "200" + And the downloaded content should be "some content" But uploading a file should not work using the new public WebDAV API Examples: | ocs_api_version | ocs_status_code | @@ -91,9 +91,9 @@ Feature: reshare as public link | publicUpload | false | Then the OCS status code should be "" And the HTTP status code should be "200" - And the public should be able to download file "file.txt" from inside the last public link shared folder using the new public WebDAV API When the public downloads file "file.txt" from inside the last public link shared folder using the new public WebDAV API - Then the downloaded content should be "some content" + Then the HTTP status code should be "200" + And the downloaded content should be "some content" But uploading a file should not work using the new public WebDAV API Examples: | ocs_api_version | ocs_status_code | @@ -113,9 +113,9 @@ Feature: reshare as public link | publicUpload | true | Then the OCS status code should be "" And the HTTP status code should be "200" - And the public should be able to download file "file.txt" from inside the last public link shared folder using the new public WebDAV API When the public downloads file "file.txt" from inside the last public link shared folder using the new public WebDAV API - Then the downloaded content should be "some content" + Then the HTTP status code should be "200" + And the downloaded content should be "some content" And uploading a file should work using the new public WebDAV API Examples: | ocs_api_version | ocs_status_code |