From 951148f5ce7af2db1276db5a3a7ef958e2f029e0 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 19 Oct 2023 15:20:05 +0545 Subject: [PATCH] add tests for move rename file between personal and project space with file-id --- .../moveByFileId.feature | 86 +++++++++++++++++-- 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature b/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature index 8c50b37bc31..035917cc40f 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature @@ -75,8 +75,7 @@ Feature: moving/renaming file using file id Scenario Outline: move a file into a folder inside project space - Given using spaces DAV path - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + 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 created a folder "/folder" in space "project-space" And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" @@ -94,8 +93,7 @@ Feature: moving/renaming file using file id Scenario Outline: move a file into a sub-folder inside project space - Given using spaces DAV path - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + 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 created a folder "folder/sub-folder" in space "project-space" And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "/textfile.txt" @@ -113,8 +111,7 @@ Feature: moving/renaming file using file id Scenario Outline: move a file from folder to root inside project space - Given using spaces DAV path - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + 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 created a folder "folder" in space "project-space" And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "folder/textfile.txt" @@ -132,8 +129,7 @@ Feature: moving/renaming file using file id Scenario Outline: move a file from sub-folder to root inside project space - Given using spaces DAV path - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + 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 created a folder "folder/sub-folder" in space "project-space" And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "folder/sub-folder/textfile.txt" @@ -246,7 +242,7 @@ Feature: moving/renaming file using file id And we save it into "FILEID" When user "Alice" renames a file "folder/sub-folder/textfile.txt" into "/renamed.txt" inside space "Personal" using file-id path "" Then the HTTP status code should be "201" - And for user "Alice" the space "Personal" should contain these entries: + And for user "Alice" the space "Personal" should contain these files: | renamed.txt | But for user "Alice" folder "folder/sub-folder" of the space "Personal" should not contain these files: | textfile.txt | @@ -254,3 +250,75 @@ Feature: moving/renaming file using file id | dav-path | | /remote.php/dav/spaces/<> | | /dav/spaces/<> | + + + Scenario Outline: move 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" moves a file "/textfile.txt" into "/" inside space "Personal" using file-id path "" + Then the HTTP status code should be "502" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + But for user "Alice" folder "/" of the space "Personal" should not contain these files: + | textfile.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> | + + + Scenario Outline: move a file from personal to project 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 "Personal" with content "some data" to "textfile.txt" + And we save it into "FILEID" + When user "Alice" moves a file "/textfile.txt" into "/" inside space "project-space" using file-id path "" + Then the HTTP status code should be "502" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "Personal" should contain these files: + | textfile.txt | + But for user "Alice" folder "/" of the space "project-space" should not contain these files: + | textfile.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> | + + + Scenario Outline: move a file to different name from project space 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" renames a file "/textfile.txt" into "/renamed.txt" inside space "Personal" using file-id path "" + Then the HTTP status code should be "502" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + But for user "Alice" folder "/" of the space "Personal" should not contain these files: + | renamed.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> | + + + Scenario Outline: move a file to different name from personal space to project 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 "Personal" with content "some data" to "textfile.txt" + And we save it into "FILEID" + When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "project-space" using file-id path "" + Then the HTTP status code should be "502" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "Personal" should contain these files: + | textfile.txt | + But for user "Alice" folder "/" of the space "project-space" should not contain these files: + | renamed.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> |