From 489bebdb1383d2fa136749144241ee47827c40e2 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 2 Oct 2020 17:20:35 +0545 Subject: [PATCH] sharing related etag tests --- tests/acceptance/config/behat.yml | 1 + .../createFolder.feature | 39 +++++ .../deleteFileFolder.feature | 90 +++++++++++ .../moveFileFolder.feature | 147 ++++++++++++++++++ .../apiWebdavEtagPropagation/upload.feature | 72 +++++++++ 5 files changed, 349 insertions(+) diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 1129df9e4779..c91d938ce7be 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -571,6 +571,7 @@ default: - PublicWebDavContext: - FilesVersionsContext: - WebDavPropertiesContext: + - AppConfigurationContext: apiTranslation: paths: diff --git a/tests/acceptance/features/apiWebdavEtagPropagation/createFolder.feature b/tests/acceptance/features/apiWebdavEtagPropagation/createFolder.feature index 410575f33df6..97df17f1898c 100644 --- a/tests/acceptance/features/apiWebdavEtagPropagation/createFolder.feature +++ b/tests/acceptance/features/apiWebdavEtagPropagation/createFolder.feature @@ -3,6 +3,8 @@ Feature: propagation of etags when creating folders Background: Given user "Alice" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" Scenario Outline: creating a folder inside a folder changes its etag Given using DAV path @@ -32,3 +34,40 @@ Feature: propagation of etags when creating folders | new | | | new | folder | | new | folder/sub | + + Scenario Outline: as share receiver creating a folder inside a folder received as a share changes its etag for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has created folder "/folder" + And user "Alice" has shared folder "/folder" with user "Brian" + And user "Brian" has accepted share "/folder" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" creates folder "/Shares/folder/new" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | folder | + | new | | + | new | folder | + + Scenario Outline: as sharer creating a folder inside a folder received as a share changes its etag for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has created folder "/folder" + And user "Alice" has shared folder "/folder" with user "Brian" + And user "Brian" has accepted share "/folder" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" creates folder "/folder/new" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | folder | + | new | | + | new | folder | + diff --git a/tests/acceptance/features/apiWebdavEtagPropagation/deleteFileFolder.feature b/tests/acceptance/features/apiWebdavEtagPropagation/deleteFileFolder.feature index efdb13f202cd..a2bce4f2e676 100644 --- a/tests/acceptance/features/apiWebdavEtagPropagation/deleteFileFolder.feature +++ b/tests/acceptance/features/apiWebdavEtagPropagation/deleteFileFolder.feature @@ -3,6 +3,8 @@ Feature: propagation of etags when deleting a file or folder Background: Given user "Alice" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" And user "Alice" has created folder "/upload" Scenario Outline: deleting a file changes the etags of all parents @@ -53,3 +55,91 @@ Feature: propagation of etags when deleting a file or folder | new | | | new | upload | | new | upload/sub | + + Scenario Outline: as share receiver deleting a file changes the etags of all parents for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has created folder "/upload/sub" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" deletes file "/Shares/upload/sub/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | old | upload/sub | + | new | | + | new | upload | + | new | upload/sub | + + Scenario Outline: as sharer deleting a file changes the etags of all parents for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has created folder "/upload/sub" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" deletes file "/upload/sub/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | old | upload/sub | + | new | | + | new | upload | + | new | upload/sub | + + Scenario Outline: as share receiver deleting a folder changes the etags of all parents for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/upload/sub" + And user "Alice" has created folder "/upload/sub/toDelete" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" deletes file "/Shares/upload/sub/toDelete" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | old | upload/sub | + | new | | + | new | upload | + | new | upload/sub | + + Scenario Outline: as sharer deleting a folder changes the etags of all parents for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/upload/sub" + And user "Alice" has created folder "/upload/sub/toDelete" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" deletes file "/upload/sub/toDelete" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | old | upload/sub | + | new | | + | new | upload | + | new | upload/sub | diff --git a/tests/acceptance/features/apiWebdavEtagPropagation/moveFileFolder.feature b/tests/acceptance/features/apiWebdavEtagPropagation/moveFileFolder.feature index 9cf35d858a98..e06e204dcc89 100644 --- a/tests/acceptance/features/apiWebdavEtagPropagation/moveFileFolder.feature +++ b/tests/acceptance/features/apiWebdavEtagPropagation/moveFileFolder.feature @@ -99,3 +99,150 @@ Feature: propagation of etags when moving files or folders | new | | | new | upload | | new | upload/sub | + + Scenario Outline: as share receiver renaming a file inside a folder changes its etag for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/upload" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" moves file "/Shares/upload/file.txt" to "/Shares/upload/renamed.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | new | | + | new | upload | + + Scenario Outline: as sharer renaming a file inside a folder changes its etag for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/upload" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" moves file "/upload/file.txt" to "/upload/renamed.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | new | | + | new | upload | + + + Scenario Outline: as share receiver moving a file from one folder to an other changes the etags of both folders for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/src" + And user "Alice" has created folder "/dst" + And user "Alice" has uploaded file with content "uploaded content" to "/src/file.txt" + And user "Alice" has shared folder "/src" with user "Brian" + And user "Brian" has accepted share "/src" offered by user "Alice" + And user "Alice" has shared folder "/dst" with user "Brian" + And user "Brian" has accepted share "/dst" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" moves file "/src/file.txt" to "/dst/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | src | + | old | dst | + | new | | + | new | src | + | new | dst | + + Scenario Outline: as sharer moving a file from one folder to an other changes the etags of both folders for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/src" + And user "Alice" has created folder "/dst" + And user "Alice" has uploaded file with content "uploaded content" to "/src/file.txt" + And user "Alice" has shared folder "/src" with user "Brian" + And user "Brian" has accepted share "/src" offered by user "Alice" + And user "Alice" has shared folder "/dst" with user "Brian" + And user "Brian" has accepted share "/dst" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" moves file "/Shares/src/file.txt" to "/Shares/dst/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | src | + | old | dst | + | new | | + | new | src | + | new | dst | + + Scenario Outline: as share receiver moving a folder from one folder to an other changes the etags of both folders for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/src" + And user "Alice" has created folder "/dst" + And user "Alice" has created folder "/src/toMove" + And user "Alice" has shared folder "/src" with user "Brian" + And user "Brian" has accepted share "/src" offered by user "Alice" + And user "Alice" has shared folder "/dst" with user "Brian" + And user "Brian" has accepted share "/dst" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" moves folder "/src/toMove" to "/dst/toMove" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | src | + | old | dst | + | new | | + | new | src | + | new | dst | + + Scenario Outline: as sharer moving a folder from one folder to an other changes the etags of both folders for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" + And using DAV path + And user "Alice" has created folder "/src" + And user "Alice" has created folder "/dst" + And user "Alice" has created folder "/src/toMove" + And user "Alice" has shared folder "/src" with user "Brian" + And user "Brian" has accepted share "/src" offered by user "Alice" + And user "Alice" has shared folder "/dst" with user "Brian" + And user "Brian" has accepted share "/dst" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" moves folder "/Shares/src/toMove" to "/Shares/dst/toMove" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | src | + | old | dst | + | new | | + | new | src | + | new | dst | diff --git a/tests/acceptance/features/apiWebdavEtagPropagation/upload.feature b/tests/acceptance/features/apiWebdavEtagPropagation/upload.feature index 473b8f2d8213..ddd6e36c1609 100644 --- a/tests/acceptance/features/apiWebdavEtagPropagation/upload.feature +++ b/tests/acceptance/features/apiWebdavEtagPropagation/upload.feature @@ -3,6 +3,8 @@ Feature: propagation of etags when uploading data Background: Given user "Alice" has been created with default attributes and without skeleton files + And the administrator has set the default folder for received shares to "Shares" + And parameter "shareapi_auto_accept_share" of app "core" has been set to "no" And user "Alice" has created folder "/upload" Scenario Outline: uploading a file inside a folder changes its etag @@ -33,3 +35,73 @@ Feature: propagation of etags when uploading data | new | | | new | upload | | new | upload/file.txt | + + Scenario Outline: as share receiver uploading a file inside a received shared folder should update etags for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" uploads file with content "uploaded content" to "/Shares/upload/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | new | | + | new | upload | + + Scenario Outline: as sharer uploading a file inside a shared folder should update etags for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" uploads file with content "uploaded content" to "/upload/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | new | | + | new | upload | + + Scenario Outline: as share receiver overwriting a file inside a received shared folder should update etags for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Brian" uploads file with content "new content" to "/Shares/upload/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | new | | + | new | upload | + + Scenario Outline: as sharer overwriting a file inside a shared folder should update etags for all collaborators + Given user "Brian" has been created with default attributes and without skeleton files + And using DAV path + And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" + And user "Brian" has stored etag of element "/Shares/" + When user "Alice" uploads file with content "new content" to "/upload/file.txt" using the WebDAV API + Then the etag of element "/" of user "Alice" should have changed + And the etag of element "/Shares/" of user "Brian" should have changed + Examples: + | dav_version | element | + | old | | + | old | upload | + | new | | + | new | upload |