File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,17 @@ describe('Download', function() {
117
117
expect ( fs . readFileSync ( path ) . toString ( ) ) . toBe ( 'Hello world' ) ;
118
118
await page . close ( ) ;
119
119
} ) ;
120
+ it . fail ( CHROMIUM || WEBKIT || FFOX ) ( 'should report new window downloads' , async ( { browser, server} ) => {
121
+ const page = await browser . newPage ( { acceptDownloads : true } ) ;
122
+ await page . setContent ( `<a target=_blank href="${ server . PREFIX } /download">download</a>` ) ;
123
+ const [ download ] = await Promise . all ( [
124
+ page . waitForEvent ( 'download' ) ,
125
+ page . click ( 'a' )
126
+ ] ) ;
127
+ const path = await download . path ( ) ;
128
+ expect ( fs . existsSync ( path ) ) . toBeTruthy ( ) ;
129
+ await page . close ( ) ;
130
+ } ) ;
120
131
it ( 'should delete file' , async ( { browser, server} ) => {
121
132
const page = await browser . newPage ( { acceptDownloads : true } ) ;
122
133
await page . setContent ( `<a href="${ server . PREFIX } /download">download</a>` ) ;
You can’t perform that action at this time.
0 commit comments