@@ -8,7 +8,7 @@ import type { User } from '@nextcloud/e2e-test-server/cypress'
88import { zipFileContains } from '../../support/utils/assertions.ts'
99import { deleteDownloadsFolderBeforeEach } from '../../support/utils/deleteDownloadsFolder.ts'
1010import { randomString } from '../../support/utils/randomString.ts'
11- import { getRowForFile , navigateToFolder , triggerActionForFile } from './FilesUtils.ts'
11+ import { getRowForFile , navigateToFolder , triggerActionForFile , triggerSelectionAction } from './FilesUtils.ts'
1212
1313describe ( 'files: Download files using file actions' , { testIsolation : true } , ( ) => {
1414 let user : User
@@ -194,12 +194,7 @@ describe('files: Download files using selection', () => {
194194 } )
195195
196196 // click download
197- cy . get ( '[data-cy-files-list-selection-actions]' )
198- . findByRole ( 'button' , { name : 'Actions' } )
199- . click ( )
200- cy . findByRole ( 'menuitem' , { name : 'Download (selected)' } )
201- . should ( 'be.visible' )
202- . click ( )
197+ triggerSelectionAction ( 'download' )
203198
204199 // check a file is downloaded
205200 const downloadsFolder = Cypress . config ( 'downloadsFolder' )
@@ -237,11 +232,7 @@ describe('files: Download files using selection', () => {
237232 } )
238233
239234 // click download
240- cy . get ( '[data-cy-files-list-selection-actions]' )
241- . findByRole ( 'button' , { name : 'Actions' } )
242- . click ( )
243- cy . findByRole ( 'menuitem' , { name : 'Download (selected)' } )
244- . click ( )
235+ triggerSelectionAction ( 'download' )
245236
246237 // check a file is downloaded
247238 const downloadsFolder = Cypress . config ( 'downloadsFolder' )
@@ -282,11 +273,7 @@ describe('files: Download files using selection', () => {
282273 } )
283274
284275 // click download
285- cy . get ( '[data-cy-files-list-selection-actions]' )
286- . findByRole ( 'button' , { name : 'Actions' } )
287- . click ( )
288- cy . findByRole ( 'menuitem' , { name : 'Download (selected)' } )
289- . click ( )
276+ triggerSelectionAction ( 'download' )
290277
291278 // check a file is downloaded
292279 const downloadsFolder = Cypress . config ( 'downloadsFolder' )
@@ -330,11 +317,7 @@ describe('files: Download files using selection', () => {
330317 } )
331318
332319 // click download
333- cy . get ( '[data-cy-files-list-selection-actions]' )
334- . findByRole ( 'button' , { name : 'Actions' } )
335- . click ( )
336- cy . findByRole ( 'menuitem' , { name : 'Download (selected)' } )
337- . click ( )
320+ triggerSelectionAction ( 'download' )
338321
339322 // check a file is downloaded
340323 const downloadsFolder = Cypress . config ( 'downloadsFolder' )
0 commit comments