From 5f9469540de04d7064ec4da2c1fd35e7b54ec12a Mon Sep 17 00:00:00 2001 From: Salipa-Gurung Date: Thu, 29 Aug 2024 15:31:50 +0545 Subject: [PATCH] add test coverage for copying file using file id from project space --- .../copyByFileId.feature | 226 +++++++++++++++--- 1 file changed, 189 insertions(+), 37 deletions(-) diff --git a/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature b/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature index e4ee6407e3..b66f82c44a 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature @@ -163,23 +163,6 @@ Feature: copying file using file id | /dav/spaces/<> | - Scenario Outline: copy a file from project to personal space - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" - And we save it into "FILEID" - When user "Alice" copies a file "/textfile.txt" into "/" inside space "Personal" using file-id path "" - Then the HTTP status code should be "201" - And for user "Alice" folder "/" of the space "project-space" should contain these files: - | textfile.txt | - And for user "Alice" folder "/" of the space "Personal" should contain these files: - | textfile.txt | - Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | - - Scenario Outline: copy a file from sub-folder to root folder inside Shares space Given user "Brian" has been created with default attributes and without skeleton files And user "Alice" has created folder "/folder" @@ -266,26 +249,6 @@ Feature: copying file using file id | Uploader | /dav/spaces/<> | - Scenario Outline: copy a file between two project spaces - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "first-project-space" with the default quota using the Graph API - And user "Alice" has created a space "second-project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "first-project-space" with content "data from first project space" to "firstProjectSpacetextfile.txt" - And user "Alice" has uploaded a file inside space "second-project-space" with content "data from second project space" to "secondProjectSpacetextfile.txt" - And we save it into "FILEID" - When user "Alice" copies a file "/secondProjectSpacetextfile.txt" into "/" inside space "first-project-space" using file-id path "" - Then the HTTP status code should be "201" - And for user "Alice" folder "/" of the space "first-project-space" should contain these files: - | firstProjectSpacetextfile.txt | - | secondProjectSpacetextfile.txt | - And for user "Alice" folder "/" of the space "second-project-space" should contain these files: - | secondProjectSpacetextfile.txt | - Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | - - Scenario Outline: sharee tries to copy a file from shares space with secure viewer to personal space Given user "Brian" has been created with default attributes and without skeleton files And user "Alice" has created folder "/folder" @@ -494,3 +457,192 @@ Feature: copying file using file id | Viewer | Secure viewer | /dav/spaces/<> | | Editor | Secure viewer | /dav/spaces/<> | | Uploader | Secure viewer | /dav/spaces/<> | + + + Scenario Outline: copy a file from project to personal space + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has sent the following space share invitation: + | space | project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + When user "Brian" copies a file "/textfile.txt" into "/" inside space "Personal" using file-id path "" + Then the HTTP status code should be "201" + And for user "Brian" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + And for user "Brian" folder "/" of the space "Personal" should contain these files: + | textfile.txt | + Examples: + | space-role | dav-path | + | Manager | /remote.php/dav/spaces/<> | + | Space Editor | /remote.php/dav/spaces/<> | + | Space Viewer | /remote.php/dav/spaces/<> | + | Manager | /dav/spaces/<> | + | Space Editor | /dav/spaces/<> | + | Space Viewer | /dav/spaces/<> | + + + Scenario Outline: copy a file between two project spaces + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "first-project-space" with the default quota using the Graph API + And user "Alice" has created a space "second-project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "first-project-space" with content "first project space" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has sent the following space share invitation: + | space | first-project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Alice" has sent the following space share invitation: + | space | second-project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + When user "Brian" copies a file "textfile.txt" into "/" inside space "second-project-space" using file-id path "" + Then the HTTP status code should be "201" + And for user "Brian" the space "second-project-space" should contain these entries: + | textfile.txt | + And for user "Brian" the space "first-project-space" should contain these entries: + | textfile.txt | + And for user "Alice" the space "second-project-space" should contain these entries: + | textfile.txt | + Examples: + | from-space-role | to-space-role | dav-path | + | Manager | Manager | /remote.php/dav/spaces/<> | + | Manager | Space Editor | /remote.php/dav/spaces/<> | + | Space Editor | Manager | /remote.php/dav/spaces/<> | + | Space Editor | Space Editor | /remote.php/dav/spaces/<> | + | Space Viewer | Manager | /remote.php/dav/spaces/<> | + | Space Viewer | Space Editor | /remote.php/dav/spaces/<> | + | Manager | Manager | /dav/spaces/<> | + | Manager | Space Editor | /dav/spaces/<> | + | Space Editor | Manager | /dav/spaces/<> | + | Space Editor | Space Editor | /dav/spaces/<> | + | Space Viewer | Manager | /dav/spaces/<> | + | Space Viewer | Space Editor | /dav/spaces/<> | + + + Scenario Outline: try to copy a file from a project to another project space with read permission + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "first-project-space" with the default quota using the Graph API + And user "Alice" has created a space "second-project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "first-project-space" with content "first project space" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has sent the following space share invitation: + | space | first-project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Alice" has sent the following space share invitation: + | space | second-project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + When user "Brian" copies a file "textfile.txt" into "/" inside space "second-project-space" using file-id path "" + Then the HTTP status code should be "403" + And for user "Brian" the space "second-project-space" should not contain these entries: + | textfile.txt | + And for user "Brian" the space "first-project-space" should contain these entries: + | textfile.txt | + But for user "Alice" the space "second-project-space" should not contain these entries: + | textfile.txt | + Examples: + | from-space-role | to-space-role | dav-path | + | Manager | Space Viewer | /remote.php/dav/spaces/<> | + | Space Editor | Space Viewer | /remote.php/dav/spaces/<> | + | Space Viewer | Space Viewer | /remote.php/dav/spaces/<> | + | Manager | Space Viewer | /dav/spaces/<> | + | Space Editor | Space Viewer | /dav/spaces/<> | + | Space Viewer | Space Viewer | /dav/spaces/<> | + + + Scenario Outline: copy a file from project to shares space + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has sent the following space share invitation: + | space | project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Alice" has created folder "testshare" + And user "Alice" has sent the following resource share invitation: + | resource | testshare | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "testshare" synced + When user "Brian" copies a file "textfile.txt" into "testshare" inside space "Shares" using file-id path "" + Then the HTTP status code should be "201" + And for user "Brian" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + And for user "Brian" folder "testshare" of the space "Shares" should contain these files: + | textfile.txt | + And for user "Alice" folder "testshare" of the space "Personal" should contain these files: + | textfile.txt | + Examples: + | space-role | permissions | dav-path | + | Manager | Editor | /remote.php/dav/spaces/<> | + | Manager | Uploader | /remote.php/dav/spaces/<> | + | Space Editor | Editor | /remote.php/dav/spaces/<> | + | Space Editor | Uploader | /remote.php/dav/spaces/<> | + | Space Viewer | Editor | /remote.php/dav/spaces/<> | + | Space Viewer | Uploader | /remote.php/dav/spaces/<> | + | Manager | Editor | /dav/spaces/<> | + | Manager | Uploader | /dav/spaces/<> | + | Space Editor | Editor | /dav/spaces/<> | + | Space Editor | Uploader | /dav/spaces/<> | + | Space Viewer | Editor | /dav/spaces/<> | + | Space Viewer | Uploader | /dav/spaces/<> | + + + Scenario Outline: try to copy a file from project to shares space with read permission + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has sent the following space share invitation: + | space | project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Alice" has created folder "testshare" + And user "Alice" has sent the following resource share invitation: + | resource | testshare | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "testshare" synced + When user "Brian" copies a file "textfile.txt" into "testshare" inside space "Shares" using file-id path "" + Then the HTTP status code should be "403" + And for user "Brian" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + But for user "Brian" folder "testshare" of the space "Shares" should not contain these files: + | textfile.txt | + And for user "Alice" folder "testshare" of the space "Personal" should not contain these files: + | textfile.txt | + Examples: + | space-role | permissions | dav-path | + | Manager | Viewer | /remote.php/dav/spaces/<> | + | Manager | Secure viewer | /remote.php/dav/spaces/<> | + | Space Editor | Viewer | /remote.php/dav/spaces/<> | + | Space Editor | Secure viewer | /remote.php/dav/spaces/<> | + | Space Viewer | Viewer | /remote.php/dav/spaces/<> | + | Space Viewer | Secure viewer | /remote.php/dav/spaces/<> | + | Manager | Viewer | /dav/spaces/<> | + | Manager | Secure viewer | /dav/spaces/<> | + | Space Editor | Viewer | /dav/spaces/<> | + | Space Editor | Secure viewer | /dav/spaces/<> | + | Space Viewer | Viewer | /dav/spaces/<> | + | Space Viewer | Secure viewer | /dav/spaces/<> |