@@ -24,7 +24,9 @@ export const getActionButtonForFile = (filename: string) => getActionsForFile(fi
2424export function getActionEntryForFileId ( fileid : number , actionId : string ) {
2525 return getActionButtonForFileId ( fileid )
2626 . should ( 'have.attr' , 'aria-controls' )
27- . then ( ( menuId ) => cy . get ( `#${ menuId } ` ) . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) )
27+ . then ( ( menuId ) => cy . get ( `#${ menuId } ` )
28+ . should ( 'exist' )
29+ . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) )
2830}
2931
3032/**
@@ -33,12 +35,11 @@ export function getActionEntryForFileId(fileid: number, actionId: string) {
3335 * @param actionId
3436 */
3537export function getActionEntryForFile ( file : string , actionId : string ) {
36- getActionButtonForFile ( file )
37- . if ( 'not.have.attr' , 'aria-expanded' , 'true' )
38- . click ( { force : true } )
39-
40- return cy . findByRole ( 'menu' )
41- . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` )
38+ return getActionButtonForFile ( file )
39+ . should ( 'have.attr' , 'aria-controls' )
40+ . then ( ( menuId ) => cy . get ( `#${ menuId } ` )
41+ . should ( 'exist' )
42+ . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) )
4243}
4344
4445/**
@@ -85,8 +86,10 @@ export function triggerActionForFileId(fileid: number, actionId: string) {
8586 */
8687export function triggerActionForFile ( filename : string , actionId : string ) {
8788 getActionButtonForFile ( filename )
88- . should ( 'have.attr' , 'aria-expanded' , 'false' )
89- . click ( { force : true , scrollBehavior : 'nearest' } ) // force to avoid issues with overlaying file list header
89+ . as ( 'actionButton' )
90+ . scrollIntoView ( )
91+ cy . get ( '@actionButton' )
92+ . click ( { force : true } ) // force to avoid issues with overlaying file list header
9093 getActionEntryForFile ( filename , actionId )
9194 . find ( 'button' )
9295 . should ( 'be.visible' )
@@ -290,7 +293,12 @@ export function closeSidebar() {
290293 cy . get ( '[data-cy-sidebar]' )
291294 . should ( 'not.be.visible' )
292295 // eslint-disable-next-line cypress/no-unnecessary-waiting -- wait for the animation to finish
293- cy . wait ( 300 )
296+ cy . wait ( 500 )
297+ // close all toasts
298+ cy . get ( '.toast-success' )
299+ . if ( )
300+ . findAllByRole ( 'button' )
301+ . click ( { force : true , multiple : true } )
294302}
295303
296304/**
0 commit comments