From 6ab255b1413adeadb687c74e9836f495e15359fd Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 15 May 2024 15:58:59 +0545 Subject: [PATCH] copyFromPublicLink.feature: Used sharingNG for sharing in given step --- tests/acceptance/config/behat-core.yml | 2 + .../expected-failures-API-on-OCIS-storage.md | 12 +-- .../bootstrap/PublicWebDavContext.php | 2 +- .../copyFromPublicLink.feature | 96 ++++++++++++------- 4 files changed, 69 insertions(+), 43 deletions(-) diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml index 8329ed0e3..678d8fa19 100644 --- a/tests/acceptance/config/behat-core.yml +++ b/tests/acceptance/config/behat-core.yml @@ -152,6 +152,8 @@ default: - TrashbinContext: - WebDavPropertiesContext: - OcisConfigContext: + - SpacesContext: + - SharingNgContext: coreApiShareUpdateToShares: paths: diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 25b8aaad6..e0c335352 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -94,12 +94,12 @@ cannot share a folder with create permission #### [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) -- [coreApiSharePublicLink2/copyFromPublicLink.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L67) -- [coreApiSharePublicLink2/copyFromPublicLink.feature:93](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L93) -- [coreApiSharePublicLink2/copyFromPublicLink.feature:177](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L177) -- [coreApiSharePublicLink2/copyFromPublicLink.feature:178](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L178) -- [coreApiSharePublicLink2/copyFromPublicLink.feature:193](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L193) -- [coreApiSharePublicLink2/copyFromPublicLink.feature:194](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L194) +- [coreApiSharePublicLink2/copyFromPublicLink.feature:75](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L75) +- [coreApiSharePublicLink2/copyFromPublicLink.feature:105](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L105) +- [coreApiSharePublicLink2/copyFromPublicLink.feature:199](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L199) +- [coreApiSharePublicLink2/copyFromPublicLink.feature:200](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L200) +- [coreApiSharePublicLink2/copyFromPublicLink.feature:217](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L217) +- [coreApiSharePublicLink2/copyFromPublicLink.feature:218](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L218) #### [d:quota-available-bytes in dprop of PROPFIND give wrong response value](https://github.com/owncloud/ocis/issues/8197) diff --git a/tests/acceptance/features/bootstrap/PublicWebDavContext.php b/tests/acceptance/features/bootstrap/PublicWebDavContext.php index 7aa20fa6a..1a2c4e1af 100644 --- a/tests/acceptance/features/bootstrap/PublicWebDavContext.php +++ b/tests/acceptance/features/bootstrap/PublicWebDavContext.php @@ -482,7 +482,7 @@ class PublicWebDavContext implements Context { * @return void */ public function thePublicCopiesFileUsingTheWebDAVApi(string $source, string $destination, string $publicWebDAVAPIVersion):void { - $token = $this->featureContext->getLastCreatedPublicShareToken(); + $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $davPath = WebDavHelper::getDavPath( $token, 0, diff --git a/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature b/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature index c9a8f6307..1f39d8e5d 100644 --- a/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature +++ b/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature @@ -12,9 +12,11 @@ Feature: copying from public link share Scenario: copy file within a public link folder new public WebDAV API Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/copy1.txt" using the new public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -26,9 +28,11 @@ Feature: copying from public link share Scenario: copy folder within a public link folder new public WebDAV API Given user "Alice" has created folder "/PARENT/testFolder" And user "Alice" has uploaded file with content "some data" to "/PARENT/testFolder/testfile.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies folder "/testFolder" to "/testFolder-copy" using the new public WebDAV API Then the HTTP status code should be "201" And as "Alice" folder "/PARENT/testFolder" should exist @@ -40,9 +44,11 @@ Feature: copying from public link share Scenario: copy file within a public link folder to a new folder Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" And user "Alice" has created folder "/PARENT/testFolder" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/testFolder/copy1.txt" using the new public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -54,9 +60,11 @@ Feature: copying from public link share Scenario: copy file within a public link folder to same file name as already existing one Given user "Alice" has uploaded file with content "some data 0" to "/PARENT/testfile.txt" And user "Alice" has uploaded file with content "some data 1" to "/PARENT/copy1.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/copy1.txt" using the new public WebDAV API Then the HTTP status code should be "204" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -68,9 +76,11 @@ Feature: copying from public link share Given user "Alice" has created folder "/PARENT/testFolder" And user "Alice" has uploaded file with content "some data" to "/PARENT/testFolder/testfile.txt" And user "Alice" has uploaded file with content "some data 1" to "/PARENT/copy1.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies folder "/testFolder" to "/copy1.txt" using the new public WebDAV API Then the HTTP status code should be "403" And as "Alice" folder "/PARENT/testFolder" should exist @@ -81,9 +91,11 @@ Feature: copying from public link share Scenario: copy file within a public link folder and delete file Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/copy1.txt" using the new public WebDAV API And user "Alice" deletes file "/PARENT/copy1.txt" using the WebDAV API Then the HTTP status code should be "204" @@ -94,9 +106,11 @@ Feature: copying from public link share Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" And user "Alice" has created folder "/PARENT/new-folder" And user "Alice" has uploaded file with content "some data 1" to "/PARENT/new-folder/testfile1.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/new-folder" using the new public WebDAV API Then the HTTP status code should be "403" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -107,9 +121,11 @@ Feature: copying from public link share Scenario Outline: copy file with special characters in it's name within a public link folder Given user "Alice" has uploaded file with content "some data" to "/PARENT/" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/" to "/copy1.txt" using the new public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/" should exist @@ -126,9 +142,11 @@ Feature: copying from public link share Scenario Outline: copy file within a public link folder to a file with special characters in it's name Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/" using the new public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -146,9 +164,11 @@ Feature: copying from public link share Scenario Outline: copy file within a public link folder into a folder with special characters Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" And user "Alice" has created folder "/PARENT/" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "//copy1.txt" using the new public WebDAV API Then the HTTP status code should be "201" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -165,9 +185,11 @@ Feature: copying from public link share @issue-1230 Scenario Outline: copy file within a public link folder to a file with unusual destination names Given user "Alice" has uploaded file with content "some data" to "/PARENT/testfile.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies file "/testfile.txt" to "/" using the new public WebDAV API Then the HTTP status code should be "403" And as "Alice" file "/PARENT/testfile.txt" should exist @@ -181,9 +203,11 @@ Feature: copying from public link share Scenario Outline: copy folder within a public link folder to a folder with unusual destination names Given user "Alice" has created folder "/PARENT/testFolder" And user "Alice" has uploaded file with content "some data" to "/PARENT/testFolder/testfile.txt" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read,update,create,delete | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | edit | When the public copies folder "/testFolder" to "/" using the new public WebDAV API Then the HTTP status code should be "403" And as "Alice" folder "/PARENT/testFolder" should exist