diff --git a/tests/acceptance/features/webUIPreview/mediaPreview.feature b/tests/acceptance/features/webUIPreview/mediaPreview.feature index e4f03fe65ac..99988e53565 100644 --- a/tests/acceptance/features/webUIPreview/mediaPreview.feature +++ b/tests/acceptance/features/webUIPreview/mediaPreview.feature @@ -57,30 +57,6 @@ Feature: display image in preview app on the webUI | testavatar.jpg | testavatar.png | - Scenario: downloading media resource is possible - Given user "Alice" has uploaded file "testavatar.jpg" to "testavatar.jpg" in the server - And user "Alice" has logged in using the webUI - And the user has viewed the file "testavatar.jpg" in the preview app using the webUI - When the user downloads the media resource using the webUI - Then no message should be displayed on the webUI - - - Scenario: closing preview app is possible - Given user "Alice" has uploaded file "testavatar.jpg" to "testavatar.jpg" in the server - And user "Alice" has logged in using the webUI - And the user has viewed the file "testavatar.jpg" in the preview app using the webUI - When the user closes the media resource using the webUI - Then the file "testavatar.jpg" should not be displayed in the preview app webUI - And the user should be in the root directory on the webUI - - - Scenario: preview of image with preview app by clicking on the file name - Given user "Alice" has uploaded file "testavatar.jpg" to "testavatar.jpg" in the server - And user "Alice" has logged in using the webUI - When the user views the file "testavatar.jpg" in the preview app by clicking on the file name using the webUI - Then the file "testavatar.jpg" should be displayed in the preview app webUI - - Scenario: preview of mp3 file with preview app by clicking on the file name Given user "Alice" has uploaded file "testimage.mp3" to "testimage.mp3" in the server And user "Alice" has logged in using the webUI diff --git a/tests/e2e/cucumber/features/shares/link.feature b/tests/e2e/cucumber/features/shares/link.feature index bdb5e562239..4988c16da10 100644 --- a/tests/e2e/cucumber/features/shares/link.feature +++ b/tests/e2e/cucumber/features/shares/link.feature @@ -27,10 +27,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 7dae6eedbdc..2351af42439 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) { @@ -452,6 +461,9 @@ export const processDownload = async ( case 'sidebar panel': via = 'SIDEBAR_PANEL' break + case 'preview': + via = 'PREVIEW' + break default: break } diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 3e1305380c3..f9cea0ce686 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -16,6 +16,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` @@ -594,7 +595,7 @@ interface resourceArgs { type?: string } -export type ActionViaType = 'SIDEBAR_PANEL' | 'BATCH_ACTION' | 'SINGLE_SHARE_VIEW' +export type ActionViaType = 'SIDEBAR_PANEL' | 'BATCH_ACTION' | 'SINGLE_SHARE_VIEW' | 'PREVIEW' export interface downloadResourcesArgs { page: Page @@ -660,6 +661,14 @@ export const downloadResources = async (args: downloadResourcesArgs): Promise