@@ -33,12 +33,9 @@ export function getActionEntryForFileId(fileid: number, actionId: string) {
3333 * @param actionId
3434 */
3535export 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 ) } "]` )
36+ return getActionButtonForFile ( file )
37+ . should ( 'have.attr' , 'aria-controls' )
38+ . then ( ( menuId ) => cy . get ( `#${ menuId } ` ) . find ( `[data-cy-files-list-row-action="${ CSS . escape ( actionId ) } "]` ) )
4239}
4340
4441/**
@@ -85,8 +82,12 @@ export function triggerActionForFileId(fileid: number, actionId: string) {
8582 */
8683export function triggerActionForFile ( filename : string , actionId : string ) {
8784 getActionButtonForFile ( filename )
88- . should ( 'have.attr' , 'aria-expanded' , 'false' )
89- . click ( { force : true , scrollBehavior : 'nearest' } ) // force to avoid issues with overlaying file list header
85+ . should ( 'exist' )
86+ . scrollIntoView ( )
87+ getActionButtonForFile ( filename )
88+ . should ( 'be.visible' )
89+ . and ( 'have.attr' , 'aria-expanded' , 'false' )
90+ . click ( )
9091 getActionEntryForFile ( filename , actionId )
9192 . find ( 'button' )
9293 . should ( 'be.visible' )
0 commit comments