test: add failing test for new page downloads (#1984)

This commit is contained in:
Yury Semikhatsky 2020-04-25 09:35:35 -07:00 committed by GitHub
parent 9f09973190
commit f386fa9415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>`);