@@ -52,8 +52,8 @@ test.describe( 'Edit Posts', () => {
5252 const listTable = page . getByRole ( 'table' , { name : 'Table ordered by' } ) ;
5353 await expect ( listTable ) . toBeVisible ( ) ;
5454
55- // Click the post title (edit) link
56- await listTable . getByRole ( 'link' , { name : title , exact : true } ) . click ( ) ;
55+ // Click the post title (edit) link. The aria-label includes " (Edit)" suffix.
56+ await listTable . getByRole ( 'link' , { name : `\u201c ${ title } \u201d (Edit)` } ) . click ( ) ;
5757
5858 // Wait for the editor iframe to load, and switch to it as the active content frame.
5959 await page
@@ -83,8 +83,8 @@ test.describe( 'Edit Posts', () => {
8383 const listTable = page . getByRole ( 'table' , { name : 'Table ordered by' } ) ;
8484 await expect ( listTable ) . toBeVisible ( ) ;
8585
86- // // Focus on the post title link.
87- await listTable . getByRole ( 'link' , { name : title , exact : true } ) . focus ( ) ;
86+ // Focus on the post title link. The aria-label includes " (Edit)" suffix .
87+ await listTable . getByRole ( 'link' , { name : `\u201c ${ title } \u201d (Edit)` } ) . focus ( ) ;
8888
8989 // Tab to the Quick Edit button and press Enter to quick edit.
9090 await pageUtils . pressKeys ( 'Tab' , { times : 2 } )
@@ -121,8 +121,8 @@ test.describe( 'Edit Posts', () => {
121121 const listTable = page . getByRole ( 'table' , { name : 'Table ordered by' } ) ;
122122 await expect ( listTable ) . toBeVisible ( ) ;
123123
124- // Focus on the post title link.
125- await listTable . getByRole ( 'link' , { name : title , exact : true } ) . focus ( ) ;
124+ // Focus on the post title link. The aria-label includes " (Edit)" suffix.
125+ await listTable . getByRole ( 'link' , { name : `\u201c ${ title } \u201d (Edit)` } ) . focus ( ) ;
126126
127127 // Tab to the Trash button and press Enter to delete the post.
128128 await pageUtils . pressKeys ( 'Tab' , { times : 3 } )
0 commit comments