@@ -36,27 +36,37 @@ const searchForActionInRow = (row: JQuery<HTMLElement>, actionId: string): Cypre
3636export const getActionEntryForFileId = ( fileid : number , actionId : string ) : Cypress . Chainable < JQuery < HTMLElement > > => {
3737 // If we cannot find the action in the row, it might be in the action menu
3838 return getRowForFileId ( fileid ) . should ( 'be.visible' )
39- . then ( row => searchForActionInRow ( row , actionId ) )
39+ . then ( ( row ) => searchForActionInRow ( row , actionId ) )
4040}
4141export const getActionEntryForFile = ( filename : string , actionId : string ) : Cypress . Chainable < JQuery < HTMLElement > > => {
4242 // If we cannot find the action in the row, it might be in the action menu
4343 return getRowForFile ( filename ) . should ( 'be.visible' )
44- . then ( row => searchForActionInRow ( row , actionId ) )
44+ . then ( ( row ) => searchForActionInRow ( row , actionId ) )
4545}
4646
4747export const triggerActionForFileId = ( fileid : number , actionId : string ) => {
4848 // Even if it's inline, we open the action menu to get all actions visible
4949 getActionButtonForFileId ( fileid ) . click ( { force : true } )
50+ // wait for the actions menu to be visible
51+ cy . findByRole ( 'menu' ) . findAllByRole ( 'menuitem' ) . first ( ) . should ( 'be.visible' )
5052 getActionEntryForFileId ( fileid , actionId )
51- . find ( 'button' ) . last ( )
52- . should ( 'exist' ) . click ( { force : true } )
53+ . find ( 'button' ) . last ( ) . as ( 'actionButton' )
54+ . scrollIntoView ( )
55+ cy . get ( '@actionButton' )
56+ . should ( 'be.visible' )
57+ . click ( { force : true } )
5358}
5459export const triggerActionForFile = ( filename : string , actionId : string ) => {
5560 // Even if it's inline, we open the action menu to get all actions visible
5661 getActionButtonForFile ( filename ) . click ( { force : true } )
62+ // wait for the actions menu to be visible
63+ cy . findByRole ( 'menu' ) . findAllByRole ( 'menuitem' ) . first ( ) . should ( 'be.visible' )
5764 getActionEntryForFile ( filename , actionId )
58- . find ( 'button' ) . last ( )
59- . should ( 'exist' ) . click ( { force : true } )
65+ . find ( 'button' ) . last ( ) . as ( 'actionButton' )
66+ . scrollIntoView ( )
67+ cy . get ( '@actionButton' )
68+ . should ( 'be.visible' )
69+ . click ( { force : true } )
6070}
6171
6272export const triggerInlineActionForFileId = ( fileid : number , actionId : string ) => {
0 commit comments