From 2d4b8a8c7a83db5bef0060f4c306d7b253128036 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 28 Jan 2025 17:29:41 +0100 Subject: [PATCH] fix tests --- packages/playwright-core/src/client/page.ts | 2 ++ tests/playwright-test/playwright.mockingproxy.spec.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/client/page.ts b/packages/playwright-core/src/client/page.ts index 4f00e80664..88c392f3c9 100644 --- a/packages/playwright-core/src/client/page.ts +++ b/packages/playwright-core/src/client/page.ts @@ -568,6 +568,8 @@ export class Page extends ChannelOwner implements api.Page private async _updateInterceptionPatterns() { const patterns = RouteHandler.prepareInterceptionPatterns(this._routes); await this._channel.setNetworkInterceptionPatterns({ patterns }); + // TODO: merge this with browserContext patterns + await this._browserContext._mockingProxy?.setInterceptionPatterns({ patterns }); } private async _updateWebSocketInterceptionPatterns() { diff --git a/tests/playwright-test/playwright.mockingproxy.spec.ts b/tests/playwright-test/playwright.mockingproxy.spec.ts index 9389218281..d7598eb922 100644 --- a/tests/playwright-test/playwright.mockingproxy.spec.ts +++ b/tests/playwright-test/playwright.mockingproxy.spec.ts @@ -110,7 +110,7 @@ test('all properties are populated', async ({ runInlineTest, server, request }) expect(await response.finished()).toBe(null); expect(request.serviceWorker()).toBe(null); - expect(request.frame()).toBe(null); // we know the page, but not the frame + expect(() => request.frame()).toThrowError("Assertion error"); // we know the page, but not the frame. should probably improve the error message expect(request.failure()).toBe(null); expect(request.isNavigationRequest()).toBe(false);