diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 43b28ce227..e5dad7be11 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -332,14 +332,14 @@ API, search, favorites, config, capabilities, not existing endpoints, CORS and o #### [Ability to return error messages in Webdav response bodies](https://github.com/owncloud/ocis/issues/1293) -- [coreApiAuthOcs/ocsDELETEAuth.feature:10](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsDELETEAuth.feature#L10) +- [coreApiAuthOcs/ocsDELETEAuth.feature:7](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsDELETEAuth.feature#L7) - [coreApiAuthOcs/ocsGETAuth.feature:10](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature#L10) - [coreApiAuthOcs/ocsGETAuth.feature:44](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature#L44) - [coreApiAuthOcs/ocsGETAuth.feature:75](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature#L75) - [coreApiAuthOcs/ocsGETAuth.feature:106](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature#L106) - [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) +- [coreApiAuthOcs/ocsPUTAuth.feature:7](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature#L7) - [coreApiSharePublicLink1/createPublicLinkShare.feature:317](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature#L317) #### [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) @@ -432,7 +432,7 @@ And other missing implementation of favorites #### [Request to edit non-existing user by authorized admin gets unauthorized in http response](https://github.com/owncloud/core/issues/38423) -- [coreApiAuthOcs/ocsPUTAuth.feature:26](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature#L26) +- [coreApiAuthOcs/ocsPUTAuth.feature:22](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature#L22) #### [Sharing a same file twice to the same group](https://github.com/owncloud/ocis/issues/1710) diff --git a/tests/acceptance/features/bootstrap/AuthContext.php b/tests/acceptance/features/bootstrap/AuthContext.php index 1e401e2b43..bf414895ea 100644 --- a/tests/acceptance/features/bootstrap/AuthContext.php +++ b/tests/acceptance/features/bootstrap/AuthContext.php @@ -276,8 +276,17 @@ class AuthContext implements Context { * @return void * @throws Exception */ - public function adminRequestsEndpoint(string $method, TableNode $table):void { - $this->adminRequestsEndpointsWithBodyWithPassword($method, null, null, null, $table); + public function theAdminRequestsTheseEndpointsWithMethod(string $method, TableNode $table):void { + $this->featureContext->verifyTableNodeColumns($table, ['endpoint']); + foreach ($table->getHash() as $row) { + $response = $this->requestUrlWithBasicAuth( + $this->featureContext->getAdminUsername(), + $row['endpoint'], + $method + ); + $this->featureContext->setResponse($response); + $this->featureContext->pushToLastStatusCodesArrays(); + } } /** diff --git a/tests/acceptance/features/coreApiAuthOcs/ocsDELETEAuth.feature b/tests/acceptance/features/coreApiAuthOcs/ocsDELETEAuth.feature index c1fad2e7c1..b0ae434103 100644 --- a/tests/acceptance/features/coreApiAuthOcs/ocsDELETEAuth.feature +++ b/tests/acceptance/features/coreApiAuthOcs/ocsDELETEAuth.feature @@ -3,13 +3,9 @@ Feature: auth I want to send delete request with wrong password So that I can make sure it doesn't work - Background: - Given user "another-admin" has been created with default attributes and without skeleton files - @smokeTest @issue-1337 @issue-1319 Scenario: send DELETE requests to OCS endpoints as admin with wrong password - Given user "another-admin" has been added to group "admin" - When user "another-admin" requests these endpoints with "DELETE" using password "invalid" about user "Alice" + When user "admin" requests these endpoints with "DELETE" using password "invalid" about user "Alice" | endpoint | | /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/123 | | /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/123 | diff --git a/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature b/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature index 2296ab5369..c08c0eff48 100644 --- a/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature +++ b/tests/acceptance/features/coreApiAuthOcs/ocsGETAuth.feature @@ -121,9 +121,7 @@ Feature: auth @issue-1337 @issue-1319 Scenario: using OCS as admin user with wrong password - Given user "another-admin" has been created with default attributes and without skeleton files - And user "another-admin" has been added to group "admin" - When user "another-admin" requests these endpoints with "GET" using password "invalid" + When user "admin" requests these endpoints with "GET" using password "invalid" | endpoint | | /ocs/v1.php/apps/files_sharing/api/v1/remote_shares | | /ocs/v2.php/apps/files_sharing/api/v1/remote_shares | diff --git a/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature b/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature index 71cbbd409b..3ab00a67cf 100644 --- a/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature +++ b/tests/acceptance/features/coreApiAuthOcs/ocsPUTAuth.feature @@ -3,13 +3,9 @@ Feature: auth I want to send PUT request to various endpoints So that I can make sure the endpoints need proper authentication - Background: - Given user "another-admin" has been created with default attributes and without skeleton files - @issue-1337 @smokeTest Scenario: send PUT request to OCS endpoints as admin with wrong password - Given user "another-admin" has been added to group "admin" - When user "another-admin" requests these endpoints with "PUT" including body "doesnotmatter" using password "invalid" about user "Alice" + When user "admin" requests these endpoints with "PUT" including body "doesnotmatter" using password "invalid" about user "Alice" | endpoint | | /ocs/v1.php/cloud/users/%username% | | /ocs/v2.php/cloud/users/%username% | @@ -24,8 +20,7 @@ Feature: auth Scenario: request to edit nonexistent user by authorized admin gets unauthorized in http response - Given user "another-admin" has been added to group "admin" - When user "another-admin" requests these endpoints with "PUT" including body "doesnotmatter" about user "nonexistent" + When user "admin" requests these endpoints with "PUT" including body "doesnotmatter" about user "nonexistent" | endpoint | | /ocs/v1.php/cloud/users/%username% | | /ocs/v2.php/cloud/users/%username% |