chore(ci): Use the proper helper function to trigger action on selected rows

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-05-11 11:07:13 +02:00 committed by Peter R.
parent 3771f4f9d6
commit 622e06117d
2 changed files with 7 additions and 29 deletions

View file

@ -5,7 +5,7 @@
import type { User } from '@nextcloud/e2e-test-server/cypress'
import { getRowForFile, navigateToFolder, selectAllFiles, triggerActionForFile } from './FilesUtils.ts'
import { getRowForFile, navigateToFolder, selectAllFiles, triggerActionForFile, triggerSelectionAction } from './FilesUtils.ts'
describe('files: Delete files using file actions', { testIsolation: true }, () => {
let user: User
@ -50,12 +50,7 @@ describe('files: Delete files using file actions', { testIsolation: true }, () =
// select all
selectAllFiles()
cy.get('[data-cy-files-list-selection-actions]')
.findByRole('button', { name: 'Actions' })
.click()
cy.get('[data-cy-files-list-selection-action="delete"]')
.findByRole('menuitem', { name: /^Delete files/ })
.click()
triggerSelectionAction('delete')
// see dialog for confirmation
cy.findByRole('dialog', { name: 'Confirm deletion' })

View file

@ -8,7 +8,7 @@ import type { User } from '@nextcloud/e2e-test-server/cypress'
import { zipFileContains } from '../../support/utils/assertions.ts'
import { deleteDownloadsFolderBeforeEach } from '../../support/utils/deleteDownloadsFolder.ts'
import { randomString } from '../../support/utils/randomString.ts'
import { getRowForFile, navigateToFolder, triggerActionForFile } from './FilesUtils.ts'
import { getRowForFile, navigateToFolder, triggerActionForFile, triggerSelectionAction } from './FilesUtils.ts'
describe('files: Download files using file actions', { testIsolation: true }, () => {
let user: User
@ -194,12 +194,7 @@ describe('files: Download files using selection', () => {
})
// click download
cy.get('[data-cy-files-list-selection-actions]')
.findByRole('button', { name: 'Actions' })
.click()
cy.findByRole('menuitem', { name: 'Download (selected)' })
.should('be.visible')
.click()
triggerSelectionAction('download')
// check a file is downloaded
const downloadsFolder = Cypress.config('downloadsFolder')
@ -237,11 +232,7 @@ describe('files: Download files using selection', () => {
})
// click download
cy.get('[data-cy-files-list-selection-actions]')
.findByRole('button', { name: 'Actions' })
.click()
cy.findByRole('menuitem', { name: 'Download (selected)' })
.click()
triggerSelectionAction('download')
// check a file is downloaded
const downloadsFolder = Cypress.config('downloadsFolder')
@ -282,11 +273,7 @@ describe('files: Download files using selection', () => {
})
// click download
cy.get('[data-cy-files-list-selection-actions]')
.findByRole('button', { name: 'Actions' })
.click()
cy.findByRole('menuitem', { name: 'Download (selected)' })
.click()
triggerSelectionAction('download')
// check a file is downloaded
const downloadsFolder = Cypress.config('downloadsFolder')
@ -330,11 +317,7 @@ describe('files: Download files using selection', () => {
})
// click download
cy.get('[data-cy-files-list-selection-actions]')
.findByRole('button', { name: 'Actions' })
.click()
cy.findByRole('menuitem', { name: 'Download (selected)' })
.click()
triggerSelectionAction('download')
// check a file is downloaded
const downloadsFolder = Cypress.config('downloadsFolder')