Skip to content

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

fix(ff): resource type for image sets should be `image` (#33195)

Simon Knott40d5a1cb4af6
diff --git a/packages/playwright-core/src/server/firefox/ffNetworkManager.ts b/packages/playwright-core/src/server/firefox/ffNetworkManager.ts
index 978eb30bd4..73b8e3589f 100644
--- a/packages/playwright-core/src/server/firefox/ffNetworkManager.ts
+++ b/packages/playwright-core/src/server/firefox/ffNetworkManager.ts
@@ -183,7 +183,7 @@ const causeToResourceType: {[key: string]: string} = {
TYPE_XSLT: 'other',
TYPE_BEACON: 'other',
TYPE_FETCH: 'fetch',
- TYPE_IMAGESET: 'images',
+ TYPE_IMAGESET: 'image',
TYPE_WEB_MANIFEST: 'manifest',
};
diff --git a/tests/page/page-event-request.spec.ts b/tests/page/page-event-request.spec.ts
index f32f224374..2c1d7a7eba 100644
--- a/tests/page/page-event-request.spec.ts
+++ b/tests/page/page-event-request.spec.ts
@@ -258,3 +258,18 @@ it('should finish 204 request', {
page.evaluate(async url => { await fetch(url); }, server.PREFIX + '/204').catch(() => {});
expect(await reqPromise).toBe('requestfinished');
});
+
+it('<picture> resource should have type image', async ({ page }) => {
+ it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/33148' });
+ const [request] = await Promise.all([
+ page.waitForEvent('request'),
+ page.setContent(`
+ <picture>
+ <source>
+ <img src="https://www.wikipedia.org/portal/wikipedia.org/assets/img/[email protected]">
+ </source>
+ </picture>
+ `)
+ ]);
+ expect(request.resourceType()).toBe('image');
+});
\ No newline at end of file