Skip to content

Commit f386fa9

Browse files
authored
test: add failing test for new page downloads (#1984)
1 parent 9f09973 commit f386fa9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/download.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ describe('Download', function() {
117117
expect(fs.readFileSync(path).toString()).toBe('Hello world');
118118
await page.close();
119119
});
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+
});
120131
it('should delete file', async({browser, server}) => {
121132
const page = await browser.newPage({ acceptDownloads: true });
122133
await page.setContent(`<a href="${server.PREFIX}/download">download</a>`);

0 commit comments

Comments
 (0)