From b2de5661bfa0383d30effeb00d98a924024d3ae3 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 17 May 2024 12:34:34 +0545 Subject: [PATCH] uploadToPublicLinkShare.feature: Used sharingNG for sharing in given step --- tests/acceptance/config/behat-core.yml | 1 - .../features/bootstrap/SharingNgContext.php | 2 +- .../uploadToPublicLinkShare.feature | 90 +++++++++++-------- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml index 678d8fa192..2ffb618aae 100644 --- a/tests/acceptance/config/behat-core.yml +++ b/tests/acceptance/config/behat-core.yml @@ -152,7 +152,6 @@ default: - TrashbinContext: - WebDavPropertiesContext: - OcisConfigContext: - - SpacesContext: - SharingNgContext: coreApiShareUpdateToShares: diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index 80c2b8cc66..a163d04e91 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -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, diff --git a/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature index f4ba4eaf1c..87dbf8aee3 100644 --- a/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature @@ -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 - 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