@@ -26,9 +26,8 @@ export const getActionButtonForFile = (filename: string) => getActionsForFile(fi
2626export function getActionEntryForFileId ( fileid : number , actionId : string ) {
2727 return getActionButtonForFileId ( fileid )
2828 . should ( 'have.attr' , 'aria-controls' )
29- . then ( ( menuId ) => cy . get ( `#${ menuId } ` )
30- . should ( 'exist' )
31- . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) )
29+ . invoke ( 'attr' , 'aria-controls' )
30+ . then ( ( menuId ) => cy . get ( `#${ menuId } [data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) . should ( 'exist' ) )
3231}
3332
3433/**
@@ -39,9 +38,8 @@ export function getActionEntryForFileId(fileid: number, actionId: string) {
3938export function getActionEntryForFile ( file : string , actionId : string ) {
4039 return getActionButtonForFile ( file )
4140 . should ( 'have.attr' , 'aria-controls' )
42- . then ( ( menuId ) => cy . get ( `#${ menuId } ` )
43- . should ( 'exist' )
44- . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) )
41+ . invoke ( 'attr' , 'aria-controls' )
42+ . then ( ( menuId ) => cy . get ( `#${ menuId } [data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) . should ( 'exist' ) )
4543}
4644
4745/**
@@ -73,9 +71,10 @@ export function triggerActionForFileId(fileid: number, actionId: string) {
7371 getActionButtonForFileId ( fileid )
7472 . click ( { force : true } ) // force to avoid issues with overlaying file list header
7573 getActionEntryForFileId ( fileid , actionId )
76- . find ( 'button' )
77- . should ( 'be.visible' )
78- . click ( )
74+ . then ( ( $entry ) => {
75+ const menuItem = $entry . is ( 'button' ) ? cy . wrap ( $entry ) : cy . wrap ( $entry ) . findByRole ( 'menuitem' ) . last ( )
76+ menuItem . should ( 'be.visible' ) . click ( )
77+ } )
7978}
8079
8180/**
@@ -89,9 +88,10 @@ export function triggerActionForFile(filename: string, actionId: string) {
8988 getActionButtonForFile ( filename )
9089 . click ( { force : true } ) // force to avoid issues with overlaying file list header
9190 getActionEntryForFile ( filename , actionId )
92- . find ( 'button' )
93- . should ( 'be.visible' )
94- . click ( )
91+ . then ( ( $entry ) => {
92+ const menuItem = $entry . is ( 'button' ) ? cy . wrap ( $entry ) : cy . wrap ( $entry ) . findByRole ( 'menuitem' ) . last ( )
93+ menuItem . should ( 'be.visible' ) . click ( )
94+ } )
9595}
9696
9797/**
0 commit comments