The test fails in headless mode, but when mode is headless: false
test passed.
await productAttachment.element.click(); // this action opens a new page with a pdf attachment
const newPage = await page.waitForEvent('popup');
await expect(newPage).toHaveURL(expectedAddressURL);
I also tried using the version with:
await context.waitForEvent('page');
but it behaves the same.
I have already tried many solutions but nothing helps.
Logs:
Received string: "about:blank"
Call log:
- expect.toHaveURL with timeout 10000ms
- waiting for locator(':root')
- locator resolved to <html>…</html>
- unexpected value "about:blank"
Environment:
- @playwright/test: ^1.44.0
- Operating System: Windows
- Node.js version: v20.12.2
- Browser: chromium
New contributor
Michał Ziętek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.