@@ -5,26 +5,14 @@ test('has title', async ({ page }) => {
5
5
await expect ( page ) . toHaveTitle ( / E m p t y W o r k / ) ;
6
6
} ) ;
7
7
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 } ) => {
10
9
11
10
await page . goto ( '/' ) ;
12
11
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
+
28
16
const fileName = download . suggestedFilename ( ) ;
29
17
expect ( fileName ) . toMatch ( / \. p d f $ / ) ;
30
18
0 commit comments