From ce6e9c1faacf9787b78a7159a103b2d145b1d7f6 Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Tue, 7 May 2024 18:05:13 +0545 Subject: [PATCH 1/7] test: remove webUI acceptance test suites (#10878) --- .drone.star | 22 --- .../features/webUIFilesCopy/copy.feature | 39 ---- .../webUIMoveFilesFolders/moveFiles.feature | 45 ----- .../webUIMoveFilesFolders/moveFolders.feature | 87 --------- .../webUIRenameFiles/renameFiles.feature | 183 ------------------ ...meFilesInsideProblematicFolderName.feature | 36 ---- .../shareWithGroupsEdgeCases.feature | 91 --------- .../shareWithGroups.feature | 120 ------------ .../shareWithUsers.feature | 110 ----------- .../features/webUIUpload/upload.feature | 108 ----------- .../webUIUpload/uploadEdgecases.feature | 86 -------- .../e2e/cucumber/features/shares/link.feature | 17 +- tests/e2e/cucumber/steps/ui/resources.ts | 10 + 13 files changed, 22 insertions(+), 932 deletions(-) delete mode 100644 tests/acceptance/features/webUIFilesCopy/copy.feature delete mode 100644 tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature delete mode 100644 tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature delete mode 100644 tests/acceptance/features/webUIRenameFiles/renameFiles.feature delete mode 100644 tests/acceptance/features/webUIRenameFiles/renameFilesInsideProblematicFolderName.feature delete mode 100644 tests/acceptance/features/webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature delete mode 100644 tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature delete mode 100644 tests/acceptance/features/webUISharingInternalUsersSharingIndicator/shareWithUsers.feature delete mode 100644 tests/acceptance/features/webUIUpload/upload.feature delete mode 100644 tests/acceptance/features/webUIUpload/uploadEdgecases.feature diff --git a/.drone.star b/.drone.star index 5512be369a0..8f932f61eeb 100644 --- a/.drone.star +++ b/.drone.star @@ -111,23 +111,12 @@ config = { "oCISFiles2": [ "webUIFilesDetails", ], - "oCISFiles3": [ - "webUIRenameFiles", - ], "oCISFiles5": [ - "webUIFilesCopy", "webUITextEditor", ], - "oCISSharingInternal1": [ - "webUISharingInternalGroupsEdgeCases", - ], "oCISSharingInternal2": [ "webUISharingInternalUsers", ], - "oCISSharingInternal3": [ - "webUISharingInternalGroupsSharingIndicator", - "webUISharingInternalUsersSharingIndicator", - ], "oCISSharingPublic1": [ "webUISharingPublicBasic", ], @@ -137,10 +126,6 @@ config = { "oCISSharingPublic3": [ "webUISharingPublicDifferentRoles", ], - "oCISUploadMove": [ - "webUIUpload", - "webUIMoveFilesFolders", - ], "oCISTrashbinJourney": [ "webUITrashbinDelete", "webUITrashbinFilesFolders", @@ -166,16 +151,10 @@ config = { basicTestSuites = [ "webUICreateFilesFolders", "webUIDeleteFilesFolders", - "webUIFilesCopy", "webUIFilesDetails", "webUILogin", - "webUIMoveFilesFolders", - "webUIRenameFiles", "webUISharingAcceptShares", - "webUISharingInternalGroupsEdgeCases", - "webUISharingInternalGroupsSharingIndicator", "webUISharingInternalUsers", - "webUISharingInternalUsersSharingIndicator", "webUISharingPublicBasic", "webUISharingPublicDifferentRoles", "webUISharingPublicManagement", @@ -183,7 +162,6 @@ basicTestSuites = [ "webUITrashbinDelete", "webUITrashbinFilesFolders", "webUITrashbinRestore", - "webUIUpload", ] # minio mc environment variables diff --git a/tests/acceptance/features/webUIFilesCopy/copy.feature b/tests/acceptance/features/webUIFilesCopy/copy.feature deleted file mode 100644 index 2cf6fd970ba..00000000000 --- a/tests/acceptance/features/webUIFilesCopy/copy.feature +++ /dev/null @@ -1,39 +0,0 @@ -Feature: copy files and folders - As a user - I want to copy files and folders - So that I can work safely on a copy without changing the original - - Background: - Given the administrator has set the default folder for received shares to "Shares" in the server - And user "Alice" has been created with default attributes and without skeleton files in the server - - - Scenario Outline: copy a file into a folder (problematic characters) - Given user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And user "Alice" has created folder "simple-empty-folder" in the server - And user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user renames file "lorem.txt" to using the webUI - And the user renames folder "simple-empty-folder" to using the webUI - And the user copies file into folder using the webUI - Then breadcrumb for folder should be displayed on the webUI - And file should be listed on the webUI - Examples: - | file_name | folder_name | - | "'single'" | "folder-with-'single'" | - | "\"double\" quotes" | "folder-with\"double\" quotes" | - | "question?" | "folder-with-question?" | - | "&and#hash" | "folder-with-&and#hash" | - - @issue-3755 - Scenario: copy files on a public share - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has uploaded file "data.zip" to "simple-folder/data.zip" in the server - And user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions in the server - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user copies file "data.zip" into folder "simple-empty-folder" using the webUI - Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI - And file "data.zip" should be listed on the webUI - And as "Alice" file "simple-folder/simple-empty-folder/data.zip" should exist in the server - And as "Alice" file "simple-folder/data.zip" should exist in the server diff --git a/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature b/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature deleted file mode 100644 index 327bd721a5b..00000000000 --- a/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature +++ /dev/null @@ -1,45 +0,0 @@ -Feature: move files - As a user - I want to move files - So that I can organise my data structure - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - - - Scenario: An attempt to move a file into a sub-folder using rename is not allowed - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user tries to rename file "lorem.txt" to "simple-folder/lorem.txt" using the webUI - Then the error message 'The name cannot contain "/"' should be displayed on the webUI dialog prompt - And file "lorem.txt" should be listed on the webUI - - - Scenario Outline: move a file into a folder (problematic characters) - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user renames file "lorem.txt" to using the webUI - And the user renames folder "simple-folder" to using the webUI - And the user moves file into folder using the webUI - Then breadcrumb for folder should be displayed on the webUI - And file should be listed on the webUI - Examples: - | file_name | folder_name | - | "'single'" | "folder-with-'single'" | - # | "\"double\" quotes" | "folder-with\"double\" quotes" | FIXME: Needs a way to access breadcrumbs with double quotes issue-3734 - | "question?" | "folder-with-question?" | - | "&and#hash" | "folder-with-&and#hash" | - - - Scenario: move files on a public share - Given user "Alice" has uploaded file "data.zip" to "simple-folder/data.zip" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions in the server - And the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user moves file "data.zip" into folder "simple-empty-folder" using the webUI - Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI - And file "data.zip" should be listed on the webUI - And as "Alice" file "simple-folder/simple-empty-folder/data.zip" should exist in the server - But as "Alice" file "simple-folder/data.zip" should not exist in the server diff --git a/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature b/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature deleted file mode 100644 index a24b06a69c4..00000000000 --- a/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature +++ /dev/null @@ -1,87 +0,0 @@ -Feature: move folders - As a user - I want to move folders - So that I can organise my data structure - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "simple-empty-folder" in the server - - - Scenario: An attempt to move a folder into a sub-folder using rename is not allowed - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user tries to rename folder "simple-empty-folder" to "simple-folder/simple-empty-folder" using the webUI - Then the error message 'The name cannot contain "/"' should be displayed on the webUI dialog prompt - And folder "simple-empty-folder" should be listed on the webUI - - @smokeTest @ocisSmokeTest @skipOnIphoneResolution - Scenario: move a folder into another folder - Given user "Alice" has created folder "strängé नेपाली folder" in the server - And user "Alice" has logged in using the webUI - And the user has reloaded the current page of the webUI - When the user moves folder "simple-folder" into folder "simple-empty-folder" using the webUI - Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI - And folder "simple-folder" should be listed on the webUI - When the user browses to the files page - And the user moves folder "strängé नेपाली folder" into folder "simple-empty-folder" using the webUI - Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI - And folder "strängé नेपाली folder" should be listed on the webUI - - - Scenario: move a folder into another folder where a folder with the same name already exists - Given user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user tries to move folder "simple-empty-folder" into folder "simple-folder" using the webUI - Then the "modal error" message with header 'Folder with name "simple-empty-folder" already exists.' should be displayed on the webUI - - @smokeTest @skipOnIphoneResolution - Scenario: Move multiple folders at once - Given user "Alice" has created folder "strängé नेपाली folder" in the server - And user "Alice" has logged in using the webUI - And the user has reloaded the current page of the webUI - When the user batch moves these folders into folder "simple-empty-folder" using the webUI - | name | - | simple-folder | - | strängé नेपाली folder | - Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI - And the following folders should be listed on the webUI - | folders | - | simple-folder | - | strängé नेपाली folder | - - - Scenario Outline: move a folder into another folder (problematic characters) - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user renames folder "simple-folder" to using the webUI - And the user renames folder "simple-empty-folder" to using the webUI - And the user moves folder into folder using the webUI - Then breadcrumb for folder should be displayed on the webUI - And folder should be listed on the webUI - Examples: - | folder_name | target_name | - | "'single'" | "target-folder-with-'single'" | - # | "\"double\" quotes" | "target-folder-with\"double\" quotes" | FIXME: Needs a way to access breadcrumbs with double quotes issue-3734 - | "question?" | "target-folder-with-question?" | - | "&and#hash" | "target-folder-with-&and#hash" | - - - Scenario: move a folder into the same folder - Given user "Alice" has logged in using the webUI - When the user tries to move folder "simple-empty-folder" into folder "simple-empty-folder" using the webUI - Then the "error" message with header "You can't paste the selected file at this location because you can't paste an item into itself." should be displayed on the webUI - And the user clears all error message from the webUI - And as "Alice" folder "simple-empty-folder/simple-empty-folder" should not exist in the server - - - Scenario: move a folder into another folder with same name - Given user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has logged in using the webUI - When the user moves folder "simple-empty-folder" into folder "simple-folder/simple-empty-folder" using the webUI - Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI - And folder "simple-empty-folder" should be listed on the webUI - And as "Alice" folder "simple-folder/simple-empty-folder/simple-empty-folder" should exist in the server - And as "Alice" folder "simple-empty-folder" should not exist in the server diff --git a/tests/acceptance/features/webUIRenameFiles/renameFiles.feature b/tests/acceptance/features/webUIRenameFiles/renameFiles.feature deleted file mode 100644 index 956d2fb8c9e..00000000000 --- a/tests/acceptance/features/webUIRenameFiles/renameFiles.feature +++ /dev/null @@ -1,183 +0,0 @@ -Feature: rename files - As a user - I want to rename files - So that I can organise my data structure - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has uploaded file "lorem-big.txt" to "lorem-big.txt" in the server - - @smokeTest @ocisSmokeTest @disablePreviews - Scenario Outline: Rename a file - Given user "Alice" has logged in using the webUI - When the user renames file "lorem.txt" to using the webUI - Then file should be listed on the webUI - When the user reloads the current page of the webUI - Then file should be listed on the webUI - Examples: - | to_file_name | - | "simple-name.txt" | - | '"quotes1"' | - | "\"quote\"d-folders'" | - | "'quotes2'" | - | "लोरेम।तयक्स्त? $%#&@" | - - - Scenario Outline: Rename a file that has special characters in its name - Given user "Alice" has created file in the server - And user "Alice" has logged in using the webUI - When the user renames file to using the webUI - Then file should be listed on the webUI - When the user reloads the current page of the webUI - Then file should be listed on the webUI - Examples: - | from_name | to_name | - | "'single'quotes.txt" | "single-quotes.txt" | - | "strängé filename (duplicate #2 &).txt" | "strängé filename (duplicate #3).txt" | - | "sämple,1.txt" | "file,with,commä,.txt" | - - @smokeTest - Scenario: Rename a file using special characters and check its existence after page reload - Given user "Alice" has created file "zzzz-must-be-last-file-in-folder.txt" in the server - And user "Alice" has logged in using the webUI - When the user renames file "lorem.txt" to "लोरेम।तयक्स्त $%&" using the webUI - And the user reloads the current page of the webUI - Then file "लोरेम।तयक्स्त $%&" should be listed on the webUI - When the user renames file "लोरेम।तयक्स्त $%&" to '"double"quotes.txt' using the webUI - And the user reloads the current page of the webUI - Then file '"double"quotes.txt' should be listed on the webUI - When the user renames file '"double"quotes.txt' to "no-double-quotes.txt" using the webUI - And the user reloads the current page of the webUI - Then file "no-double-quotes.txt" should be listed on the webUI - When the user renames file 'no-double-quotes.txt' to "hash#And&QuestionMark?At@Filename.txt" using the webUI - And the user reloads the current page of the webUI - Then file "hash#And&QuestionMark?At@Filename.txt" should be listed on the webUI - When the user renames file 'zzzz-must-be-last-file-in-folder.txt' to "aaaaaa.txt" using the webUI - And the user reloads the current page of the webUI - Then file "aaaaaa.txt" should be listed on the webUI - - @issue-964 - Scenario: Rename a file using spaces at front and/or back of file name and type - Given user "Alice" has logged in using the webUI - When the user renames file "lorem.txt" to " space at start" using the webUI - And the user reloads the current page of the webUI - Then file " space at start" should be listed on the webUI - When the user renames file " space at start" to "space at end .txt" using the webUI - And the user reloads the current page of the webUI - Then file "space at end .txt" should be listed on the webUI - When the user renames file "space at end .txt" to "space at end. lis" using the webUI - And the user reloads the current page of the webUI - Then file "space at end. lis" should be listed on the webUI - When the user renames file "space at end. lis" to " multiple space all over . dat" using the webUI - And the user reloads the current page of the webUI - Then file " multiple space all over . dat" should be listed on the webUI - - - Scenario: Rename a file using spaces at end is prohibited - Given user "Alice" has logged in using the webUI - When the user tries to rename file "lorem.txt" to "space at end " using the webUI - Then the error message 'The name cannot end with whitespace' should be displayed on the webUI dialog prompt - When the user reloads the current page of the webUI - Then file "lorem.txt" should be listed on the webUI - And file "space at end " should not be listed on the webUI - When the user tries to rename file "lorem.txt" to " multiple space all over . dat " using the webUI - Then the error message 'The name cannot end with whitespace' should be displayed on the webUI dialog prompt - And the user reloads the current page of the webUI - And file "lorem.txt" should be listed on the webUI - And file " multiple space all over . dat " should not be listed on the webUI - - @issue-4859 @disablePreviews - Scenario: Rename a file using both double and single quotes - Given user "Alice" has logged in using the webUI - When the user renames the following file using the webUI - | fromName | toName | - | lorem.txt | '"First 'single" quotes" '.txt | - | lorem-big.txt | Test" 'me o'ut".txt | - And the user reloads the current page of the webUI - Then these files should be listed on the webUI - | files | - | '"First 'single" quotes" '.txt | - | Test" 'me o'ut".txt | - When the user renames the following file using the webUI - | fromName | toName | - | '"First 'single" quotes" '.txt | loremz.dat | - | Test" 'me o'ut".txt | loremy.tad | - And the user reloads the current page of the webUI - Then file "loremz.dat" should be listed on the webUI - And file "loremy.tad" should be listed on the webUI - - - Scenario Outline: Rename a file/folder using forward slash in its name - Given user "Alice" has logged in using the webUI - When the user tries to rename file "" to "" using the webUI - Then the error message 'The name cannot contain "/"' should be displayed on the webUI dialog prompt - And file "" should be listed on the webUI - Examples: - | from_file_name | to_file_name | - | lorem.txt | simple-folder/lorem.txt | - | lorem.txt | lorem/txt | - - - Scenario: Rename the last file in a folder - Given user "Alice" has created file "zzzz-must-be-last-file-in-folder.txt" in the server - And user "Alice" has logged in using the webUI - When the user renames file "zzzz-must-be-last-file-in-folder.txt" to "a-file.txt" using the webUI - And the user reloads the current page of the webUI - Then file "a-file.txt" should be listed on the webUI - - - Scenario: Rename a file to become the last file in a folder - Given user "Alice" has logged in using the webUI - When the user renames file "lorem.txt" to "zzzz-z-this-is-now-the-last-file.txt" using the webUI - And the user reloads the current page of the webUI - Then file "zzzz-z-this-is-now-the-last-file.txt" should be listed on the webUI - - - Scenario: Rename a file putting a name of a file which already exists - Given user "Alice" has logged in using the webUI - When the user tries to rename file "data.zip" to "lorem.txt" using the webUI - Then the error message 'The name "lorem.txt" is already taken' should be displayed on the webUI dialog prompt - And file 'data.zip' should be listed on the webUI - - - Scenario: Rename a file to .. - Given user "Alice" has logged in using the webUI - When the user tries to rename file "data.zip" to ".." using the webUI - Then the error message 'The name cannot be equal to ".."' should be displayed on the webUI dialog prompt - And file 'data.zip' should be listed on the webUI - - - Scenario: Rename a file to . - Given user "Alice" has logged in using the webUI - When the user tries to rename file "data.zip" to "." using the webUI - Then the error message 'The name cannot be equal to "."' should be displayed on the webUI dialog prompt - And file 'data.zip' should be listed on the webUI - - - Scenario: Rename a file to .part - Given user "Alice" has logged in using the webUI - When the user renames file "data.zip" to "data.part" using the webUI - Then file 'data.part' should be listed on the webUI - - - Scenario: User tries to rename a file that used to exist but does not anymore - Given user "Alice" has logged in using the webUI - And the following files have been deleted by user "Alice" in the server - | name | - | lorem.txt | - When the user tries to rename file "lorem.txt" to "new-lorem.txt" using the webUI - Then the "error" message with header 'Failed to rename "lorem.txt" to "new-lorem.txt"' should be displayed on the webUI - When the user reloads the current page of the webUI - Then file "lorem.txt" should not be listed on the webUI - And file "new-lorem.txt" should not be listed on the webUI - And as "Alice" file "lorem.txt" should not exist in the server - And as "Alice" file "new-lorem.txt" should not exist in the server - - - Scenario: Rename file extension through context-menu without reload - Given user "Alice" has logged in using the webUI - When the user renames file "lorem.txt" to "lorem.md" through context-menu using the webUI - Then file "lorem.md" should be listed on the webUI - And file "lorem.md" should be listed on the sidebar diff --git a/tests/acceptance/features/webUIRenameFiles/renameFilesInsideProblematicFolderName.feature b/tests/acceptance/features/webUIRenameFiles/renameFilesInsideProblematicFolderName.feature deleted file mode 100644 index 4b880d802e1..00000000000 --- a/tests/acceptance/features/webUIRenameFiles/renameFilesInsideProblematicFolderName.feature +++ /dev/null @@ -1,36 +0,0 @@ -Feature: Renaming files inside a folder with problematic name - As a user - I want to rename a file - So that I can recognize my file easily - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - - - Scenario Outline: Rename the existing file inside a problematic folder - Given user "Alice" has created folder "" in the server - And user "Alice" has uploaded file "lorem.txt" to "/lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "" using the webUI - And the user renames file "lorem.txt" to "???.txt" using the webUI - Then file "???.txt" should be listed on the webUI - When the user reloads the current page of the webUI - Then file "???.txt" should be listed on the webUI - Examples: - | folder | - | 0 | - | 'single'quotes | - - - Scenario Outline: Rename the existing file inside a problematic folder - Given user "Alice" has created folder "" in the server - And user "Alice" has uploaded file "lorem.txt" to "/lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "" using the webUI - And the user renames file "lorem.txt" to "???.txt" using the webUI - Then file "???.txt" should be listed on the webUI - When the user reloads the current page of the webUI - Then file "???.txt" should be listed on the webUI - Examples: - | folder | - | strängé नेपाली folder | diff --git a/tests/acceptance/features/webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature b/tests/acceptance/features/webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature deleted file mode 100644 index 6f33d5e20c0..00000000000 --- a/tests/acceptance/features/webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature +++ /dev/null @@ -1,91 +0,0 @@ -@ocis-reva-issue-194 -Feature: Sharing files and folders with internal groups - As a user - I want to share files and folders with groups - So that those groups can access the files and folders - - Background: - Given the administrator has set the default folder for received shares to "Shares" in the server - And these users have been created with default attributes and without skeleton files in the server: - | username | - | Alice | - | Brian | - | Carol | - - @issue-5216 - Scenario Outline: sharing files and folder with an internal problematic group name - Given these groups have been created in the server: - | groupname | - | | - And user "Carol" has created folder "simple-folder" in the server - And user "Carol" has created file "testimage.jpg" in the server - And user "Alice" has been added to group "" in the server - And user "Carol" has logged in using the webUI - When the user shares folder "simple-folder" with group "" as "Viewer" using the webUI - And the user shares file "testimage.jpg" with group "" as "Viewer" using the webUI - Then group "" should be listed as "Can view" in the collaborators list for folder "simple-folder" on the webUI - And group "" should be listed as "Can view" in the collaborators list for file "testimage.jpg" on the webUI - Examples: - | group | - | ?\?@#%@,; | - | नेपाली | - - - Scenario: Share file with a user and a group with same name - Given these groups have been created in the server: - | groupname | - | Alice | - And user "Brian" has been added to group "Alice" in the server - And user "Carol" has uploaded file with content "Carol file" to "/randomfile.txt" in the server - And user "Carol" has logged in using the webUI - When the user shares file "randomfile.txt" with user "Alice Hansen" as "Editor" using the webUI - And the user shares file "randomfile.txt" with group "Alice" as "Editor" using the webUI - And the user types "Alice" in the share-with-field - Then "group" "Alice" should not be listed in the autocomplete list on the webUI - And the content of file "Shares/randomfile.txt" for user "Alice" should be "Carol file" in the server - And the content of file "Shares/randomfile.txt" for user "Brian" should be "Carol file" in the server - - - Scenario: Share file with a group and a user with same name - Given these groups have been created in the server: - | groupname | - | Alice | - And user "Brian" has been added to group "Alice" in the server - And user "Carol" has uploaded file with content "Carol file" to "/randomfile.txt" in the server - And user "Carol" has logged in using the webUI - When the user shares file "randomfile.txt" with group "Alice" as "Editor" using the webUI - And the user shares file "randomfile.txt" with user "Alice Hansen" as "Editor" using the webUI - And the user types "Alice" in the share-with-field - Then "user" "Alice Hansen" should not be listed in the autocomplete list on the webUI - And the content of file "Shares/randomfile.txt" for user "Brian" should be "Carol file" in the server - And the content of file "Shares/randomfile.txt" for user "Alice" should be "Carol file" in the server - - - Scenario: Share file with a user and again with a group with same name but different case - Given these groups have been created in the server: - | groupname | - | ALICE | - And user "Brian" has been added to group "ALICE" in the server - And user "Carol" has uploaded file with content "Carol file" to "/randomfile.txt" in the server - And user "Carol" has logged in using the webUI - When the user shares file "randomfile.txt" with user "Alice Hansen" as "Editor" using the webUI - And the user shares file "randomfile.txt" with group "ALICE" as "Editor" using the webUI - And the user types "ALICE" in the share-with-field - Then "group" "ALICE" should not be listed in the autocomplete list on the webUI - And the content of file "Shares/randomfile.txt" for user "Brian" should be "Carol file" in the server - And the content of file "Shares/randomfile.txt" for user "Alice" should be "Carol file" in the server - - - Scenario: Share file with a group and again with a user with same name but different case - Given these groups have been created in the server: - | groupname | - | ALICE | - And user "Brian" has been added to group "ALICE" in the server - And user "Carol" has uploaded file with content "Carol file" to "/randomfile.txt" in the server - And user "Carol" has logged in using the webUI - When the user shares file "randomfile.txt" with group "ALICE" as "Editor" using the webUI - And the user shares file "randomfile.txt" with user "Alice Hansen" as "Editor" using the webUI - And the user types "Alice" in the share-with-field - Then "user" "Alice Hansen" should not be listed in the autocomplete list on the webUI - And the content of file "Shares/randomfile.txt" for user "Brian" should be "Carol file" in the server - And the content of file "Shares/randomfile.txt" for user "Alice" should be "Carol file" in the server diff --git a/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature b/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature deleted file mode 100644 index 15f5bae3871..00000000000 --- a/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature +++ /dev/null @@ -1,120 +0,0 @@ -@ocis-reva-issue-194 @disablePreviews -Feature: Sharing files and folders with internal groups - As a user - I want to share files and folders with groups - So that those groups can access the files and folders - - Background: - Given the administrator has set the default folder for received shares to "Shares" in the server - And these users have been created with default attributes and without skeleton files in the server: - | username | - | Alice | - | Brian | - | Carol | - And group "grp1" has been created in the server - And user "Alice" has been added to group "grp1" in the server - And user "Brian" has been added to group "grp1" in the server - - @issue-2060 - Scenario: sharing indicator of items inside a shared folder two levels down - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has uploaded file with content "test" to "/simple-folder/lorem.txt" in the server - And user "Alice" has uploaded file with content "test" to "/simple-folder/simple-empty-folder/inside.txt" in the server - And user "Alice" has shared folder "simple-folder" with group "grp1" in the server - When user "Alice" has logged in using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-folder | user-direct | - When the user opens folder "simple-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-empty-folder | user-indirect | - | lorem.txt | user-indirect | - When the user opens folder "simple-empty-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | inside.txt | user-indirect | - - @issue-2060 - Scenario: no sharing indicator of items inside a not shared folder - Given user "Brian" has created folder "simple-folder" in the server - And user "Brian" has created folder "simple-folder/simple-empty-folder" in the server - And user "Brian" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created file "textfile0.txt" in the server - And user "Alice" has shared file "/textfile0.txt" with group "grp1" in the server - When user "Brian" has logged in using the webUI - Then the following resources should not have share indicators on the webUI - | simple-folder | - When the user opens folder "simple-folder" using the webUI - Then the following resources should not have share indicators on the webUI - | simple-empty-folder | - | lorem.txt | - - @issue-2060 - Scenario: sharing indicator for file uploaded inside a shared folder - Given user "Alice" has created folder "simple-empty-folder" in the server - And user "Alice" has shared folder "/simple-empty-folder" with group "grp1" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "simple-empty-folder" using the webUI - And the user uploads file "new-lorem.txt" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | new-lorem.txt | user-indirect | - - @issue-2060 - Scenario: sharing indicator for folder created inside a shared folder - Given user "Alice" has created folder "simple-empty-folder" in the server - And user "Alice" has shared folder "/simple-empty-folder" with group "grp1" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "simple-empty-folder" using the webUI - And the user creates a folder with the name "sub-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | sub-folder | user-indirect | - - @issue-2939 - Scenario: sharing indicator for group shares stays up to date - Given these groups have been created in the server: - | groupname | - | grp2 | - | grp3 | - | grp4 | - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "simple-folder2" in the server - And user "Alice" has created file "simple-folder/testimage.png" in the server - When user "Alice" has logged in using the webUI - Then the following resources should not have share indicators on the webUI - | simple-folder | - When the user shares folder "simple-folder" with group "grp2" as "Viewer" using the webUI - And the user shares folder "simple-folder" with group "grp3" as "Viewer" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-folder | user-direct | - When the user opens folder "simple-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | testimage.png | user-indirect | - When the user shares file "testimage.png" with group "grp4" as "Viewer" using the webUI - # the indicator changes from user-indirect to user-direct to show the direct share - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | testimage.png | user-direct | - # removing the last collaborator reverts the indicator to user-indirect - When the user opens the share dialog for file "testimage.png" using the webUI - And the user deletes "grp4" as collaborator for the current file using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | testimage.png | user-indirect | - When the user opens folder "" directly on the webUI - And the user opens the share dialog for folder "simple-folder" using the webUI - And the user deletes "grp3" as collaborator for the current file using the webUI - # because there is still another share left, the indicator stays - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-folder | user-direct | - # deleting the last collaborator removes the indicator - When the user opens the share dialog for folder "simple-folder" using the webUI - And the user deletes "grp2" as collaborator for the current file using the webUI - Then the following resources should not have share indicators on the webUI - | simple-folder | diff --git a/tests/acceptance/features/webUISharingInternalUsersSharingIndicator/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsersSharingIndicator/shareWithUsers.feature deleted file mode 100644 index 1abeffff880..00000000000 --- a/tests/acceptance/features/webUISharingInternalUsersSharingIndicator/shareWithUsers.feature +++ /dev/null @@ -1,110 +0,0 @@ -@disablePreviews -Feature: Sharing files and folders with internal users - As a user - I want to share files and folders with other users - So that those users can access the files and folders - - Background: - Given the administrator has set the default folder for received shares to "Shares" in the server - And these users have been created with default attributes and without skeleton files in the server: - | username | - | Alice | - | Brian | - And user "Alice" has created folder "simple-folder" in the server - - @issue-4310 - Scenario: sharing indicator for user shares stays up to date - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "David" has been created with default attributes and without skeleton files in the server - And user "Alice" has uploaded file "testavatar.png" to "simple-folder/testimage.png" in the server - When user "Alice" has logged in using the webUI - Then the following resources should not have share indicators on the webUI - | simple-folder | - When the user shares folder "simple-folder" with user "Brian Murphy" as "Viewer" using the webUI - And the user shares folder "simple-folder" with user "Carol King" as "Viewer" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-folder | user-direct | - When the user opens folder "simple-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | testimage.png | user-indirect | - When the user shares file "testimage.png" with user "David Lopez" as "Viewer" using the webUI - # the indicator changes from user-indirect to user-direct to show the direct share - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | testimage.png | user-direct | - # removing the last collaborator reverts the indicator to user-indirect - When the user opens the share dialog for file "testimage.png" using the webUI - And the user deletes "David Lopez" as collaborator for the current file using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | testimage.png | user-indirect | - When the user opens folder "" directly on the webUI - And the user opens the share dialog for folder "simple-folder" using the webUI - And the user deletes "Carol King" as collaborator for the current file using the webUI - # because there is still another share left, the indicator stays - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-folder | user-direct | - # deleting the last collaborator removes the indicator - When the user opens the share dialog for folder "simple-folder" using the webUI - And the user deletes "Brian Murphy" as collaborator for the current file using the webUI - Then the following resources should not have share indicators on the webUI - | simple-folder | - - @issue-4167 - Scenario: sharing indicator of items inside a shared folder two levels down - Given user "Alice" has created folder "/simple-folder/simple-empty-folder" in the server - And user "Alice" has created folder "/simple-folder/simple-empty-folder/new-folder" in the server - And user "Alice" has uploaded file with content "test" to "/simple-folder/simple-empty-folder/lorem.txt" in the server - And user "Alice" has shared folder "simple-folder" with user "Brian" in the server - When user "Alice" has logged in using the webUI - And the user opens the share dialog for folder "simple-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-folder | user-direct | - When the user opens folder "simple-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | simple-empty-folder | user-indirect | - When the user opens folder "simple-empty-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | new-folder | user-indirect | - | lorem.txt | user-indirect | - - @issue-2060 @issue-4172 - Scenario: no sharing indicator of items inside a not shared folder - Given user "Brian" has created folder "simple-folder" in the server - And user "Brian" has created folder "simple-folder/simple-empty-folder" in the server - And user "Brian" has created file "/simple-folder/lorem.txt" in the server - And user "Alice" has created file "textfile0.txt" in the server - And user "Alice" has shared file "/textfile0.txt" with user "Brian" in the server - When user "Brian" has logged in using the webUI - Then the following resources should not have share indicators on the webUI - | simple-folder | - When the user opens folder "simple-folder" using the webUI - Then the following resources should not have share indicators on the webUI - | simple-empty-folder | - | lorem.txt | - - @issue-2060 - Scenario: sharing indicator for file uploaded inside a shared folder - Given user "Alice" has shared folder "/simple-folder" with user "Brian" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "simple-folder" using the webUI - And the user uploads file "new-lorem.txt" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | new-lorem.txt | user-indirect | - - @issue-2060 - Scenario: sharing indicator for folder created inside a shared folder - Given user "Alice" has shared folder "/simple-folder" with user "Brian" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "simple-folder" using the webUI - And the user creates a folder with the name "sub-folder" using the webUI - Then the following resources should have share indicators on the webUI - | fileName | expectedIndicators | - | sub-folder | user-indirect | diff --git a/tests/acceptance/features/webUIUpload/upload.feature b/tests/acceptance/features/webUIUpload/upload.feature deleted file mode 100644 index bca977662ce..00000000000 --- a/tests/acceptance/features/webUIUpload/upload.feature +++ /dev/null @@ -1,108 +0,0 @@ -Feature: File Upload - - As a user - I would like to be able to upload files via the WebUI - So that I can store files in ownCloud - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has uploaded file with content "initial content" to "lorem.txt" in the server - And user "Alice" has uploaded file with content "initial content" to "simple-folder/lorem.txt" in the server - And user "Alice" has logged in using the webUI - - @smokeTest @ocisSmokeTest - Scenario: simple upload of a folder that does not exist before - Given a folder "CUSTOM" has been created with the following files in separate sub-folders in the middleware - | subFolder | file | - | | lorem.txt | - | sub1 | lorem.txt | - | sub1 | new-lorem.txt | - | sub2/sub3 | new-lorem.txt | - When the user uploads folder "CUSTOM" using the webUI - Then no message should be displayed on the webUI - And folder "CUSTOM" should be listed on the webUI - And as "Alice" folder "CUSTOM" should exist in the server - And as "Alice" file "CUSTOM/lorem.txt" should exist in the server - And as "Alice" file "CUSTOM/sub1/lorem.txt" should exist in the server - And as "Alice" file "CUSTOM/sub1/new-lorem.txt" should exist in the server - And as "Alice" file "CUSTOM/sub2/sub3/new-lorem.txt" should exist in the server - And as "Alice" the content of "CUSTOM/lorem.txt" in the server should be the same as the content of local file "CUSTOM/lorem.txt" - And as "Alice" the content of "CUSTOM/sub1/lorem.txt" in the server should be the same as the content of local file "CUSTOM/sub1/lorem.txt" - And as "Alice" the content of "CUSTOM/sub1/new-lorem.txt" in the server should be the same as the content of local file "CUSTOM/sub1/new-lorem.txt" - And as "Alice" the content of "CUSTOM/sub2/sub3/new-lorem.txt" in the server should be the same as the content of local file "CUSTOM/sub2/sub3/new-lorem.txt" - - @smokeTest @ocisSmokeTest - Scenario: simple upload of a folder with subfolders that does not exist before - When the user uploads folder "PARENT" using the webUI - Then no message should be displayed on the webUI - And folder "PARENT" should be listed on the webUI - When the user browses to the folder "PARENT" on the files page - Then the following resources should be listed on the webUI - | entry_name | - | parent.txt | - | CHILD | - And as "Alice" folder "PARENT" should exist in the server - And as "Alice" file "PARENT/parent.txt" should exist in the server - And as "Alice" folder "PARENT/CHILD" should exist in the server - - @smokeTest @ocisSmokeTest - Scenario: Upload of a folder inside a subdirectory - Given user "Alice" has created folder "simple-empty-folder" in the server - And the user has reloaded the current page of the webUI - When the user browses to the folder "simple-empty-folder" on the files page - And the user uploads folder "PARENT" using the webUI - Then no message should be displayed on the webUI - And folder "PARENT" should be listed on the webUI - When the user opens folder "PARENT" using the webUI - Then the following resources should be listed on the webUI - | entry_name | - | parent.txt | - | CHILD | - And as "Alice" folder "simple-empty-folder/PARENT" should exist in the server - And as "Alice" file "simple-empty-folder/PARENT/parent.txt" should exist in the server - And as "Alice" folder "simple-empty-folder/PARENT/CHILD" should exist in the server - - @smokeTest @ocisSmokeTest - Scenario: uploading a big file (when chunking is implemented this upload should be chunked) - Given a file with the size of "30000000" bytes and the name "big-video.mp4" has been created locally in the middleware - When the user uploads a created file "big-video.mp4" using the webUI - Then no message should be displayed on the webUI - And file "big-video.mp4" should be listed on the webUI - And as "Alice" the content of "big-video.mp4" in the server should be the same as the content of local file "big-video.mp4" - - - Scenario: conflict with a big file (when chunking is implemented this upload should be chunked) - Given a file with the size of "30000000" bytes and the name "big-video.mp4" has been created locally in the middleware - When the user renames file "lorem.txt" to "big-video.mp4" using the webUI - And the user reloads the current page of the webUI - And the user uploads a created file "big-video.mp4" with overwrite using the webUI - Then file "big-video.mp4" should be listed on the webUI - And as "Alice" the content of "big-video.mp4" in the server should be the same as the content of local file "big-video.mp4" - - @disablePreviews - Scenario: overwrite an existing file in a sub-folder - When the user opens folder "simple-folder" using the webUI - And the user uploads overwriting file "lorem.txt" using the webUI - Then file "lorem.txt" should be listed on the webUI - And as "Alice" the content of "simple-folder/lorem.txt" in the server should be the same as the content of local file "lorem.txt" - - @issue-ocis-2258 @disablePreviews - Scenario: upload overwriting a file into a public share - Given user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions and password "#Passw0rd" in the server - When the public uses the webUI to access the last public link created by user "Alice" with password "#Passw0rd" in a new session - And the user uploads overwriting file "lorem.txt" using the webUI - Then file "lorem.txt" should be listed on the webUI - And as "Alice" the content of "simple-folder/lorem.txt" in the server should be the same as the content of local file "lorem.txt" - - - Scenario: simple upload of a folder, with comma in its name, that does not exist before - When the user uploads folder "Folder,With,Comma" using the webUI - Then no message should be displayed on the webUI - And folder "Folder,With,Comma" should be listed on the webUI - When the user browses to the folder "Folder,With,Comma" on the files page - Then the following resources should be listed on the webUI - | entry_name | - | sunday,monday.txt | - And as "Alice" folder "Folder,With,Comma" should exist in the server - And as "Alice" file "Folder,With,Comma/sunday,monday.txt" should exist in the server diff --git a/tests/acceptance/features/webUIUpload/uploadEdgecases.feature b/tests/acceptance/features/webUIUpload/uploadEdgecases.feature deleted file mode 100644 index 852852964d0..00000000000 --- a/tests/acceptance/features/webUIUpload/uploadEdgecases.feature +++ /dev/null @@ -1,86 +0,0 @@ -Feature: File Upload - - As a QA engineer - I would like to test uploads of all kind of funny filenames via the WebUI - - These tests are written in a way that multiple file names are tested in one scenario - that is not academically correct but saves a lot of time - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has logged in using the webUI - And the user browses to the files page - - - Scenario: simple upload of a file that does not exist before - When the user uploads file "new-'single'quotes.txt" using the webUI - Then file "new-'single'quotes.txt" should be listed on the webUI - And as "Alice" the content of "new-'single'quotes.txt" in the server should be the same as the content of local file "new-'single'quotes.txt" - When the user uploads file "new-strängé filename (duplicate #2 &).txt" using the webUI - Then file "new-strängé filename (duplicate #2 &).txt" should be listed on the webUI - And as "Alice" the content of "new-strängé filename (duplicate #2 &).txt" in the server should be the same as the content of local file "new-strängé filename (duplicate #2 &).txt" - When the user uploads file "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" using the webUI - Then file "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" should be listed on the webUI - And as "Alice" the content of "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" in the server should be the same as the content of local file "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" - - @smokeTest @ocisSmokeTest - Scenario Outline: upload a new file into a sub folder - Given user "Alice" has created folder "" in the server - And the user has reloaded the current page of the webUI - And a file with the size of "3000" bytes and the name "0" has been created locally in the middleware - When the user opens folder "" using the webUI - And the user uploads a created file "0" using the webUI - Then file "0" should be listed on the webUI - And as "Alice" the content of "/0" in the server should be the same as the content of local file "0" - When the user uploads file "new-'single'quotes.txt" using the webUI - Then file "new-'single'quotes.txt" should be listed on the webUI - And as "Alice" the content of "/new-'single'quotes.txt" in the server should be the same as the content of local file "new-'single'quotes.txt" - When the user uploads file "new-strängé filename (duplicate #2 &).txt" using the webUI - Then file "new-strängé filename (duplicate #2 &).txt" should be listed on the webUI - And as "Alice" the content of "/new-strängé filename (duplicate #2 &).txt" in the server should be the same as the content of local file "new-strängé filename (duplicate #2 &).txt" - When the user uploads file "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" using the webUI - Then file "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" should be listed on the webUI - And as "Alice" the content of "/zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" in the server should be the same as the content of local file "zzzz-zzzz-will-be-at-the-end-of-the-folder-when-uploaded.txt" - Examples: - | folder-to-upload-to | - | 0 | - | 'single'quotes | - | strängé नेपाली folder | - - - Scenario: overwrite an existing file - Given user "Alice" has created file "'single'quotes.txt" in the server - And user "Alice" has created file "strängé filename (duplicate #2 &).txt" in the server - And user "Alice" has created file "zzzz-must-be-last-file-in-folder.txt" in the server - And the user has reloaded the current page of the webUI - When the user uploads overwriting file "'single'quotes.txt" using the webUI - Then file "'single'quotes.txt" should be listed on the webUI - And as "Alice" the content of "'single'quotes.txt" in the server should be the same as the content of local file "'single'quotes.txt" - When the user uploads overwriting file "strängé filename (duplicate #2 &).txt" using the webUI - Then file "strängé filename (duplicate #2 &).txt" should be listed on the webUI - And as "Alice" the content of "strängé filename (duplicate #2 &).txt" in the server should be the same as the content of local file "strängé filename (duplicate #2 &).txt" - When the user uploads overwriting file "zzzz-must-be-last-file-in-folder.txt" using the webUI - Then file "zzzz-must-be-last-file-in-folder.txt" should be listed on the webUI - And as "Alice" the content of "zzzz-must-be-last-file-in-folder.txt" in the server should be the same as the content of local file "zzzz-must-be-last-file-in-folder.txt" - - - Scenario Outline: upload a big file using difficult names (when chunking in implemented that upload should be chunked) - Given a file with the size of "30000000" bytes and the name has been created locally in the middleware - When the user uploads a created file using the webUI - Then file should be listed on the webUI - And as "Alice" the content of in the server should be the same as the content of local file - Examples: - | file-name | - | "&#" | - | "TIÄFÜ" | - - - # upload into "simple-folder" because there is already a folder called "0" in the root - Scenario: Upload a big file called "0" (when chunking in implemented that upload should be chunked) - Given user "Alice" has created folder "simple-folder" in the server - And the user has browsed to the personal page - And a file with the size of "30000000" bytes and the name "0" has been created locally in the middleware - When the user opens folder "simple-folder" using the webUI - And the user uploads a created file "0" using the webUI - Then file "0" should be listed on the webUI - And as "Alice" the content of "simple-folder/0" in the server should be the same as the content of local file "0" diff --git a/tests/e2e/cucumber/features/shares/link.feature b/tests/e2e/cucumber/features/shares/link.feature index 9722aac1605..7bf516607df 100644 --- a/tests/e2e/cucumber/features/shares/link.feature +++ b/tests/e2e/cucumber/features/shares/link.feature @@ -9,8 +9,9 @@ Feature: link Scenario: public link When "Alice" logs in And "Alice" creates the following folders in personal space using API - | name | - | folderPublic | + | name | + | folderPublic | + | folderPublic/SubFolder | And "Alice" creates the following files into personal space using API | pathToFile | content | | folderPublic/lorem.txt | lorem ipsum | @@ -38,13 +39,19 @@ Feature: link | lorem.txt | file | | textfile.txt | file | And "Anonymous" uploads the following resources in public link page - | resource | - | new-lorem.txt | + | resource | option | + | new-lorem.txt | | + | lorem.txt | replace | + And "Anonymous" moves the following resource using drag-drop + | resource | to | + | new-lorem.txt | SubFolder | + And "Anonymous" copies the following resource using sidebar-panel + | resource | to | + | lorem.txt | SubFolder | And "Anonymous" renames the following public link resources | resource | as | | lorem.txt | lorem_new.txt | | textfile.txt | textfile_new.txt | - | new-lorem.txt | test.txt | # currently upload folder feature is not available in playwright # And "Anonymous" uploads the following resources in public link page # | resource | diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index 7af2871de4f..ca9a49b0c6e 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -143,6 +143,11 @@ When( const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const resourceObject = new objects.applicationFiles.Resource({ page }) + // drag-n-drop always does MOVE + if (method.includes('drag-drop')) { + expect(actionType).toBe('moves') + } + for (const { resource, to, option } of stepTable.hashes()) { await resourceObject[actionType === 'copies' ? 'copy' : 'move']({ resource, @@ -167,6 +172,11 @@ When( const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const resourceObject = new objects.applicationFiles.Resource({ page }) + // drag-n-drop always does MOVE + if (method.includes('drag-drop')) { + expect(actionType).toBe('moves') + } + const resources = [].concat(...stepTable.rows()) await resourceObject[ actionType === 'copies' ? 'copyMultipleResources' : 'moveMultipleResources' From 85b2f96e29033dc87476b8e9c4236b9f1fb3e698 Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Fri, 10 May 2024 12:35:00 +0545 Subject: [PATCH 2/7] test: delete share, delete, trashbin and login accpetance suties (#10889) --- .drone.star | 18 --- .../deleteFilesFolders.feature | 79 ------------- .../webUIFilesDetails/fileDetails.feature | 72 ------------ .../features/webUILogin/openidLogin.feature | 47 -------- .../shareWithUsers.feature | 27 ----- .../trashbinDelete.feature | 104 ------------------ .../trashbinFilesFolders.feature | 46 -------- .../cucumber/features/shares/share.feature | 8 +- 8 files changed, 6 insertions(+), 395 deletions(-) delete mode 100644 tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature delete mode 100644 tests/acceptance/features/webUIFilesDetails/fileDetails.feature delete mode 100644 tests/acceptance/features/webUILogin/openidLogin.feature delete mode 100644 tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature delete mode 100644 tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature delete mode 100644 tests/acceptance/features/webUITrashbinFilesFolders/trashbinFilesFolders.feature diff --git a/.drone.star b/.drone.star index 8f932f61eeb..6e88b6657a7 100644 --- a/.drone.star +++ b/.drone.star @@ -101,22 +101,12 @@ config = { "", ], "suites": { - "oCISBasic": [ - "webUILogin", - ], "oCISFiles1": [ "webUICreateFilesFolders", - "webUIDeleteFilesFolders", - ], - "oCISFiles2": [ - "webUIFilesDetails", ], "oCISFiles5": [ "webUITextEditor", ], - "oCISSharingInternal2": [ - "webUISharingInternalUsers", - ], "oCISSharingPublic1": [ "webUISharingPublicBasic", ], @@ -127,8 +117,6 @@ config = { "webUISharingPublicDifferentRoles", ], "oCISTrashbinJourney": [ - "webUITrashbinDelete", - "webUITrashbinFilesFolders", "webUITrashbinRestore", ], }, @@ -150,17 +138,11 @@ config = { basicTestSuites = [ "webUICreateFilesFolders", - "webUIDeleteFilesFolders", - "webUIFilesDetails", - "webUILogin", "webUISharingAcceptShares", - "webUISharingInternalUsers", "webUISharingPublicBasic", "webUISharingPublicDifferentRoles", "webUISharingPublicManagement", "webUITextEditor", - "webUITrashbinDelete", - "webUITrashbinFilesFolders", "webUITrashbinRestore", ] diff --git a/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature b/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature deleted file mode 100644 index f53d85b5ba9..00000000000 --- a/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature +++ /dev/null @@ -1,79 +0,0 @@ -Feature: deleting files and folders - As a user - I want to delete files and folders - So that I can keep my filing system clean and tidy - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - - - Scenario Outline: Delete a file with problematic characters - Given user "Alice" has created file in the server - And user "Alice" has logged in using the webUI - When the user deletes file using the webUI - Then file should not be listed on the webUI - When the user reloads the current page of the webUI - Then file should not be listed on the webUI - Examples: - | file_name | - | "'single'" | - | "\"double\" quotes" | - | "question?" | - | "&and#hash" | - - - Scenario: delete a file on a public share with problematic characters - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has renamed the following file in the server - | from-name-parts | to-name-parts | - | lorem.txt | simple-folder/ | - | | 'single' | - | | "double" quotes | - | | question? | - | | &and#hash | - And user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions in the server - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user deletes the following file using the webUI - | name-parts | - | 'single' | - | "double" quotes | - | question? | - | &and#hash | - Then the following file should not be listed on the webUI - | name-parts | - | 'single' | - | "double" quotes | - | question? | - | &and#hash | - And no message should be displayed on the webUI - When the user reloads the current page of the webUI - Then the following file should not be listed on the webUI - | name-parts | - | 'single' | - | "double" quotes | - | question? | - | &and#hash | - - - - Scenario: Delete folder with dot in the name - Given user "Alice" has created the following folders in the server - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - And user "Alice" has logged in using the webUI - When the user batch deletes these files using the webUI - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - Then as "Alice" these folders should not be listed on the webUI - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | diff --git a/tests/acceptance/features/webUIFilesDetails/fileDetails.feature b/tests/acceptance/features/webUIFilesDetails/fileDetails.feature deleted file mode 100644 index 8ab02a25a95..00000000000 --- a/tests/acceptance/features/webUIFilesDetails/fileDetails.feature +++ /dev/null @@ -1,72 +0,0 @@ -Feature: User can open the details panel for any file or folder - As a user - I want to be able to open the details panel of any file or folder - So that the details of the file or folder are visible to me - - Background: - Given these users have been created with default attributes and without skeleton files in the server: - | username | - | Alice | - | Brian | - And user "Alice" has logged in using the webUI - - @files_versions-app-required - Scenario: View different areas of the app-sidebar for a file in files page - Given user "Alice" has created file "lorem.txt" in the server - And the user has browsed to the personal page - When the user opens the sidebar for file "lorem.txt" on the webUI - Then the app-sidebar should be visible - And the "details" details panel should be visible - And the "big" preview of thumbnail should be visible in the "details" panel - When the user switches to "actions" panel in details panel using the webUI - Then the "actions" details panel should be visible - And the "small" preview of thumbnail should be visible in the "actions" panel - When the user switches to "people" panel in details panel using the webUI - Then the "people" details panel should be visible - And the "small" preview of thumbnail should be visible in the "people" panel - When the user switches to "versions" panel in details panel using the webUI - Then the "versions" details panel should be visible - And the "small" preview of thumbnail should be visible in the "versions" panel - - @files_versions-app-required - Scenario: View different areas of the app-sidebar for a folder in files page - Given user "Alice" has created folder "simple-folder" in the server - And the user has browsed to the personal page - When the user opens the sidebar for folder "simple-folder" on the webUI - Then the app-sidebar should be visible - And the "details" details panel should be visible - And the "big" preview of thumbnail should be visible in the "details" panel - When the user switches to "actions" panel in details panel using the webUI - Then the "actions" details panel should be visible - And the "small" preview of thumbnail should be visible in the "actions" panel - When the user switches to "people" panel in details panel using the webUI - Then the "people" details panel should be visible - And the "small" preview of thumbnail should be visible in the "people" panel - - @ocis-reva-issue-106 - Scenario: without any share the shared-with-others page should be empty - When the user browses to the shared-with-others page using the webUI - Then there should be no resources listed on the webUI - - - Scenario: without any share the shared-with-me page should be empty - When the user browses to the shared-with-me page in accepted shares view - Then there should be no resources listed on the webUI - When the user browses to the shared-with-me page in declined shares view - Then there should be no resources listed on the webUI - - - Scenario: the sidebar is invisible after closing - Given user "Alice" has created file "lorem.txt" in the server - And the user has browsed to the personal page - When the user opens the sidebar for file "lorem.txt" on the webUI - Then the app-sidebar should be visible - When the user closes the app-sidebar using the webUI - Then the app-sidebar should be invisible - - @issue-4244 - Scenario: the sidebar is invisible after opening the selected folder - Given user "Alice" has created file "simple-folder" in the server - And the user has browsed to the personal page - When the user opens folder "simple-folder" using the webUI - Then the app-sidebar should be invisible diff --git a/tests/acceptance/features/webUILogin/openidLogin.feature b/tests/acceptance/features/webUILogin/openidLogin.feature deleted file mode 100644 index 2de9cd1d450..00000000000 --- a/tests/acceptance/features/webUILogin/openidLogin.feature +++ /dev/null @@ -1,47 +0,0 @@ -@openIdLogin @ocis-konnectd-issue-26 -Feature: login users - As a user - I want to be able to log into my account - So that I have access to my files - - As an admin - I want only authorised users to log in - So that unauthorised access is impossible - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - - - Scenario: admin login - Given the user has browsed to the login page - When the user clicks the authenticate button - And the user logs in with username "admin" and password "admin" using the webUI - Then the files table should be displayed - - - Scenario: logging out - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user logs out of the webUI - Then the user should be redirected to the IdP login page - - @ocisSmokeTest - Scenario: logging out redirects to the url with state attribute - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user logs out of the webUI - Then the user should be on page with the url containing "state=" - When user "Alice" logs in using the webUI - Then the files table should be displayed - - - Scenario: try to login with invalid username - Given the user has browsed to the login page - When the user tries to log in with username "invalid" and password "1234" using the webUI - Then the warning 'Logon failed. Please verify your credentials and try again.' should be displayed on the login page - - - Scenario: try to login with valid username and invalid password - Given the user has browsed to the login page - When the user tries to log in with username "Alice" and password "invalid" using the webUI - Then the warning 'Logon failed. Please verify your credentials and try again.' should be displayed on the login page diff --git a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature deleted file mode 100644 index a110c14e5df..00000000000 --- a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature +++ /dev/null @@ -1,27 +0,0 @@ -Feature: Sharing files and folders with internal users - As a user - I want to share files and folders with other users - So that those users can access the files and folders - - Background: - Given the administrator has set the default folder for received shares to "Shares" in the server - And these users have been created with default attributes and without skeleton files in the server: - | username | - | Alice | - | Brian | - And user "Brian" has created folder "simple-folder" in the server - - @issue-2897 @issue-ocis-2260 @disablePreviews - Scenario: sharing details of items inside a shared folder ("via" info) - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Carol" has been created with default attributes and without skeleton files in the server - And user "Alice" has uploaded file with content "test" to "/simple-folder/lorem.txt" in the server - And user "Alice" has shared folder "simple-folder" with user "Brian" in the server - And user "Alice" has logged in using the webUI - And the user opens folder "simple-folder" using the webUI - When the user opens the details dialog for folder "simple-empty-folder" using the webUI - Then the shared-via path in the details dialog should be "/simple-folder" - When the user opens the details dialog for file "lorem.txt" using the webUI - Then the shared-via path in the details dialog should be "/simple-folder" - diff --git a/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature b/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature deleted file mode 100644 index 082a66f0ce9..00000000000 --- a/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature +++ /dev/null @@ -1,104 +0,0 @@ -@files_trashbin-app-required @issue-ocis-web-118 -Feature: files and folders can be deleted from the trashbin - As a user - I want to delete files and folders from the trashbin - So that I can control my trashbin space and which files are kept in that space - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - Given user "Alice" has created file "lorem.txt" in the server - Given user "Alice" has created file "lorem-big.txt" in the server - And user "Alice" has created file "sample,1.txt" in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "Folder,With,Comma" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created file "simple-folder/lorem-big.txt" in the server - And user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And the following files have been deleted by user "Alice" in the server - | name | - | lorem.txt | - | simple-folder | - | sample,1.txt | - | lorem-big.txt | - | Folder,With,Comma | - | data.zip | - And user "Alice" has logged in using the webUI - And the user has browsed to the trashbin page - - @issue-product-188 - Scenario: Delete folders from trashbin and check that they are gone - When the user deletes the file "simple-folder" from the deleted files list - And the user deletes the file "Folder,With,Comma" from the deleted files list - Then folder "simple-folder" should not be listed on the webUI - And folder "Folder,With,Comma" should not be listed on the webUI - - @ocisSmokeTest @issue-4582 - Scenario: Select some files and delete from trashbin in a batch - When the user batch deletes these files permanently using the webUI - | name | - | lorem.txt | - | lorem-big.txt | - Then the deleted elements should not be listed on the webUI - And the deleted elements should not be listed on the webUI after a page reload - But file "data.zip" should be listed on the webUI - And folder "simple-folder" should be listed on the webUI - When the user browses to the files page - And file "lorem.txt" should not be listed on the webUI - And file "lorem-big.txt" should not be listed on the webUI - - @issue-4437 - Scenario: Delete single file from deleted files list - When the user deletes the file "lorem.txt" from the deleted files list - Then file "lorem.txt" should not be listed on the webUI - When the user reloads the current page of the webUI - Then file "lorem.txt" should not be listed on the webUI - - @issue-product-139 - Scenario: Clear trashbin - When the user clears the trashbin - Then the "success" message with header "All deleted files were removed" should be displayed on the webUI - And there should be no resources listed on the webUI - - - Scenario: Delete folders with dot in the name from trashbin - Given user "Alice" has created the following folders in the server - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - And the following folders have been deleted by user "Alice" in the server - | name | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - And the user has browsed to the trashbin page - And the user has reloaded the current page of the webUI - When the user batch deletes these files permanently using the webUI - | name | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - Then the deleted elements should not be listed on the webUI - And the deleted elements should not be listed on the webUI after a page reload - - @issue-product-188 @issue-4582 - Scenario: Select all except for some files and delete from trashbin in a batch - When the user marks all files for batch action using the webUI - And the user unmarks these files for batch action using the webUI - | name | - | lorem.txt | - | lorem-big.txt | - And the user batch deletes the marked files permanently using the webUI - Then file "lorem.txt" should be listed on the webUI - And file "lorem-big.txt" should be listed on the webUI - But file "data.zip" should not be listed on the webUI - And folder "simple-folder" should not be listed on the webUI - - @issue-product-188 @issue-4582 - Scenario: Select all files and delete from trashbin in a batch - When the user marks all files for batch action using the webUI - And the user batch deletes the marked files permanently using the webUI - Then there should be no resources listed on the webUI diff --git a/tests/acceptance/features/webUITrashbinFilesFolders/trashbinFilesFolders.feature b/tests/acceptance/features/webUITrashbinFilesFolders/trashbinFilesFolders.feature deleted file mode 100644 index 3b4cdfa2704..00000000000 --- a/tests/acceptance/features/webUITrashbinFilesFolders/trashbinFilesFolders.feature +++ /dev/null @@ -1,46 +0,0 @@ -@files_trashbin-app-required -Feature: files and folders exist in the trashbin after being deleted - As a user - I want deleted files and folders to be available in the trashbin - So that I can recover data easily - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And user "Alice" has uploaded file "lorem-big.txt" to "lorem-big.txt" in the server - And user "Alice" has uploaded file "new-lorem.txt" to "textfile0.txt" in the server - And user "Alice" has uploaded file "testavatar.png" to "testimage.png" in the server - And user "Alice" has created file "sample,1.txt" in the server - And user "Alice" has created file "strängé filename (duplicate #2 &).txt" in the server - And user "Alice" has created folder "Folder,With,Comma" in the server - And user "Alice" has created folder "strängé नेपाली folder" in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has uploaded file "lorem.txt" to "simple-folder/lorem.txt" in the server - And user "Alice" has uploaded file "lorem.txt" to "strängé नेपाली folder/lorem.txt" in the server - And user "Alice" has logged in using the webUI - - @issue-1910 - Scenario: trashbin list appears empty when no deleted files exist - When the user browses to the trashbin page - Then there should be no resources listed on the webUI - - - Scenario: Delete folders with dot in the name and check they are in the trashbin - Given user "Alice" has created the following folders in the server - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | ... | - | ..fo | - | fo.xyz | - And the following folders have been deleted by user "Alice" in the server - | name | - | fo. | - | fo.1 | - | fo...1.. | - | ... | - | ..fo | - | fo.xyz | - When the user browses to the trashbin page - Then the deleted elements should be listed on the webUI diff --git a/tests/e2e/cucumber/features/shares/share.feature b/tests/e2e/cucumber/features/shares/share.feature index 60c7e77eacc..f22b5b0e11a 100644 --- a/tests/e2e/cucumber/features/shares/share.feature +++ b/tests/e2e/cucumber/features/shares/share.feature @@ -190,8 +190,9 @@ Feature: share | myfolder | | mainFolder | And "Alice" creates the following files into personal space using API - | pathToFile | content | - | new.txt | some content | + | pathToFile | content | + | new.txt | some content | + | mainFolder/lorem.txt | lorem epsum | And "Alice" opens the "files" app When "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | resourceType | expirationDate | @@ -205,6 +206,9 @@ Feature: share | Name | Brian Murphy | | Additional info | brian@example.org | | Type | User | + And "Alice" checks the following access details of share "mainFolder/lorem.txt" for user "Brian" + | Name | Brian Murphy | + | Type | User | And "Alice" sets the expiration date of share "myfolder" of group "sales" to "+3 days" And "Alice" checks the following access details of share "myfolder" for group "sales" | Name | sales department | From 2c7752b2ed18fcd6661d9715b357d5a3607c759d Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Mon, 13 May 2024 18:31:10 +0545 Subject: [PATCH 3/7] test: add batch restore e2e test and remove acceptance counterparts (#10890) --- .drone.star | 8 - .../features/webUITextEditor/textFile.feature | 61 ----- .../trashbinRestore.feature | 210 ------------------ .../features/smoke/trashbinDelete.feature | 26 ++- .../features/smoke/urlJourneys.feature | 2 +- .../cucumber/features/spaces/project.feature | 2 +- tests/e2e/cucumber/steps/ui/resources.ts | 25 ++- .../objects/app-files/resource/actions.ts | 54 ++++- .../objects/app-files/resource/index.ts | 11 +- 9 files changed, 97 insertions(+), 302 deletions(-) delete mode 100644 tests/acceptance/features/webUITextEditor/textFile.feature delete mode 100644 tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature diff --git a/.drone.star b/.drone.star index 6e88b6657a7..aa9c238df18 100644 --- a/.drone.star +++ b/.drone.star @@ -104,9 +104,6 @@ config = { "oCISFiles1": [ "webUICreateFilesFolders", ], - "oCISFiles5": [ - "webUITextEditor", - ], "oCISSharingPublic1": [ "webUISharingPublicBasic", ], @@ -116,9 +113,6 @@ config = { "oCISSharingPublic3": [ "webUISharingPublicDifferentRoles", ], - "oCISTrashbinJourney": [ - "webUITrashbinRestore", - ], }, "extraEnvironment": { "NODE_TLS_REJECT_UNAUTHORIZED": "0", @@ -142,8 +136,6 @@ basicTestSuites = [ "webUISharingPublicBasic", "webUISharingPublicDifferentRoles", "webUISharingPublicManagement", - "webUITextEditor", - "webUITrashbinRestore", ] # minio mc environment variables diff --git a/tests/acceptance/features/webUITextEditor/textFile.feature b/tests/acceptance/features/webUITextEditor/textFile.feature deleted file mode 100644 index e5e17ff9bd8..00000000000 --- a/tests/acceptance/features/webUITextEditor/textFile.feature +++ /dev/null @@ -1,61 +0,0 @@ -Feature: create markdown files - As a user - I want to create markdown files - So that I can organize my text data in formatted form - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has uploaded file with content "simple markdown file" to "simple.md" in the server - And user "Alice" has logged in using the webUI - And the user has browsed to the personal page - - @disablePreviews - Scenario: create a new markdown file in the root directory - When the user creates a markdown file with the name "simple_new.md" using the webUI - Then the file "simple_new.md" should be displayed in the text editor webUI - When the user closes the text editor using the webUI - Then as "Alice" file "simple_new.md" should exist in the server - And file "simple_new.md" should be listed on the webUI - - @disablePreviews - Scenario: preview content of the file - When the user opens file "simple.md" in the text editor webUI - Then the file "simple.md" should be displayed in the text editor webUI - And the preview panel should have the content "simple markdown file" on the webUI - - @disablePreviews - Scenario: preview content of the file while editing - Given the user has opened file "simple.md" in the text editor webUI - When the user inputs the content "updating the file with new content" in the text editor webUI - Then the preview panel should have the content "updating the file with new content" on the webUI - - @disablePreviews - Scenario: open text file in text editor - Given user "Alice" has uploaded file with content "test" to "lorem.txt" in the server - And the user has reloaded the current page of the webUI - When the user opens file "lorem.txt" in the text editor webUI - Then the file "lorem.txt" should be displayed in the text editor webUI - - @disablePreviews - Scenario Outline: preview of files with text editor by clicking the action menu option - Given user "Alice" has uploaded file with content "test" to "lorem.txt" in the server - And the user has reloaded the current page of the webUI - When the user opens file "" in the text editor using the action menu option on the webUI - Then the file "" should be displayed in the text editor webUI - Examples: - | file | - | simple.md | - | lorem.txt | - - @disablePreviews - Scenario Outline: Previewing text writen in markdown format - Given the user has opened file "simple.md" in the text editor webUI - When the user inputs the content "" in the text editor webUI - Then the preview panel should have "" element with text "" - Examples: - | content | innertext | tagname | - | `code` | code | p > code | - | # heading | heading | h1 | - | ###### heading | heading | h6 | - | - list1 | list1 | ul > li | - | [link]() | link | p > a | diff --git a/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature b/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature deleted file mode 100644 index ba22de7afb0..00000000000 --- a/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature +++ /dev/null @@ -1,210 +0,0 @@ -@files_trashbin-app-required @ocis-reva-issue-112 -Feature: Restore deleted files/folders - As a user - I would like to restore files/folders - So that I can recover accidentally deleted files/folders in ownCloud - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has created file "sample,1.txt" in the server - And user "Alice" has created folder "Folder,With,Comma" in the server - And user "Alice" has logged in using the webUI - - @smokeTest @ocisSmokeTest - Scenario: Restore files - Given user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And the user has reloaded the current page of the webUI - When the user deletes file "data.zip" using the webUI - And the user deletes file "sample,1.txt" using the webUI - And the user browses to the trashbin page - Then file "data.zip" should be listed on the webUI - And file "sample,1.txt" should be listed on the webUI - When the user restores file "data.zip" from the trashbin using the webUI - And the user restores file "sample,1.txt" from the trashbin using the webUI - Then there should be no resources listed on the webUI - When the user browses to the files page - Then file "data.zip" should be listed on the webUI - And file "sample,1.txt" should be listed on the webUI - - - Scenario: Restore folder - Given user "Alice" has created folder "folder with space" in the server - And the user has browsed to the personal page - When the user deletes folder "folder with space" using the webUI - And the user deletes folder "Folder,With,Comma" using the webUI - And the user browses to the trashbin page - Then folder "folder with space" should be listed on the webUI - And folder "Folder,With,Comma" should be listed on the webUI - When the user restores folder "folder with space" from the trashbin using the webUI - And the user restores folder "Folder,With,Comma" from the trashbin using the webUI - Then there should be no resources listed on the webUI - When the user browses to the files page - Then folder "folder with space" should be listed on the webUI - And folder "Folder,With,Comma" should be listed on the webUI - - @smokeTest @issue-1502 - Scenario: Select some trashbin files and restore them in a batch - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And user "Alice" has uploaded file "lorem-big.txt" to "lorem-big.txt" in the server - And the following files have been deleted by user "Alice" in the server - | name | - | data.zip | - | lorem.txt | - | lorem-big.txt | - | simple-folder | - | sample,1.txt | - | Folder,With,Comma | - And the user has browsed to the trashbin page - When the user marks these files for batch action using the webUI - | name | - | lorem.txt | - | lorem-big.txt | - | sample,1.txt | - | Folder,With,Comma | - And the user batch restores the marked files using the webUI - # You can delete the line below after the issue-1502 is fixed - And the user reloads the current page of the webUI - Then file "data.zip" should be listed on the webUI - And folder "simple-folder" should be listed on the webUI - But file "lorem.txt" should not be listed on the webUI - And file "lorem-big.txt" should not be listed on the webUI - And file "sample,1.txt" should not be listed on the webUI - And folder "Folder,With,Comma" should not be listed on the webUI - When the user browses to the files page - And file "lorem.txt" should be listed on the webUI - And file "lorem-big.txt" should be listed on the webUI - And file "sample,1.txt" should be listed on the webUI - And folder "Folder,With,Comma" should be listed on the webUI - But file "data.zip" should not be listed on the webUI - And folder "simple-folder" should not be listed on the webUI - - @issue-1502 - Scenario: Select all except for some trashbin files and restore them in a batch - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And user "Alice" has uploaded file "lorem-big.txt" to "lorem-big.txt" in the server - And the following files have been deleted by user "Alice" in the server - | name | - | data.zip | - | lorem.txt | - | lorem-big.txt | - | simple-folder | - And the user has browsed to the trashbin page - When the user marks all files for batch action using the webUI - And the user unmarks these files for batch action using the webUI - | name | - | lorem.txt | - | lorem-big.txt | - And the user batch restores the marked files using the webUI - # You can delete the line below after the issue-1502 is fixed - And the user reloads the current page of the webUI - Then file "lorem.txt" should be listed on the webUI - And file "lorem-big.txt" should be listed on the webUI - But file "data.zip" should not be listed on the webUI - And folder "simple-folder" should not be listed on the webUI - When the user browses to the files page - Then file "data.zip" should be listed on the webUI - And folder "simple-folder" should be listed on the webUI - But file "lorem.txt" should not be listed on the webUI - And file "lorem-big.txt" should not be listed on the webUI - - @skipOnOC10 @issue-core-38039 - Scenario: Select all trashbin files and restore them in a batch - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And user "Alice" has uploaded file "lorem-big.txt" to "lorem-big.txt" in the server - And the following files have been deleted by user "Alice" in the server - | name | - | data.zip | - | lorem.txt | - | lorem-big.txt | - | simple-folder | - And the user has browsed to the trashbin page - When the user marks all files for batch action using the webUI - And the user batch restores the marked files using the webUI - Then there should be no resources listed on the webUI - And there should be no resources listed on the webUI after a page reload - When the user browses to the files page - Then file "lorem.txt" should be listed on the webUI - And file "lorem-big.txt" should be listed on the webUI - And file "data.zip" should be listed on the webUI - And folder "simple-folder" should be listed on the webUI - - @issue-1723 - Scenario: Delete and restore a file that has the same name like a deleted folder - Given user "Alice" has uploaded file "lorem.txt" to "lorem.txt" in the server - And the following files have been deleted by user "Alice" in the server - | name | - | lorem.txt | - And user "Alice" has created folder "lorem.txt" in the server - And the following folders have been deleted by user "Alice" in the server - | name | - | lorem.txt | - When the user browses to the trashbin page - And the user restores file "lorem.txt" from the trashbin using the webUI - Then the "success" message with header "lorem.txt was restored successfully" should be displayed on the webUI - And file "lorem.txt" should not be listed on the webUI - And folder "lorem.txt" should be listed on the webUI - When the user browses to the files page using the webUI - Then file "lorem.txt" should be listed on the webUI - And folder "lorem.txt" should not be listed on the webUI - - - Scenario: Delete and restore a folder that has the same name like a deleted file - Given user "Alice" has created file "lorem.txt" in the server - And the following files have been deleted by user "Alice" in the server - | name | - | lorem.txt | - And user "Alice" has created folder "lorem.txt" in the server - And the following folders have been deleted by user "Alice" in the server - | name | - | lorem.txt | - When the user browses to the trashbin page - And the user restores folder "lorem.txt" from the trashbin using the webUI - Then the "success" message with header "lorem.txt was restored successfully" should be displayed on the webUI - And folder "lorem.txt" should not be listed on the webUI - And file "lorem.txt" should be listed on the webUI - When the user browses to the files page using the webUI - Then folder "lorem.txt" should be listed on the webUI - And file "lorem.txt" should not be listed on the webUI - - @issue-1502 - Scenario: Delete and restore folders with dot in the name - Given user "Alice" has created the following folders in the server - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - And the following folders have been deleted by user "Alice" in the server - | name | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - And the user has browsed to the trashbin page - When the user marks these files for batch action using the webUI - | name | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - And the user batch restores the marked files using the webUI - And the user reloads the current page of the webUI - Then these folders should not be listed on the webUI - | name | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - When the user browses to the files page - Then the following folders should be listed on the webUI - | name | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | diff --git a/tests/e2e/cucumber/features/smoke/trashbinDelete.feature b/tests/e2e/cucumber/features/smoke/trashbinDelete.feature index 7cbaf895f23..ee0e5d1b645 100644 --- a/tests/e2e/cucumber/features/smoke/trashbinDelete.feature +++ b/tests/e2e/cucumber/features/smoke/trashbinDelete.feature @@ -43,12 +43,14 @@ Feature: Trashbin delete Scenario: delete and restore a file inside a received shared folder - Given "Alice" creates the following resources - | resource | type | - | folderToShare | folder | - And "Alice" uploads the following resource - | resource | to | - | lorem.txt | folderToShare | + Given "Alice" creates the following folders in personal space using API + | name | + | folderToShare | + | empty-folder | + And "Alice" creates the following files into personal space using API + | pathToFile | content | + | folderToShare/lorem.txt | lorem ipsum | + | sample.txt | sample | And "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | resourceType | | folderToShare | Brian | user | Can edit | folder | @@ -62,13 +64,21 @@ Feature: Trashbin delete Then following resources should not be displayed in the trashbin for user "Brian" | resource | | folderToShare/lorem.txt | + When "Alice" deletes the following resources using the sidebar panel + | resource | + | sample.txt | + | empty-folder | And "Alice" navigates to the trashbin - And following resources should be displayed in the trashbin for user "Alice" + Then following resources should be displayed in the trashbin for user "Alice" | resource | | folderToShare/lorem.txt | - And "Alice" restores the following resource from trashbin + And "Alice" restores the following resources from trashbin | resource | | folderToShare/lorem.txt | + And "Alice" restores the following resources from trashbin using the batch action + | resource | + | sample.txt | + | empty-folder | And "Alice" opens the "files" app And "Alice" opens folder "folderToShare" And following resources should be displayed in the files list for user "Alice" diff --git a/tests/e2e/cucumber/features/smoke/urlJourneys.feature b/tests/e2e/cucumber/features/smoke/urlJourneys.feature index a9372930df4..e11e8367506 100644 --- a/tests/e2e/cucumber/features/smoke/urlJourneys.feature +++ b/tests/e2e/cucumber/features/smoke/urlJourneys.feature @@ -30,7 +30,7 @@ Feature: web can be navigated through urls | name | content | | spaceTextfile.txt | This is test file. Cheers | When "Alice" navigates to "versions" details panel of file "lorem.txt" of space "personal" through the URL - Then "Alice" restores following resources + Then "Alice" restores following resources version | resource | to | version | openDetailsPanel | | lorem.txt | / | 1 | false | When "Alice" navigates to "sharing" details panel of file "lorem.txt" of space "personal" through the URL diff --git a/tests/e2e/cucumber/features/spaces/project.feature b/tests/e2e/cucumber/features/spaces/project.feature index db40104a312..dd2a061c0cb 100644 --- a/tests/e2e/cucumber/features/spaces/project.feature +++ b/tests/e2e/cucumber/features/spaces/project.feature @@ -169,7 +169,7 @@ Feature: spaces.personal And "Brian" downloads old version of the following resource | resource | to | | textfile.txt | parent | - And "Brian" restores following resources + And "Brian" restores following resources version | resource | to | version | openDetailsPanel | | textfile.txt | parent | 1 | true | And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index ca9a49b0c6e..acce2e23169 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -189,7 +189,7 @@ When( ) When( - '{string} restores following resource(s)', + '{string} restores following resource(s) version', async function (this: World, stepUser: string, stepTable: DataTable): Promise { const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const resourceObject = new objects.applicationFiles.Resource({ page }) @@ -310,14 +310,25 @@ Then( ) Then( - '{string} restores the following resource from trashbin', - async function (this: World, stepUser: string, stepTable: DataTable): Promise { + /^"([^"]*)" restores the following resource(?:s)? from trashbin( using the batch action)?$/, + async function ( + this: World, + stepUser: string, + batchAction: string, + stepTable: DataTable + ): Promise { const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const resourceObject = new objects.applicationFiles.Resource({ page }) - for (const info of stepTable.hashes()) { - const message = await resourceObject.restoreTrashBin({ resource: info.resource }) - const paths = info.resource.split('/') - expect(message).toBe(`${paths[paths.length - 1]} was restored successfully`) + if (batchAction) { + const resources = stepTable.hashes().map((info) => info.resource) + const message = await resourceObject.batchRestoreTrashBin({ resources }) + expect(message).toBe(`${resources.length} files restored successfully`) + } else { + for (const info of stepTable.hashes()) { + const message = await resourceObject.restoreTrashBin({ resource: info.resource }) + const paths = info.resource.split('/') + expect(message).toBe(`${paths[paths.length - 1]} was restored successfully`) + } } } ) diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index e6ac450ef1a..20c60b8a3f2 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -1236,6 +1236,11 @@ export interface restoreResourceTrashbinArgs { page: Page } +export interface batchRestoreTrashbinResourcesArgs { + resources: string[] + page: Page +} + export interface clickTagArgs { resource: string tag: string @@ -1254,18 +1259,31 @@ export interface createSpaceFromSelectionArgs { page: Page } -export const restoreResourceTrashbin = async ( - args: restoreResourceTrashbinArgs -): Promise => { - const { page, resource } = args +export const selectTrashbinResource = async (page: Page, resource: string): Promise => { const resourceCheckbox = page.locator( util.format(checkBoxForTrashbin, `/${resource.replace(/^\/+/, '')}`) ) if (!(await resourceCheckbox.isChecked())) { await resourceCheckbox.check() } +} + +export const restoreTrashBinResource = async ( + args: restoreResourceTrashbinArgs +): Promise => { + const { page, resource } = args + await selectTrashbinResource(page, resource) + + const resourceNameLocator = page.locator(util.format(resourceNameSelector, resource)) + const itemId = await resourceNameLocator.locator(fileRow).getAttribute('data-item-id') + await Promise.all([ - page.waitForResponse((resp) => resp.status() === 201 && resp.request().method() === 'MOVE'), + page.waitForResponse( + (resp) => + resp.status() === 201 && + resp.request().method() === 'MOVE' && + resp.request().url().endsWith(`/${itemId}`) + ), page.locator(restoreResourceButton).click() ]) @@ -1273,6 +1291,32 @@ export const restoreResourceTrashbin = async ( return message.trim().toLowerCase() } +export const batchRestoreTrashBinResources = async ( + args: batchRestoreTrashbinResourcesArgs +): Promise => { + const { page, resources } = args + + const waitResponses = [] + for (const resource of resources) { + await selectTrashbinResource(page, resource) + const resourceNameLocator = page.locator(util.format(resourceNameSelector, resource)) + const itemId = await resourceNameLocator.locator(fileRow).getAttribute('data-item-id') + waitResponses.push( + page.waitForResponse( + (resp) => + resp.status() === 201 && + resp.request().method() === 'MOVE' && + resp.request().url().endsWith(`/${itemId}`) + ) + ) + } + + await Promise.all([waitResponses, page.locator(restoreResourceButton).click()]) + + const message = await page.locator(notificationMessageDialog).textContent() + return message.trim().toLowerCase() +} + export const expectThatRestoreResourceButtonVisibility = async ( args: restoreResourceTrashbinArgs ): Promise => { diff --git a/tests/e2e/support/objects/app-files/resource/index.ts b/tests/e2e/support/objects/app-files/resource/index.ts index 27e2dc85732..2a908288edb 100644 --- a/tests/e2e/support/objects/app-files/resource/index.ts +++ b/tests/e2e/support/objects/app-files/resource/index.ts @@ -152,7 +152,16 @@ export class Resource { async restoreTrashBin(args: Omit): Promise { const startUrl = this.#page.url() - const message = await po.restoreResourceTrashbin({ ...args, page: this.#page }) + const message = await po.restoreTrashBinResource({ ...args, page: this.#page }) + await this.#page.goto(startUrl) + return message + } + + async batchRestoreTrashBin( + args: Omit + ): Promise { + const startUrl = this.#page.url() + const message = await po.batchRestoreTrashBinResources({ ...args, page: this.#page }) await this.#page.goto(startUrl) return message } From 8579e92e2ff746f9e015c4b16297c754a9afe167 Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Tue, 14 May 2024 14:10:08 +0545 Subject: [PATCH 4/7] [tests-only][full-ci] extend link share e2e test and remove acceptance suites (#10898) * test: remove file/folder creation webUI acceptance test suite * test: extend public link e2e tests and remove acceptance suite * test: spread the waitResponses array * test: fix rebase --- .drone.star | 8 - .../createFile.feature | 16 -- .../createFolderEdgeCases.feature | 62 ------ .../createFolders.feature | 82 -------- .../publicLinkCreate.feature | 181 ------------------ .../publicLinkEdit.feature | 94 --------- .../publicLinkPublicActions.feature | 93 --------- .../e2e/cucumber/features/shares/link.feature | 20 +- .../support/objects/app-files/page/public.ts | 2 +- .../objects/app-files/resource/actions.ts | 53 ++--- 10 files changed, 44 insertions(+), 567 deletions(-) delete mode 100644 tests/acceptance/features/webUICreateFilesFolders/createFile.feature delete mode 100644 tests/acceptance/features/webUICreateFilesFolders/createFolderEdgeCases.feature delete mode 100644 tests/acceptance/features/webUICreateFilesFolders/createFolders.feature delete mode 100644 tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature delete mode 100644 tests/acceptance/features/webUISharingPublicBasic/publicLinkEdit.feature delete mode 100644 tests/acceptance/features/webUISharingPublicBasic/publicLinkPublicActions.feature diff --git a/.drone.star b/.drone.star index aa9c238df18..f9e2aac76a2 100644 --- a/.drone.star +++ b/.drone.star @@ -101,12 +101,6 @@ config = { "", ], "suites": { - "oCISFiles1": [ - "webUICreateFilesFolders", - ], - "oCISSharingPublic1": [ - "webUISharingPublicBasic", - ], "oCISSharingPublic2": [ "webUISharingPublicManagement", ], @@ -131,9 +125,7 @@ config = { } basicTestSuites = [ - "webUICreateFilesFolders", "webUISharingAcceptShares", - "webUISharingPublicBasic", "webUISharingPublicDifferentRoles", "webUISharingPublicManagement", ] diff --git a/tests/acceptance/features/webUICreateFilesFolders/createFile.feature b/tests/acceptance/features/webUICreateFilesFolders/createFile.feature deleted file mode 100644 index 39aafe8e0b7..00000000000 --- a/tests/acceptance/features/webUICreateFilesFolders/createFile.feature +++ /dev/null @@ -1,16 +0,0 @@ -Feature: create files - As a user - I want to create files - So that I can organize my data - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has created file "/lorem.txt" in the server - And user "Alice" has logged in using the webUI - And the user has browsed to the personal page - - - Scenario: try to create a file that already exists - When the user tries to create a file with already existing name "lorem.txt" using the webUI - Then the error message "lorem.txt already exists" should be displayed on the webUI dialog prompt - And the create file button should be disabled diff --git a/tests/acceptance/features/webUICreateFilesFolders/createFolderEdgeCases.feature b/tests/acceptance/features/webUICreateFilesFolders/createFolderEdgeCases.feature deleted file mode 100644 index f7c2669c148..00000000000 --- a/tests/acceptance/features/webUICreateFilesFolders/createFolderEdgeCases.feature +++ /dev/null @@ -1,62 +0,0 @@ -Feature: create folder - As a user - I want to create folders - So that I can organise my data structure - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has logged in using the webUI - And the user has reloaded the current page of the webUI - - - Scenario Outline: Create a folder using special characters - When the user creates a folder with the name using the webUI - Then folder should be listed on the webUI - When the user reloads the current page of the webUI - Then folder should be listed on the webUI - Examples: - | folder_name | - | '"somequotes1"' | - | "'somequotes2'" | - | "\"quote\"d-folders'" | - | "^#29][29@({" | - | "+-{$(882)" | - | "home" | - | "Sample,Folder,With,Comma" | - | 'सिमप्ले फोल्देर $%#?&@' | - - @issue-2467 @ocis-reva-issue-106 - Scenario Outline: Create a sub-folder inside a folder with problematic name - # First try and create a folder with problematic name - # Then try and create a sub-folder inside the folder with problematic name - When the user creates a folder with the name using the webUI - And the user opens folder using the webUI - Then there should be no resources listed on the webUI - When the user creates a folder with the name "sub-folder" using the webUI - Then folder "sub-folder" should be listed on the webUI - When the user reloads the current page of the webUI - Then folder "sub-folder" should be listed on the webUI - And as "Alice" folder "sub-folder" should exist inside folder in the server - Examples: - | folder | - #| "?&%0" | - | "^#2929@" | - | "home" | - - @smokeTest @ocis-reva-issue-106 - Scenario Outline: Create a sub-folder inside an existing folder with problematic name - # Use an existing folder with problematic name to create a sub-folder - # Uses the folder created by skeleton - Given user "Alice" has created folder in the server - And the user has reloaded the current page of the webUI - When the user opens folder using the webUI - And the user creates a folder with the name "sub-folder" using the webUI - Then folder "sub-folder" should be listed on the webUI - When the user reloads the current page of the webUI - Then folder "sub-folder" should be listed on the webUI - And as "Alice" folder "sub-folder" should exist inside folder in the server - Examples: - | folder | - | "0" | - | "'single'quotes" | - | "strängé नेपाली folder" | diff --git a/tests/acceptance/features/webUICreateFilesFolders/createFolders.feature b/tests/acceptance/features/webUICreateFilesFolders/createFolders.feature deleted file mode 100644 index 5dd3d539f94..00000000000 --- a/tests/acceptance/features/webUICreateFilesFolders/createFolders.feature +++ /dev/null @@ -1,82 +0,0 @@ -Feature: create folders - As a user - I want to create folders - So that I can organise my data structure - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has logged in using the webUI - And the user has reloaded the current page of the webUI - - - Scenario: Create a folder with default name - When the user creates a folder with default name using the webUI - Then folder "New folder" should be listed on the webUI - - - Scenario: Try to create a folder without name - When the user tries to create a folder with the invalid name "" using the webUI - Then the error message 'Folder name cannot be empty' should be displayed on the webUI dialog prompt - And the create folder button should be disabled - - - Scenario: Try to create a folder with existing name - Given user "Alice" has created folder "simple-folder" in the server - And the user has reloaded the current page of the webUI - When the user tries to create a folder with the invalid name "simple-folder" using the webUI - Then the error message 'simple-folder already exists' should be displayed on the webUI dialog prompt - And the create folder button should be disabled - - - Scenario: Try to create a folder with invalid name - When the user tries to create a folder with the invalid name "../folder" using the webUI - Then the error message 'Folder name cannot contain "/"' should be displayed on the webUI dialog prompt - And the create folder button should be disabled - - - Scenario: Try to create a folder with another invalid name - When the user tries to create a folder with the invalid name "folder/subfolder" using the webUI - Then the error message 'Folder name cannot contain "/"' should be displayed on the webUI dialog prompt - And the create folder button should be disabled - - - Scenario: Create folder with special characters in its name and browse to that folder - When the user creates a folder with the name "?&%0" using the webUI - And the user opens folder "?&%0" using the webUI - And the user reloads the current page of the webUI - Then the files table should be displayed - - - - Scenario: Create a folder in a public share - Given user "Alice" has created folder "simple-empty-folder" in the server - And user "Alice" has shared folder "simple-empty-folder" with link with "read,create" permissions in the server - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user creates a folder with the name "top-folder" using the webUI - And the user opens folder "top-folder" using the webUI - Then there should be no resources listed on the webUI - When the user creates a folder with the name "sub-folder" using the webUI - Then folder "sub-folder" should be listed on the webUI - When the user reloads the current page of the webUI - Then folder "sub-folder" should be listed on the webUI - - - Scenario: Create folders with dot in the name - When the user creates the following folders using the webUI - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - Then the following folders should be listed on the webUI - | folders | - | fo. | - | fo.1 | - | fo...1.. | - | fo.xyz | - - - @skipOnOC10 @issue-5518 - Scenario: User creates a folder with .part in the name - When the user creates a folder with the name "fo.part" using the webUI - Then folder "fo.part" should be listed on the webUI diff --git a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature deleted file mode 100644 index 1aaa3ce3511..00000000000 --- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature +++ /dev/null @@ -1,181 +0,0 @@ -@public_link_share-feature-required -Feature: Create public link shares - As a user - I want to share files through a publicly accessible link - So that users who do not have an account on my ownCloud server can access them - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - - @smokeTest @ocisSmokeTest @issue-ocis-reva-383 - Scenario: simple folder sharing by public link - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for resource "simple-folder" using the webUI - Then user "Alice" should have a share with these details in the server: - | field | value | - | share_type | public_link | - | uid_owner | Alice | - | permissions | read | - | path | /simple-folder | - | name | Link | - And a link named "Link" should be listed with role "Anyone with the link can view" in the public link list of resource "simple-folder" on the webUI - When the public uses the webUI to access the last public link created by user "Alice" in a new session - Then file "lorem.txt" should be listed on the webUI - - @skipOnOC10 @smokeTest @ocisSmokeTest @issue-ocis-reva-383 - Scenario: simple file sharing by public link - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for resource "lorem.txt" using the webUI - Then user "Alice" should have a share with these details in the server: - | field | value | - | share_type | public_link | - | uid_owner | Alice | - | permissions | read | - | path | /lorem.txt | - | name | Link | - And a link named "Link" should be listed with role "Anyone with the link can view" in the public link list of resource "lorem.txt" on the webUI - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user closes the text editor using the webUI - Then file "lorem.txt" should be listed on the webUI as single share - - @skipOnOC10 @issue-ocis-reva-383 - # When this issue is fixed delete this scenario and use the one above - Scenario: simple folder sharing by public link (ocis bug demonstration) - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for resource "simple-folder" using the webUI - Then user "Alice" should have a share with these details in the server: - | field | value | - | share_type | public_link | - | uid_owner | Alice | - | permissions | read | - | path | /simple-folder | - When the public uses the webUI to access the last public link created by user "Alice" in a new session - Then file "lorem.txt" should be listed on the webUI - - @skipOnOC10 @issue-ocis-reva-383 - # When this issue is fixed delete this scenario and use the one above - Scenario: simple file sharing by public link (ocis bug demonstration) - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for resource "lorem.txt" using the webUI - Then user "Alice" should have a share with these details in the server: - | field | value | - | share_type | public_link | - | uid_owner | Alice | - | permissions | read | - | path | /lorem.txt | - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user closes the text editor using the webUI - Then file "lorem.txt" should be listed on the webUI as single share - - @issue-ocis-reva-389 - Scenario: user shares a public link with folder longer than 64 chars and shorter link name - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has renamed folder "simple-folder" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" using the webUI - And the public uses the webUI to access the last public link created by user "Alice" in a new session - Then file "lorem.txt" should be listed on the webUI - - - Scenario: share two files with same name but different paths by public link - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created file "lorem.txt" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for file "lorem.txt" using the webUI - And the user opens folder "simple-folder" using the webUI - And the user creates a new public link for file "lorem.txt" using the webUI - # using the webui to navigate creates a problem because "successfully created link" notifications block the nav - And the user has browsed to the shared-via-link page - Then file with path "lorem.txt" should be listed on the webUI - And file with path "simple-folder/lorem.txt" should be listed on the webUI - - - Scenario: user creates a multiple public link of a file and delete the first link - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | first-name | - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | second-name | - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | third-name | - And user "Alice" has logged in using the webUI - When the user removes the public link named "first-name" of file "lorem.txt" using the webUI - Then public link named "first-name" should not be listed on the public links list on the webUI - And a link named "second-name" should be listed with role "Anyone with the link can view" in the public link list of file "lorem.txt" on the webUI - And a link named "third-name" should be listed with role "Anyone with the link can view" in the public link list of folder "lorem.txt" on the webUI - - - Scenario: user creates a multiple public link of a file and delete the second link - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | first-name | - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | second-name | - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | third-name | - And user "Alice" has logged in using the webUI - When the user removes the public link named "second-name" of file "lorem.txt" using the webUI - Then public link named "second-name" should not be listed on the public links list on the webUI - And a link named "first-name" should be listed with role "Anyone with the link can view" in the public link list of file "lorem.txt" on the webUI - And a link named "third-name" should be listed with role "Anyone with the link can view" in the public link list of folder "lorem.txt" on the webUI - - - Scenario: user creates a multiple public link of a file and delete the third link - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | first-name | - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | second-name | - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | third-name | - And user "Alice" has logged in using the webUI - When the user removes the public link named "third-name" of file "lorem.txt" using the webUI - Then public link named "third-name" should not be listed on the public links list on the webUI - And a link named "first-name" should be listed with role "Anyone with the link can view" in the public link list of file "lorem.txt" on the webUI - And a link named "second-name" should be listed with role "Anyone with the link can view" in the public link list of folder "lorem.txt" on the webUI - - - Scenario Outline: user creates multiple public links with same name for the same file/folder - Given user "Alice" has created "" in the server - And user "Alice" has logged in using the webUI - When the user creates a new public link for "" using the webUI - And the user creates a new public link for "" using the webUI - Then the tokens should be unique for each public links on the webUI - Examples: - | element | name | - | folder | simple-folder | - | file | lorem.txt | - - - Scenario: User can create a public link via quick action - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has logged in using the webUI - When the user creates a public link via quick action for resource "simple-folder" using the webUI - Then user "Alice" should have a share with these details in the server: - | field | value | - | share_type | public_link | - | uid_owner | Alice | - | permissions | read | - | path | /simple-folder | - | name | Link | - And the following success message should be displayed on the webUI - """ - The link has been copied to your clipboard. - """ diff --git a/tests/acceptance/features/webUISharingPublicBasic/publicLinkEdit.feature b/tests/acceptance/features/webUISharingPublicBasic/publicLinkEdit.feature deleted file mode 100644 index 1d9899d59b9..00000000000 --- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkEdit.feature +++ /dev/null @@ -1,94 +0,0 @@ -@public_link_share-feature-required -Feature: Edit public link shares - As a user - I want to edit public share - So that I can manage the the shares - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - - Scenario: user edits a name of an already existing public link - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has logged in using the webUI - And user "Alice" has created a public link with following settings in the server - | path | simple-folder | - | name | Public-link | - | permissions | read | - | password | #Passw0rd | - When the user renames the public link named "Public-link" of folder "simple-folder" to "simple-folder Share" - And the public uses the webUI to access the last public link created by user "Alice" with password "#Passw0rd" in a new session - Then file "lorem.txt" should be listed on the webUI - - @issue-ocis-reva-292 - Scenario: user edits the permission of an already existing public link from read-write to read - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | simple-folder | - | name | Public-link | - | permissions | read, update, create, delete | - And user "Alice" has logged in using the webUI - When the user tries to edit the public link named "Public-link" of folder "simple-folder" changing the role to "Viewer" - And the public uses the webUI to access the last public link created by user "Alice" in a new session - Then file "lorem.txt" should be listed on the webUI - And it should not be possible to delete file "lorem.txt" using the webUI - - @issue-ocis-reva-292 @disablePreviews - Scenario: user edits the permission of an already existing public link from read to read-write - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | simple-folder | - | name | Public-link | - | permissions | read | - And user "Alice" has logged in using the webUI - When the user tries to edit the public link named "Public-link" of folder "simple-folder" changing the role to "Editor" - And the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user deletes the following elements using the webUI - | name | - | simple-empty-folder | - And the user deletes the following elements using the webUI - | name-parts | - | lorem.txt | - Then the deleted elements should not be listed on the webUI - And the deleted elements should not be listed on the webUI after a page reload - - @issue-ocis-reva-389 - Scenario: user removes the public link of a file using webUI - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has logged in using the webUI - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | Public-link | - | permissions | read | - When the user removes the public link named "Public-link" of file "lorem.txt" using the webUI - Then user "Alice" should not have any public link in the server - - - Scenario: user edits the permission of an already existing public link from read-write to read-create - Given user "Alice" has created folder "simple-folder" in the server - And user "Alice" has created file "simple-folder/simple.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | simple-folder | - | name | Public-link | - | permissions | read, update, create, delete | - And user "Alice" has logged in using the webUI - When the user tries to edit the public link named "Public-link" of folder "simple-folder" changing the role to "Contributor" - And the public uses the webUI to access the last public link created by user "Alice" in a new session - And the user uploads file "lorem.txt" using the webUI - Then file "simple.txt" should be listed on the webUI - And file "lorem.txt" should be listed on the webUI - - @skipOnOC10 - Scenario: assign password to already created public share - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | lorem.txt | - | name | Public-link | - And user "Alice" has logged in using the webUI - When the user tries to edit the public link named "Public-link" of folder "lorem.txt" adding a password "#Password123" - And the public uses the webUI to access the last public link created by user "Alice" with password "#Password123" in a new session - And the user closes the text editor using the webUI - Then file "lorem.txt" should be listed on the webUI as single share diff --git a/tests/acceptance/features/webUISharingPublicBasic/publicLinkPublicActions.feature b/tests/acceptance/features/webUISharingPublicBasic/publicLinkPublicActions.feature deleted file mode 100644 index a42adbb68e3..00000000000 --- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkPublicActions.feature +++ /dev/null @@ -1,93 +0,0 @@ -@public_link_share-feature-required -Feature: Access public link shares by public - As a public - I want to access links shared by a owncloud user - So that I get access to files on owncloud - - Background: - Given user "Alice" has been created with default attributes and without skeleton files in the server - And user "Alice" has created folder "simple-folder" in the server - - - Scenario: public should be able to access a public link with correct password - Given user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions and password "#Passw0rd" in the server - When the public uses the webUI to access the last public link created by user "Alice" with password "#Passw0rd" in a new session - Then file "lorem.txt" should be listed on the webUI - - - Scenario: public should not be able to access a public link with wrong password - Given user "Alice" has shared folder "simple-folder" with link with "read" permissions and password "#Passw0rd" in the server - When the public uses the webUI to access the last public link created by user "Alice" with password "#Passwrd" in a new session - Then the public should not get access to the publicly shared file - - - Scenario: public creates a folder in the public link - Given user "Alice" has created a public link with following settings in the server - | path | /simple-folder | - | name | public link | - | permissions | read, create | - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the public creates a folder with the name "public-created-folder" using the webUI - Then folder "public-created-folder" should be listed on the webUI - When the public reloads the current page of the webUI - Then folder "public-created-folder" should be listed on the webUI - And as "Alice" folder "/simple-folder/public-created-folder" should exist in the server - - @skipOnOC10 @issue-4582 - Scenario: public batch deletes resources in the public link - Given user "Alice" has uploaded file "data.zip" to "simple-folder/data.zip" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | /simple-folder | - | name | public link | - | permissions | read, create, delete, update | - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the public marks these files for batch action using the webUI - | name | - | lorem.txt | - | simple-empty-folder | - | data.zip | - And the public batch deletes the marked files using the webUI - Then file "data.zip" should not be listed on the webUI - And folder "simple-empty-folder" should not be listed on the webUI - And file "lorem.txt" should not be listed on the webUI - And as "Alice" folder "/simple-folder/simple-empty-folder" should not exist in the server - And as "Alice" file "/simple-folder/lorem.txt" should not exist in the server - And as "Alice" file "/simple-folder/data.zip" should not exist in the server - - - Scenario: files are not selected initially in the public share - Given user "Alice" has uploaded file "data.zip" to "simple-folder/data.zip" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | /simple-folder | - | name | public link | - When the public uses the webUI to access the last public link created by user "Alice" in a new session - Then these files should not be selected on the webUI - | name | - | lorem.txt | - | simple-empty-folder | - | data.zip | - - - Scenario: public selects files and clear the selection in the public share - Given user "Alice" has uploaded file "data.zip" to "simple-folder/data.zip" in the server - And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server - And user "Alice" has created file "simple-folder/lorem.txt" in the server - And user "Alice" has created a public link with following settings in the server - | path | /simple-folder | - | name | public link | - When the public uses the webUI to access the last public link created by user "Alice" in a new session - And the public marks these files for batch action using the webUI - | name | - | lorem.txt | - | simple-empty-folder | - | data.zip | - Then these files should be selected on the webUI - | name | - | lorem.txt | - | simple-empty-folder | - | data.zip | diff --git a/tests/e2e/cucumber/features/shares/link.feature b/tests/e2e/cucumber/features/shares/link.feature index 7bf516607df..a20082774af 100644 --- a/tests/e2e/cucumber/features/shares/link.feature +++ b/tests/e2e/cucumber/features/shares/link.feature @@ -42,20 +42,28 @@ Feature: link | resource | option | | new-lorem.txt | | | lorem.txt | replace | + And "Anonymous" creates the following resources + | resource | type | + | myfolder | folder | + | myfolder/child | folder | + # currently upload folder feature is not available in playwright + # And "Anonymous" uploads the following resources in public link page + # | resource | + # | filesForUpload/PARENT | And "Anonymous" moves the following resource using drag-drop | resource | to | | new-lorem.txt | SubFolder | And "Anonymous" copies the following resource using sidebar-panel - | resource | to | - | lorem.txt | SubFolder | + | resource | to | + | lorem.txt | myfolder | And "Anonymous" renames the following public link resources | resource | as | | lorem.txt | lorem_new.txt | | textfile.txt | textfile_new.txt | - # currently upload folder feature is not available in playwright - # And "Anonymous" uploads the following resources in public link page - # | resource | - # | filesForUpload/PARENT | + And "Anonymous" deletes the following resources from public link using batch action + | resource | from | + | lorem.txt | myfolder | + | child | myfolder | And "Alice" removes the public link named "myPublicLink" of resource "folderPublic" And "Anonymous" should not be able to open the old link "myPublicLink" And "Alice" logs out diff --git a/tests/e2e/support/objects/app-files/page/public.ts b/tests/e2e/support/objects/app-files/page/public.ts index 1356ffca9c0..781a6aa0485 100644 --- a/tests/e2e/support/objects/app-files/page/public.ts +++ b/tests/e2e/support/objects/app-files/page/public.ts @@ -78,7 +78,7 @@ export class Public { async delete(args: Omit): Promise { const startUrl = this.#page.url() - await po.deleteResource({ ...args, page: this.#page }) + await po.deleteResource({ ...args, page: this.#page, isPublicLink: true }) await this.#page.goto(startUrl) } diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 20c60b8a3f2..86d2ec27e38 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -1074,12 +1074,13 @@ export const restoreResourceVersion = async (args: resourceVersionArgs) => { export interface deleteResourceArgs { page: Page resourcesWithInfo: resourceArgs[] - folder?: string via: ActionViaType + folder?: string + isPublicLink?: boolean } export const deleteResource = async (args: deleteResourceArgs): Promise => { - const { page, resourcesWithInfo, folder, via } = args + const { page, resourcesWithInfo, folder, via, isPublicLink } = args switch (via) { case 'SIDEBAR_PANEL': { if (folder) { @@ -1102,30 +1103,34 @@ export const deleteResource = async (args: deleteResourceArgs): Promise => case 'BATCH_ACTION': { await selectOrDeselectResources({ page, resources: resourcesWithInfo, folder, select: true }) - const deletetedResources = [] - if (resourcesWithInfo.length <= 1) { - throw new Error('Single resource or objects cannot be deleted with batch action') - } - await Promise.all([ - page.waitForResponse((resp) => { - if (resp.status() === 204 && resp.request().method() === 'DELETE') { - deletetedResources.push(decodeURIComponent(resp.url().split('/').pop())) - } - // waiting for GET response after all the resource are deleted with batch action - return ( - resp.url().includes('graph/v1.0/drives') && - resp.status() === 200 && - resp.request().method() === 'GET' + const waitResponses = [] + for (const info of resourcesWithInfo) { + waitResponses.push( + page.waitForResponse( + (resp) => + resp.status() === 204 && + resp.request().method() === 'DELETE' && + resp + .request() + .url() + .endsWith(`/${encodeURIComponent(info.name)}`) ) - }), - page.locator(deleteButtonBatchAction).click() - ]) - // assertion that the resources actually got deleted - expect(deletetedResources.length).toBe(resourcesWithInfo.length) - for (const resource of resourcesWithInfo) { - expect(deletetedResources).toContain(resource.name) + ) + } + if (!isPublicLink) { + // wait for GET response after all the resource are deleted with batch action + waitResponses.push( + page.waitForResponse( + (resp) => + resp.url().includes('graph/v1.0/drives') && + resp.status() === 200 && + resp.request().method() === 'GET' + ) + ) } + + await Promise.all([...waitResponses, page.locator(deleteButtonBatchAction).click()]) break } } @@ -1311,7 +1316,7 @@ export const batchRestoreTrashBinResources = async ( ) } - await Promise.all([waitResponses, page.locator(restoreResourceButton).click()]) + await Promise.all([...waitResponses, page.locator(restoreResourceButton).click()]) const message = await page.locator(notificationMessageDialog).textContent() return message.trim().toLowerCase() From 4eb2e4129c7bf9a31ff09101358ee9eaeddeaec7 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Thu, 21 Mar 2024 07:33:01 +0100 Subject: [PATCH 5/7] [test-only]download image file from editor (#10637) * download image file from editor * Update download.feature --- .../e2e/cucumber/features/shares/link.feature | 4 -- .../cucumber/features/smoke/download.feature | 65 +++++++++++++++++++ tests/e2e/cucumber/steps/ui/resources.ts | 9 +++ .../objects/app-files/resource/actions.ts | 2 +- 4 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 tests/e2e/cucumber/features/smoke/download.feature diff --git a/tests/e2e/cucumber/features/shares/link.feature b/tests/e2e/cucumber/features/shares/link.feature index a20082774af..9f95cbc34e2 100644 --- a/tests/e2e/cucumber/features/shares/link.feature +++ b/tests/e2e/cucumber/features/shares/link.feature @@ -28,10 +28,6 @@ Feature: link And "Anonymous" drop uploads following resources | resource | | textfile.txt | - When "Alice" downloads the following resources using the batch action - | resource | from | type | - | lorem.txt | folderPublic | file | - | textfile.txt | folderPublic | file | And "Alice" edits the public link named "myPublicLink" of resource "folderPublic" changing role to "Can edit" And "Anonymous" refreshes the old link And "Anonymous" downloads the following public link resources using the sidebar panel diff --git a/tests/e2e/cucumber/features/smoke/download.feature b/tests/e2e/cucumber/features/smoke/download.feature new file mode 100644 index 00000000000..efa3a071c6b --- /dev/null +++ b/tests/e2e/cucumber/features/smoke/download.feature @@ -0,0 +1,65 @@ +Feature: Download + As a user + I want to download resources + + + Background: + Given "Admin" creates following user using API + | id | + | Alice | + | Brian | + + + Scenario: download resources + When "Alice" logs in + And "Alice" creates the following folders in personal space using API + | name | + | folderPublic | + | emptyFolder | + And "Alice" creates the following files into personal space using API + | pathToFile | content | + | folderPublic/lorem.txt | lorem ipsum | + And "Alice" uploads the following local file into personal space using API + | localFile | to | + | filesForUpload/testavatar.jpg | testavatar.jpg | + And "Alice" shares the following resource using API + | resource | recipient | type | role | + | folderPublic | Brian | user | Can edit | + | emptyFolder | Brian | user | Can edit | + | testavatar.jpg | Brian | user | Can edit | + + When "Alice" opens the "files" app + And "Alice" downloads the following resources using the batch action + | resource | type | + | folderPublic | folder | + | emptyFolder | folder | + | testavatar.jpg | file | + And "Alice" opens the following file in mediaviewer + | resource | + | testavatar.jpg | + And "Alice" downloads the following image from the mediaviewer + | resource | + | testavatar.jpg | + And "Alice" closes the file viewer + And "Alice" logs out + + And "Brian" logs in + And "Brian" navigates to the shared with me page + And "Brian" downloads the following resources using the batch action + | resource | type | + | folderPublic | folder | + | emptyFolder | folder | + | testavatar.jpg | file | + And "Brian" downloads the following resources using the sidebar panel + | resource | from | type | + | lorem.txt | folderPublic | file | + | testavatar.jpg | | file | + | folderPublic | | folder | + | emptyFolder | | folder | + And "Brian" opens the following file in mediaviewer + | resource | + | testavatar.jpg | + And "Brian" downloads the following image from the mediaviewer + | resource | + | testavatar.jpg | + And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index acce2e23169..9918b0f4281 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -111,6 +111,15 @@ When( } ) +When( + /^"([^"]*)" downloads the following image(?:s)? from the mediaviewer$/, + async function (this: World, stepUser: string, stepTable: DataTable) { + const { page } = this.actorsEnvironment.getActor({ key: stepUser }) + const resourceObject = new objects.applicationFiles.Resource({ page }) + await processDownload(stepTable, resourceObject, 'preview') + } +) + When( /^"([^"]*)" deletes the following resource(?:s)? using the (sidebar panel|batch action)$/, async function (this: World, stepUser: string, actionType: string, stepTable: DataTable) { diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 86d2ec27e38..9a12c0a4dc5 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -19,6 +19,7 @@ const downloadFileButtonSideBar = const downloadFolderButtonSideBar = '#oc-files-actions-sidebar .oc-files-actions-download-archive-trigger' const downloadButtonBatchAction = '.oc-files-actions-download-archive-trigger' +const downloadPreviewButton = '#preview-download' const deleteButtonBatchAction = '.oc-files-actions-delete-trigger' const createSpaceFromResourceAction = '.oc-files-actions-create-space-from-resource-trigger' const checkBox = `//*[@data-test-resource-name="%s"]//ancestor::tr//input` @@ -717,7 +718,6 @@ export const downloadResources = async (args: downloadResourcesArgs): Promise Date: Thu, 2 May 2024 09:54:40 +0545 Subject: [PATCH 6/7] [tests-only] [full-ci] Port PR #10670 (#10837) * [tests-only] [full-ci] Remove acceptance test related to image preview (#10670) * remove acceptance test related to media preview * address review * add assertion for media navigation action * change step description * select the first element found by locator * refactor test step to download from topbar * update step description * remove identical step implementation to download resource from media viewer --- .../e2e/cucumber/features/shares/link.feature | 1 + .../cucumber/features/shares/share.feature | 13 +++++++------ .../cucumber/features/smoke/download.feature | 12 ++++++------ .../features/smoke/languageChange.feature | 19 +++++++++++++++++++ tests/e2e/cucumber/steps/ui/resources.ts | 9 --------- .../objects/app-files/resource/actions.ts | 1 - 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/tests/e2e/cucumber/features/shares/link.feature b/tests/e2e/cucumber/features/shares/link.feature index 9f95cbc34e2..216004a2789 100644 --- a/tests/e2e/cucumber/features/shares/link.feature +++ b/tests/e2e/cucumber/features/shares/link.feature @@ -201,6 +201,7 @@ Feature: link | simple.pdf | file | When "Carol" opens the public link "imageLink" And "Carol" unlocks the public link with password "%public%" + # https://github.com/owncloud/ocis/issues/8602 Then "Carol" is in a media-viewer And "Carol" closes the file viewer And "Carol" downloads the following public link resources using the single share view diff --git a/tests/e2e/cucumber/features/shares/share.feature b/tests/e2e/cucumber/features/shares/share.feature index f22b5b0e11a..af72a39ce22 100644 --- a/tests/e2e/cucumber/features/shares/share.feature +++ b/tests/e2e/cucumber/features/shares/share.feature @@ -134,12 +134,12 @@ Feature: share | test_video.mp4 | file | And "Alice" closes the file viewer And "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | shareToBrian.txt | Brian | user | Can edit | file | - | shareToBrian.md | Brian | user | Can edit | file | - | testavatar.jpeg | Brian | user | Can view | file | - | simple.pdf | Brian | user | custom_permissions:read,update,share | file | - | sharedFile.txt | Brian | user | Can edit | file | + | resource | recipient | type | role | resourceType | + | shareToBrian.txt | Brian | user | Can edit | file | + | shareToBrian.md | Brian | user | Can edit | file | + | testavatar.jpeg | Brian | user | Can view | file | + | simple.pdf | Brian | user | Can edit | file | + | sharedFile.txt | Brian | user | Can edit | file | And "Alice" navigates to the shared with others page And "Alice" opens the following file in mediaviewer | resource | @@ -165,6 +165,7 @@ Feature: share | resource | | simple.pdf | And "Brian" closes the file viewer + And "Alice" navigates to the personal space page And "Alice" removes following sharee | resource | recipient | | shareToBrian.txt | Brian | diff --git a/tests/e2e/cucumber/features/smoke/download.feature b/tests/e2e/cucumber/features/smoke/download.feature index efa3a071c6b..791a0ce5852 100644 --- a/tests/e2e/cucumber/features/smoke/download.feature +++ b/tests/e2e/cucumber/features/smoke/download.feature @@ -37,9 +37,9 @@ Feature: Download And "Alice" opens the following file in mediaviewer | resource | | testavatar.jpg | - And "Alice" downloads the following image from the mediaviewer - | resource | - | testavatar.jpg | + And "Alice" downloads the following resources using the preview topbar + | resource | type | + | testavatar.jpg | file | And "Alice" closes the file viewer And "Alice" logs out @@ -59,7 +59,7 @@ Feature: Download And "Brian" opens the following file in mediaviewer | resource | | testavatar.jpg | - And "Brian" downloads the following image from the mediaviewer - | resource | - | testavatar.jpg | + And "Brian" downloads the following resources using the preview topbar + | resource | type | + | testavatar.jpg | file | And "Brian" logs out diff --git a/tests/e2e/cucumber/features/smoke/languageChange.feature b/tests/e2e/cucumber/features/smoke/languageChange.feature index 40591fc7dbb..c2d820857ec 100644 --- a/tests/e2e/cucumber/features/smoke/languageChange.feature +++ b/tests/e2e/cucumber/features/smoke/languageChange.feature @@ -29,3 +29,22 @@ Feature: language settings And "Alice" logs out + Scenario: anonymous user language change + When "Alice" logs in + And "Alice" creates the following folder in personal space using API + | name | + | folderPublic | + And "Alice" uploads the following local file into personal space using API + | localFile | to | + | filesForUpload/lorem.txt | lorem.txt | + + And "Alice" opens the "files" app + And "Alice" creates a public link of following resource using the sidebar panel + | resource | password | + | folderPublic | %public% | + And "Alice" logs out + When "Anonymous" opens the public link "Link" + And "Anonymous" unlocks the public link with password "%public%" + And "Anonymous" opens the user menu + And "Anonymous" changes the language to "Deutsch - German" + Then "Anonymous" should see the following account page title "Konto" diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index 9918b0f4281..acce2e23169 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -111,15 +111,6 @@ When( } ) -When( - /^"([^"]*)" downloads the following image(?:s)? from the mediaviewer$/, - async function (this: World, stepUser: string, stepTable: DataTable) { - const { page } = this.actorsEnvironment.getActor({ key: stepUser }) - const resourceObject = new objects.applicationFiles.Resource({ page }) - await processDownload(stepTable, resourceObject, 'preview') - } -) - When( /^"([^"]*)" deletes the following resource(?:s)? using the (sidebar panel|batch action)$/, async function (this: World, stepUser: string, actionType: string, stepTable: DataTable) { diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 9a12c0a4dc5..5f7c46849bf 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -10,7 +10,6 @@ import { config } from '../../../../config' import { buildXpathLiteral } from '../../../utils/locator' const topbarFilenameSelector = '#app-top-bar-resource .oc-resource-name' -const downloadPreviewButton = '//button[contains(@id, "preview-download")]' const downloadFileButtonSingleShareView = '.oc-files-actions-download-file-trigger' const downloadFolderButtonSingleShareView = '.oc-files-actions-download-archive-trigger' const filesView = '#files-view' From 1618ac6c060db826d95da27feed1ba3f7e2ded11 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Wed, 15 May 2024 12:06:45 +0545 Subject: [PATCH 7/7] test: fix tests for stable branch --- .../features/smoke/languageChange.feature | 20 ------------------- .../features/smoke/trashbinDelete.feature | 3 ++- .../objects/app-files/resource/actions.ts | 10 ++-------- .../objects/app-files/resource/utils.ts | 4 +++- 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/tests/e2e/cucumber/features/smoke/languageChange.feature b/tests/e2e/cucumber/features/smoke/languageChange.feature index c2d820857ec..9e7ee2c4a6e 100644 --- a/tests/e2e/cucumber/features/smoke/languageChange.feature +++ b/tests/e2e/cucumber/features/smoke/languageChange.feature @@ -28,23 +28,3 @@ Feature: language settings | Brian Murphy hat check_message mit Ihnen geteilt | And "Alice" logs out - - Scenario: anonymous user language change - When "Alice" logs in - And "Alice" creates the following folder in personal space using API - | name | - | folderPublic | - And "Alice" uploads the following local file into personal space using API - | localFile | to | - | filesForUpload/lorem.txt | lorem.txt | - - And "Alice" opens the "files" app - And "Alice" creates a public link of following resource using the sidebar panel - | resource | password | - | folderPublic | %public% | - And "Alice" logs out - When "Anonymous" opens the public link "Link" - And "Anonymous" unlocks the public link with password "%public%" - And "Anonymous" opens the user menu - And "Anonymous" changes the language to "Deutsch - German" - Then "Anonymous" should see the following account page title "Konto" diff --git a/tests/e2e/cucumber/features/smoke/trashbinDelete.feature b/tests/e2e/cucumber/features/smoke/trashbinDelete.feature index ee0e5d1b645..835a59f20fc 100644 --- a/tests/e2e/cucumber/features/smoke/trashbinDelete.feature +++ b/tests/e2e/cucumber/features/smoke/trashbinDelete.feature @@ -46,11 +46,12 @@ Feature: Trashbin delete Given "Alice" creates the following folders in personal space using API | name | | folderToShare | - | empty-folder | + | empty-folder | And "Alice" creates the following files into personal space using API | pathToFile | content | | folderToShare/lorem.txt | lorem ipsum | | sample.txt | sample | + And "Alice" opens the "files" app And "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | resourceType | | folderToShare | Brian | user | Can edit | folder | diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 5f7c46849bf..184c167af06 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -1,7 +1,7 @@ import { Download, Locator, Page, expect } from '@playwright/test' import util from 'util' import path from 'path' -import { resourceExists, waitForResources } from './utils' +import { resourceExists, waitForResources, resourceNameSelector } from './utils' import { editor, sidebar } from '../utils' import { File, Space } from '../../../types' import { dragDropFiles } from '../../../utils/dragDrop' @@ -26,8 +26,6 @@ const checkBoxForTrashbin = `//*[@data-test-resource-path="%s"]//ancestor::tr//i const filesSelector = '//*[@data-test-resource-name="%s"]' export const fileRow = '//ancestor::*[(contains(@class, "oc-tile-card") or contains(@class, "oc-tbody-tr"))]' -export const resourceNameSelector = - ':is(#files-space-table, .oc-tiles-item, #files-shared-with-me-accepted-section, .files-table) [data-test-resource-name="%s"]' // following breadcrumb selectors is passed to buildXpathLiteral function as the content to be inserted might contain quotes const breadcrumbResourceNameSelector = '//span[contains(@class, "oc-breadcrumb-item-text") and text()=%s]' @@ -138,13 +136,9 @@ export const clickResource = async ({ const folder = name.replace(/'/g, "\\'").replace(/"/g, '\\"') const resource = page.locator(util.format(resourceNameSelector, folder)) - const itemId = await resource.locator(fileRow).getAttribute('data-item-id') await Promise.all([ page.waitForResponse( - (resp) => - resp.url().endsWith(encodeURIComponent(name)) || - resp.url().endsWith(itemId) || - resp.url().endsWith(encodeURIComponent(itemId)) + (resp) => resp.status() === 207 && resp.request().method() === 'PROPFIND' ), resource.click() ]) diff --git a/tests/e2e/support/objects/app-files/resource/utils.ts b/tests/e2e/support/objects/app-files/resource/utils.ts index 19b24cdfec4..a5c1b903e84 100644 --- a/tests/e2e/support/objects/app-files/resource/utils.ts +++ b/tests/e2e/support/objects/app-files/resource/utils.ts @@ -1,7 +1,9 @@ import { errors, Page } from '@playwright/test' import util from 'util' -const resourceNameSelector = '#files-space-table [data-test-resource-name="%s"]' +export const resourceNameSelector = + ':is(#files-space-table, .oc-tiles-item, #files-shared-with-me-accepted-section, .files-table) [data-test-resource-name="%s"]' + /** * one of the few places where timeout should be used, as we also use this to detect the absence of an element * it is not possible to differentiate between `element not there yet` and `element not loaded yet`.