-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
Context:
- Playwright Version: 1.0.2
- Operating System: Ubuntu 20.04 LTS
- Node version: 12.17.0
- Browser: Firefox
With the firefox browser page.goto seems to never be resolved nor rejected when a service worker is running.
On my project I'm using Workbox for my service worker, but you can see the bug with any service worker. The following example uses the Svelte website and its service worker. The OK message is never logged and we get a timeout error:
const { firefox } = require('playwright');
(async () => {
const browser = await firefox.launch();
const page = await browser.newPage();
await page.goto('https://svelte.dev');
console.log("Waiting for the service worker…");
await page.waitForTimeout(1000);
console.log("Service worker running, going to the homepage again…");
await page.goto('https://svelte.dev');
console.log("OK");
await browser.close();
})();With the firefox browser I have to disable the service worker for the OK message to finally show up:
const { firefox } = require('playwright');
(async () => {
const browser = await firefox.launch();
const page = await browser.newPage();
await page.addInitScript(
() => Object.defineProperty(navigator.serviceWorker, 'register', { get: Promise.reject })
);
await page.goto('https://svelte.dev');
console.log("Waiting even if no service worker to have the same test conditions…");
await page.waitForTimeout(1000);
console.log("Service worker not running, going to the homepage again…");
await page.goto('https://svelte.dev');
console.log("OK");
await browser.close();
})();Note that there is no bug with the chromium browser. I couldn't test whith WebKit because of #2447.
adragich and ajha31
Metadata
Metadata
Assignees
Labels
No labels