Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: service worker main request/response should be marked correctly (#15482)

Meir Blachmana5571c998157
diff --git a/tests/library/chromium/chromium.spec.ts b/tests/library/chromium/chromium.spec.ts
index c884eadbda..6be7bd3e84 100644
--- a/tests/library/chromium/chromium.spec.ts
+++ b/tests/library/chromium/chromium.spec.ts
@@ -101,6 +101,8 @@ test('should intercept service worker requests (main and within)', async ({ cont
const [ sw ] = await Promise.all([
context.waitForEvent('serviceworker'),
+ context.waitForEvent('request', r => r.url().endsWith('sw.js') && !!r.serviceWorker()),
+ context.waitForEvent('response', r => r.url().endsWith('sw.js') && !r.fromServiceWorker()),
page.goto(server.PREFIX + '/serviceworkers/empty/sw.html'),
]);