From 56e24e14dbbd652ea68e6c8433551372ad0ad855 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Wed, 12 Feb 2025 16:17:23 +0545 Subject: [PATCH] test: combine similar steps --- tests/acceptance/bootstrap/SpacesContext.php | 3 +-- .../features/apiGraph/userGDPRExport.feature | 2 +- .../acceptance/features/apiSpaces/changeSpaces.feature | 2 +- tests/acceptance/features/apiSpaces/quota.feature | 4 ++-- .../features/apiSpacesShares/shareOperations.feature | 8 ++++---- .../uploadToShare.feature | 10 +++++----- .../uploadToPublicLinkShare.feature | 4 ++-- .../features/coreApiWebdavProperties/getQuota.feature | 8 ++++---- 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index fb8979b2f70..231764af8b9 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -1623,8 +1623,7 @@ class SpacesContext implements Context { } /** - * @Given /^user "([^"]*)" has changed the quota of the personal space of "([^"]*)" space to "([^"]*)"$/ - * @Given /^user "([^"]*)" has changed the quota of the "([^"]*)" space to "([^"]*)"$/ + * @Given /^user "([^"]*)" has changed the quota of space "([^"]*)" to "([^"]*)"$/ * * @param string $user * @param string $spaceName diff --git a/tests/acceptance/features/apiGraph/userGDPRExport.feature b/tests/acceptance/features/apiGraph/userGDPRExport.feature index 1f2a0aa7b25..c7361b4fb98 100644 --- a/tests/acceptance/features/apiGraph/userGDPRExport.feature +++ b/tests/acceptance/features/apiGraph/userGDPRExport.feature @@ -411,7 +411,7 @@ Feature: user GDPR (General Data Protection Regulation) report Scenario: generate a GDPR report after the admin updates the quota of personal space - Given user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10000" + Given user "Admin" has changed the quota of space "Alice Hansen" to "10000" When user "Alice" exports her GDPR report to "/.personal_data_export.json" using the Graph API And user "Alice" downloads the content of GDPR report ".personal_data_export.json" Then the HTTP status code of responses on each endpoint should be "202, 200" respectively diff --git a/tests/acceptance/features/apiSpaces/changeSpaces.feature b/tests/acceptance/features/apiSpaces/changeSpaces.feature index 8222adb6c12..03d5dc97ede 100644 --- a/tests/acceptance/features/apiSpaces/changeSpaces.feature +++ b/tests/acceptance/features/apiSpaces/changeSpaces.feature @@ -519,7 +519,7 @@ Feature: Change data of space Scenario Outline: user can't upload resource greater than set quota Given the administrator has assigned the role "" to user "Alice" using the Graph API - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "15" + And user "Admin" has changed the quota of space "Alice Hansen" to "15" When user "Alice" uploads a file inside space "Alice Hansen" with content "file is more than 15 bytes" to "file.txt" using the WebDAV API Then the HTTP status code should be "507" And for user "Alice" the space "Personal" should not contain these entries: diff --git a/tests/acceptance/features/apiSpaces/quota.feature b/tests/acceptance/features/apiSpaces/quota.feature index d7e61755d12..2b95e1cb010 100644 --- a/tests/acceptance/features/apiSpaces/quota.feature +++ b/tests/acceptance/features/apiSpaces/quota.feature @@ -108,7 +108,7 @@ Feature: State of the quota Scenario Outline: check the relative amount of quota of personal space - Given user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10000" + Given user "Admin" has changed the quota of space "Alice Hansen" to "10000" And user "Alice" has uploaded file "" to "/demo.txt" When the user "Alice" requests these endpoints with "GET" with basic auth | endpoint | @@ -141,7 +141,7 @@ Feature: State of the quota Scenario: user can restore a file version even if there is not enough quota to do so - Given user "Admin" has changed the quota of the "Alice Hansen" space to "30" + Given user "Admin" has changed the quota of space "Alice Hansen" to "30" And user "Alice" has uploaded file with content "file is less than 30 bytes" to "/file.txt" And user "Alice" has uploaded file with content "reduceContent" to "/file.txt" And user "Alice" has uploaded file with content "some content" to "newFile.txt" diff --git a/tests/acceptance/features/apiSpacesShares/shareOperations.feature b/tests/acceptance/features/apiSpacesShares/shareOperations.feature index 095c3997070..51c5fce9f59 100644 --- a/tests/acceptance/features/apiSpacesShares/shareOperations.feature +++ b/tests/acceptance/features/apiSpacesShares/shareOperations.feature @@ -331,7 +331,7 @@ Feature: sharing | shareType | user | | permissionsRole | Editor | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/textfile.txt" should not exist @@ -348,7 +348,7 @@ Feature: sharing | shareType | group | | permissionsRole | Editor | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/textfile.txt" should not exist @@ -363,7 +363,7 @@ Feature: sharing | shareType | user | | permissionsRole | Uploader | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/textfile.txt" should not exist @@ -380,7 +380,7 @@ Feature: sharing | shareType | group | | permissionsRole | Uploader | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10" + And user "Admin" has changed the quota of space "Alice Hansen" to "10" When user "Brian" uploads a file inside space "Shares" with content "new descriptionfgshsywhhh" to "/FOLDER/textfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/textfile.txt" should not exist diff --git a/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature b/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature index 164752969e6..b521864e433 100644 --- a/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature +++ b/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature @@ -167,7 +167,7 @@ Feature: sharing Scenario Outline: check quota of owners parent directory of a shared file Given using DAV path And user "Brian" has been created with default attributes - And user "Admin" has changed the quota of the personal space of "Brian Murphy" space to "0" + And user "Admin" has changed the quota of space "Brian Murphy" to "0" And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/myfile.txt" And user "Alice" has sent the following resource share invitation: | resource | myfile.txt | @@ -204,7 +204,7 @@ Feature: sharing | shareType | user | | permissionsRole | Editor | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/myfile.txt" should not exist @@ -228,7 +228,7 @@ Feature: sharing | shareType | group | | permissionsRole | Editor | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/myfile.txt" should not exist @@ -250,7 +250,7 @@ Feature: sharing | shareType | user | | permissionsRole | Uploader | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/myfile.txt" should not exist @@ -274,7 +274,7 @@ Feature: sharing | shareType | group | | permissionsRole | Uploader | And user "Brian" has a share "FOLDER" synced - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API Then the HTTP status code should be "507" And as "Alice" file "/FOLDER/myfile.txt" should not exist diff --git a/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature index c1580ecabca..b919a364226 100644 --- a/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink2/uploadToPublicLinkShare.feature @@ -86,7 +86,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | edit | | password | %public% | - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API Then the HTTP status code should be "507" @@ -98,7 +98,7 @@ Feature: upload to a public link share | space | Personal | | permissionsRole | createOnly | | password | %public% | - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1" + And user "Admin" has changed the quota of space "Alice Hansen" to "1" When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API Then the HTTP status code should be "507" diff --git a/tests/acceptance/features/coreApiWebdavProperties/getQuota.feature b/tests/acceptance/features/coreApiWebdavProperties/getQuota.feature index 2802588b6d7..7985b957566 100644 --- a/tests/acceptance/features/coreApiWebdavProperties/getQuota.feature +++ b/tests/acceptance/features/coreApiWebdavProperties/getQuota.feature @@ -36,8 +36,8 @@ Feature: get quota Scenario Outline: retrieving folder quota of shared folder with quota when no quota is set for recipient Given using DAV path And user "Brian" has been created with default attributes - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "0" - And user "Admin" has changed the quota of the personal space of "Brian Murphy" space to "10000" + And user "Admin" has changed the quota of space "Alice Hansen" to "0" + And user "Admin" has changed the quota of space "Brian Murphy" to "10000" And user "Brian" has created folder "/testquota" And user "Brian" has uploaded file "/testquota/Brian.txt" of size 1000 bytes And user "Brian" has sent the following resource share invitation: @@ -61,7 +61,7 @@ Feature: get quota @issue-8197 Scenario Outline: retrieving folder quota when quota is set and a file was uploaded Given using DAV path - And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10000" + And user "Admin" has changed the quota of space "Alice Hansen" to "10000" And user "Alice" has uploaded file "/prueba.txt" of size 1000 bytes When user "Alice" gets the following properties of folder "/" using the WebDAV API | propertyName | @@ -78,7 +78,7 @@ Feature: get quota Scenario Outline: retrieving folder quota when quota is set and a file was received Given using DAV path And user "Brian" has been created with default attributes - And user "Admin" has changed the quota of the personal space of "Brian Murphy" space to "10000" + And user "Admin" has changed the quota of space "Brian Murphy" to "10000" And user "Alice" has uploaded file "/Alice.txt" of size 93 bytes And user "Alice" has sent the following resource share invitation: | resource | Alice.txt |