File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,9 @@ test.describe("Navigation & Links", () => {
3737 for ( const { name, expected } of footerLinks ) {
3838 test ( `Footer: Should open "${ name } " link correctly` , async ( { page } ) => {
3939 const link = page . getByRole ( "link" , { name, exact : false } ) ;
40- await expect ( link ) . toBeVisible ( ) ;
41-
42- const popupPromise = page . waitForEvent ( "popup" ) . catch ( ( ) => null ) ;
43- await link . click ( ) ;
44-
45- const popup = await popupPromise ;
46- const target : Page = popup || page ;
47-
48- await page . waitForTimeout ( 1000 ) ;
49-
50- await expect ( target ) . toHaveURL ( new RegExp ( expected ) ) ;
40+ const popupPage = await openLinkAndReturnPage ( page , link ) ;
41+ await expect ( popupPage ) . toHaveURL ( new RegExp ( expected ) ) ;
42+ await popupPage . close ( ) ;
5143 } ) ;
5244 }
5345
You can’t perform that action at this time.
0 commit comments