-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Context:
- Playwright Version: [@playwright/test@next]
- Operating System: [Mac]
- Node.js version: [v17.2.0]
- Browser: [Firefox]
- Extra: [Not reproducible in Chromium and Webkit]
Code Snippet
const { test, expect } = require('@playwright/test');
const delay_time = ms => new Promise(res => setTimeout(res, ms));
test.describe('Repro waitForResponse Bug', () => {
test('test1', async ({ page}) => {
await page.goto('https://s1.demo.opensourcecms.com/wordpress/', {waitUntil: "networkidle"});
await delay_time(10000);
const [response1] = await Promise.all([
page.waitForResponse(/.*header.*/),
page.locator('text="test A"').click()
]);
await delay_time(5000);
const [response2] = await Promise.all([
page.waitForResponse(/.*header.*/),
page.locator('#menu-item-85').click()
]);
await delay_time(10000);
});
});
Describe the bug
Above mentioned code works fine in Chromium and Webkit but fails in Firefox. After page load click to 'test A' succeeds but click to 'menu-item-85' will timeout. It appears if the request is served from browser cache, this issue is noticed in Firefox.
Error
Timeout of 30000ms exceeded.
page.waitForResponse: Page closed
=========================== logs ===========================
waiting for response /.*header.*/
============================================================
33 | await delay_time(10000);
34 | const [response1] = await Promise.all([
> 35 | page.waitForResponse(/.*header.*/),
| ^
36 | page.locator('text="test A"').click()
37 | ]);
38 | await delay_time(5000);
flotwig