From bc1a8c21912cf82f60d584438cd94c24f9daf8a4 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 27 Jan 2025 15:39:59 +0100 Subject: [PATCH] test: add test for fetch with keepalive: true on Firefox (#34498) --- tests/page/page-event-request.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/page/page-event-request.spec.ts b/tests/page/page-event-request.spec.ts index e1fc29eb59..b2e13a4c2f 100644 --- a/tests/page/page-event-request.spec.ts +++ b/tests/page/page-event-request.spec.ts @@ -41,6 +41,20 @@ it('should fire for fetches', async ({ page, server }) => { expect(requests.length).toBe(2); }); +it('should fire for fetches with keepalive: true', { + annotation: { + type: 'issue', + description: 'https://github.com/microsoft/playwright/issues/34497' + } +}, async ({ page, server, browserName }) => { + it.fixme(browserName === 'firefox'); + const requests = []; + page.on('request', request => requests.push(request)); + await page.goto(server.EMPTY_PAGE); + await page.evaluate(() => fetch('/empty.html', { keepalive: true })); + expect(requests.length).toBe(2); +}); + it('should report requests and responses handled by service worker', async ({ page, server, isAndroid, isElectron }) => { it.fixme(isAndroid); it.fixme(isElectron);