Skip to content

Commit

Permalink
remove acceptance test related to media preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Salipa-Gurung committed Apr 24, 2024
1 parent 2af6e91 commit 025e71f
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 181 deletions.
2 changes: 0 additions & 2 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ config = {
],
"suites": {
"oCISBasic": [
"webUIPreview",
"webUILogin",
],
"oCISFiles1": [
Expand Down Expand Up @@ -179,7 +178,6 @@ basicTestSuites = [
"webUIFilesDetails",
"webUILogin",
"webUIMoveFilesFolders",
"webUIPreview",
"webUIRenameFiles",
"webUIRenameFolders",
"webUISharingAcceptShares",
Expand Down
160 changes: 0 additions & 160 deletions tests/acceptance/features/webUIPreview/mediaPreview.feature

This file was deleted.

17 changes: 12 additions & 5 deletions tests/e2e/cucumber/features/shares/link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Feature: link
| localFile | to |
| filesForUpload/simple.pdf | simple.pdf |
| filesForUpload/testavatar.jpg | testavatar.jpg |
| filesForUpload/test_video.mp4 | test_video.mp4 |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| folderPublic | Brian | user | Can edit |
Expand Down Expand Up @@ -117,6 +118,10 @@ Feature: link
| resource | password |
| testavatar.jpg | %public% |
And "Alice" renames the most recently created public link of resource "testavatar.jpg" to "imageLink"
And "Alice" creates a public link creates a public link of following resource using the sidebar panel
| resource | password |
| test_video.mp4 | %public% |
And "Alice" renames the most recently created public link of resource "test_video.mp4" to "videoLink"
And "Alice" logs out

# authenticated user with access to resources. should be redirected to shares with me page
Expand Down Expand Up @@ -149,8 +154,7 @@ Feature: link
| simple.pdf | file |
When "Brian" opens the public link "imageLink"
And "Brian" unlocks the public link with password "%public%"
# https://github.com/owncloud/ocis/issues/8602
Then "Brian" is in a image-viewer
Then "Brian" is in a media-viewer
And "Brian" closes the file viewer
And "Brian" downloads the following public link resources using the single share view
| resource | type |
Expand Down Expand Up @@ -185,8 +189,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 image-viewer
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
| resource | type |
Expand Down Expand Up @@ -220,11 +223,15 @@ Feature: link
When "Anonymous" opens the public link "imageLink"
And "Anonymous" unlocks the public link with password "%public%"
# https://github.com/owncloud/ocis/issues/8602
Then "Anonymous" is in a image-viewer
Then "Anonymous" is in a media-viewer
And "Anonymous" closes the file viewer
And "Anonymous" downloads the following public link resources using the single share view
| resource | type |
| testavatar.jpg | file |
When "Anonymous" opens the public link "videoLink"
And "Anonymous" unlocks the public link with password "%public%"
Then "Anonymous" is in a media-viewer
And "Anonymous" closes the file viewer


Scenario: add banned password for public link
Expand Down
57 changes: 54 additions & 3 deletions tests/e2e/cucumber/features/shares/share.feature
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,65 @@ Feature: share
| sharedFile.txt | txtFile | some text |
And "Alice" uploads the following resource
| resource |
| testavatar.jpeg |
| simple.pdf |
When "Alice" shares the following resource using the sidebar panel
| sampleGif.gif |
| testimage.mp3 |
| sampleOgg.ogg |
| sampleWebm.webm |
| test_video.mp4 |
| testavatar.jpeg |
| testavatar.png |
When "Alice" views the file "testavatar.png" in the preview app using the sidebar panel
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| testavatar.jpeg |
Then "Alice" is in a media-viewer
When "Alice" navigates to the next media resource
When "Alice" navigates to the previous media resource
When "Alice" closes the file viewer
When "Alice" opens the following file in mediaviewer
| resource |
| sampleGif.gif |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| testimage.mp3 |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| sampleOgg.ogg |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| sampleWebm.webm |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| test_video.mp4 |
Then "Alice" is in a media-viewer
When "Alice" downloads the following resource using the preview topbar
| resource | type |
| test_video.mp4 | file |
When "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 |
And "Alice" navigates to the shared with others page
And "Alice" opens the following file in mediaviewer
| resource |
| testavatar.jpeg |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer

And "Brian" opens the "files" app
And "Brian" navigates to the shared with me page
Expand All @@ -105,7 +155,8 @@ Feature: share
And "Brian" opens the following file in mediaviewer
| resource |
| testavatar.jpeg |
And "Brian" closes the file viewer
Then "Brian" is in a media-viewer
When "Brian" closes the file viewer
And "Brian" opens the following file in pdfviewer
| resource |
| simple.pdf |
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/features/smoke/shortcut.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: Users can create shortcuts for resources and sites
| resource | name | type |
| logo.jpg | logo | file |
And "Brian" opens a shortcut "logo.url"
Then "Brian" is in a image-viewer
Then "Brian" is in a media-viewer
And "Brian" closes the file viewer

# create a shortcut to the public link
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/features/spaces/publicLink.feature
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Feature: spaces public link
And "David" edits the public link named "folderLink" of resource "spaceFolder" changing role to "Can edit"
When "David" opens the public link "imageLink"
And "David" unlocks the public link with password "%public%"
Then "David" is in a image-viewer
Then "David" is in a media-viewer
And "David" closes the file viewer
And "David" logs out

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/steps/ui/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ When(
)

Then(
/^"([^"]*)" is in a (text-editor|pdf-viewer|image-viewer)$/,
/^"([^"]*)" is in a (text-editor|pdf-viewer|media-viewer)$/,
async function (this: World, stepUser: string, fileViewerType: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const fileViewerLocator = editor.fileViewerLocator({ page, fileViewerType })
Expand Down
25 changes: 23 additions & 2 deletions tests/e2e/cucumber/steps/ui/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ When(
)

When(
/^"([^"]*)" downloads the following resource(?:s)? using the (sidebar panel|batch action)$/,
/^"([^"]*)" downloads the following resource(?:s)? using the (sidebar panel|batch action|preview topbar)$/,
async function (this: World, stepUser: string, actionType: string, stepTable: DataTable) {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
Expand Down Expand Up @@ -461,6 +461,9 @@ export const processDownload = async (
case 'sidebar panel':
via = 'SIDEBAR_PANEL'
break
case 'preview topbar':
via = 'PREVIEW_TOPBAR'
break
default:
break
}
Expand All @@ -476,7 +479,7 @@ export const processDownload = async (
downloadedResources.push(name)
})

if (actionType === 'sidebar panel') {
if (actionType === 'sidebar panel' || actionType === 'preview topbar') {
expect(downloads.length).toBe(files.length)
for (const resource of files) {
const fileOrFolderName = path.parse(resource.name).name
Expand Down Expand Up @@ -782,3 +785,21 @@ Then(
: await expect(lockLocator).not.toBeVisible()
}
)

When(
/^"([^"]*)" navigates to the (next|previous) media resource$/,
async function (this: World, stepUser: string, navigationType: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
await resourceObject.navigateMediaFile(navigationType)
}
)

When(
'{string} views the file {string} in the preview app using the sidebar panel',
async function (this: World, stepUser: any, file: any): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
await resourceObject.previewMediaFromSidebarPanel(file)
}
)
Loading

0 comments on commit 025e71f

Please sign in to comment.