@@ -5,26 +5,14 @@ test('has title', async ({ page }) => {
55 await expect ( page ) . toHaveTitle ( / E m p t y W o r k / ) ;
66} ) ;
77
8- test ( 'find a curriculum vitae and download' , async ( { page, browserName } , testInfo ) => {
9- const isHeaded = testInfo . project . name . includes ( 'headed' )
8+ test ( 'find a curriculum vitae and download' , async ( { page } ) => {
109
1110 await page . goto ( '/' ) ;
1211
13- if ( browserName === 'chromium' && isHeaded ) {
14- const [ popup ] = await Promise . all ( [
15- page . waitForEvent ( 'popup' ) ,
16- await page . getByRole ( 'link' , { name : 'Open PDF of my Curriculum' } ) . click ( ) ,
17- ] ) ;
18- await popup . waitForLoadState ( 'domcontentloaded' ) ;
19- const url = popup . url ( ) ;
20- return expect ( url ) . toMatch ( / \. p d f $ / ) ;
21- }
22-
23- const [ download ] = await Promise . all ( [
24- page . waitForEvent ( 'download' ) ,
25- page . getByRole ( 'link' , { name : 'Open PDF of my Curriculum' } ) . click ( ) ,
26- ] ) ;
27-
12+ const downloadPromise = page . waitForEvent ( 'download' ) ;
13+ await page . getByRole ( 'link' , { name : 'Download my Curriculum Vitae' } ) . click ( ) ;
14+ const download = await downloadPromise ;
15+
2816 const fileName = download . suggestedFilename ( ) ;
2917 expect ( fileName ) . toMatch ( / \. p d f $ / ) ;
3018
0 commit comments