test: submit form with target=_blank (#20462)

#18392
This commit is contained in:
Yury Semikhatsky 2023-01-30 08:37:05 -08:00 committed by GitHub
parent 5ad635522c
commit 03b15f6550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,3 +32,28 @@ it('should work with cross-process _blank target', async ({ page, server }) => {
await page.goto(server.EMPTY_PAGE);
await page.click('"Click me"');
});
it('should work with _blank target in form', async ({ page, server, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18392' });
it.fixme(browserName === 'webkit');
server.setRoute('/done.html?', (req, res) => {
res.end(`Done`);
});
await page.goto(server.EMPTY_PAGE);
page.setContent(`<form target="_blank" action="done.html" >
<input type="submit" value="Click me">
</form>`);
await Promise.all([
page.waitForEvent('popup'),
page.click('"Click me"')
]);
page.setContent(`<form target="_blank" action="done.html" method="post">
<input type="submit" value="Click me">
</form>`);
await Promise.all([
page.waitForEvent('popup'),
page.click('"Click me"')
]);
});