Skip to content

Commit

Permalink
test: add failing test for new page downloads (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Apr 25, 2020
1 parent 9f09973 commit f386fa9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/download.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ describe('Download', function() {
expect(fs.readFileSync(path).toString()).toBe('Hello world');
await page.close();
});
it.fail(CHROMIUM || WEBKIT || FFOX)('should report new window downloads', async({browser, server}) => {
const page = await browser.newPage({ acceptDownloads: true });
await page.setContent(`<a target=_blank href="${server.PREFIX}/download">download</a>`);
const [ download ] = await Promise.all([
page.waitForEvent('download'),
page.click('a')
]);
const path = await download.path();
expect(fs.existsSync(path)).toBeTruthy();
await page.close();
});
it('should delete file', async({browser, server}) => {
const page = await browser.newPage({ acceptDownloads: true });
await page.setContent(`<a href="${server.PREFIX}/download">download</a>`);
Expand Down

0 comments on commit f386fa9

Please sign in to comment.