From f98304cac62906cca9a0d7c82fb5f2c40fa13938 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 17 May 2024 15:17:11 +0545 Subject: [PATCH] listFiles.feature: Used sharingNG for sharing in given step --- tests/acceptance/config/behat-core.yml | 2 ++ tests/acceptance/features/bootstrap/WebDav.php | 12 ++++-------- .../coreApiWebdavOperations/listFiles.feature | 12 ++++++++++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml index 62c2e7e0d7..696f4b0374 100644 --- a/tests/acceptance/config/behat-core.yml +++ b/tests/acceptance/config/behat-core.yml @@ -253,6 +253,8 @@ default: - FeatureContext: *common_feature_context_params - SearchContext: - PublicWebDavContext: + - SpacesContext: + - SharingNgContext: - WebDavPropertiesContext: - TrashbinContext: - OcisConfigContext: diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index ae6ede1708..abfb99a3d4 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -5463,16 +5463,12 @@ trait WebDav { * @throws Exception */ public function theLastPublicDavResponseShouldContainTheseNodes(TableNode $table):void { - if ($this->isUsingSharingNG()) { - $user = $this->shareNgGetLastCreatedLinkShareToken(); - } else { - $user = $this->getLastCreatedPublicShareToken(); - } + $token = ($this->isUsingSharingNG()) ? $this->shareNgGetLastCreatedLinkShareToken() : $this->getLastCreatedPublicShareToken(); $this->verifyTableNodeColumns($table, ["name"]); $type = $this->usingOldDavPath ? "public-files" : "public-files-new"; foreach ($table->getHash() as $row) { $path = $this->substituteInLineCodes($row['name']); - $res = $this->findEntryFromPropfindResponse($path, $user, $type); + $res = $this->findEntryFromPropfindResponse($path, $token, $type); Assert::assertNotFalse($res, "expected $path to be in DAV response but was not found"); } } @@ -5486,12 +5482,12 @@ trait WebDav { * @throws Exception */ public function theLastPublicDavResponseShouldNotContainTheseNodes(TableNode $table):void { - $user = $this->getLastCreatedPublicShareToken(); + $token = ($this->isUsingSharingNG()) ? $this->shareNgGetLastCreatedLinkShareToken() : $this->getLastCreatedPublicShareToken(); $this->verifyTableNodeColumns($table, ["name"]); $type = $this->usingOldDavPath ? "public-files" : "public-files-new"; foreach ($table->getHash() as $row) { $path = $this->substituteInLineCodes($row['name']); - $res = $this->findEntryFromPropfindResponse($path, $user, $type); + $res = $this->findEntryFromPropfindResponse($path, $token, $type); Assert::assertFalse($res, "expected $path to not be in DAV response but was found"); } } diff --git a/tests/acceptance/features/coreApiWebdavOperations/listFiles.feature b/tests/acceptance/features/coreApiWebdavOperations/listFiles.feature index 8641d8e823..1cde683359 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/listFiles.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/listFiles.feature @@ -132,7 +132,11 @@ Feature: list files | path | | /simple-folder/simple-folder1/simple-folder2/simple-folder3 | | /simple-folder/simple-folder1/simple-folder2/simple-folder3/simple-folder4 | - And user "Alice" has created a public link share of folder "simple-folder" + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | simple-folder | + | space | Personal | + | permissionsRole | view | When the public lists the resources in the last created public link with depth "0" using the WebDAV API Then the HTTP status code should be "207" And the last public link DAV response should not contain these nodes @@ -156,7 +160,11 @@ Feature: list files | path | | /simple-folder/simple-folder1/simple-folder2/simple-folder3 | | /simple-folder/simple-folder1/simple-folder2/simple-folder3/simple-folder4 | - And user "Alice" has created a public link share of folder "simple-folder" + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | simple-folder | + | space | Personal | + | permissionsRole | view | When the public lists the resources in the last created public link with depth "1" using the WebDAV API Then the HTTP status code should be "207" And the last public link DAV response should contain these nodes