From fb4150e077670c60a7c930ed69632c98ea2c3fb4 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 12 Nov 2026 09:47:24 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20Route=20the=20Benchmark?= =?UTF-8?q?=20and=20BYOM=20Unroutes=20Through=20the=20Shared=20Helper=20(#?= =?UTF-8?q?18085)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/README.md | 2 +- e2e/benchmarks-navigation/navigation.perf.spec.ts | 3 ++- e2e/byom/native.spec.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/e2e/README.md b/e2e/README.md index 89bff8a2b9..cab86fee21 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -132,7 +132,7 @@ context and its pages before Playwright closes it, and what a detached handler t is ignored. A context the spec opens itself with `browser.newContext()` closes through `closeContext(context)` from the same module. -A mock spec that removes a route before its test ends calls `unroute(page, url, handler)` from that +A spec that removes a route before its test ends calls `unroute(page, url, handler)` from that module in place of `page.unroute()`. When `page.unroute()` removes a page's last route, Playwright stops intercepting there and continues the requests its handlers were still working on, so a handler in the middle of one throws `Route is already handled!` and fails the test. `unroute` diff --git a/e2e/benchmarks-navigation/navigation.perf.spec.ts b/e2e/benchmarks-navigation/navigation.perf.spec.ts index d7fe430232..09afa37e97 100644 --- a/e2e/benchmarks-navigation/navigation.perf.spec.ts +++ b/e2e/benchmarks-navigation/navigation.perf.spec.ts @@ -9,6 +9,7 @@ import { seedMessages, } from '../specs/mock/db'; import { messagesView } from '../specs/mock/helpers'; +import { unroute } from '../specs/mock/fixtures'; import { getE2EUser } from '../setup/user'; import { attachSnapshot, @@ -224,7 +225,7 @@ async function holdConversationRecord(page: Page, conversationId: string) { return async () => { release(); - await page.unroute(pattern); + await unroute(page, pattern); return heldRequests; }; } diff --git a/e2e/byom/native.spec.ts b/e2e/byom/native.spec.ts index 8d54666f18..4a96955abb 100644 --- a/e2e/byom/native.spec.ts +++ b/e2e/byom/native.spec.ts @@ -12,6 +12,7 @@ import { sendMessage, sendMessageAndWaitForCompletion, } from '../specs/mock/helpers'; +import { unroute } from '../specs/mock/fixtures'; interface Pairing { environment: { id: string }; @@ -345,7 +346,7 @@ test('native BYOM saves, persists, isolates workers, and fails closed', async ({ await route.continue(); }); const conversationId = await chat('Keep this conversation and its history.'); - await page.unroute(streamRoute); + await unroute(page, streamRoute); const ordinaryDecision = await readDecision(conversationId); expect(ordinaryDecision.codeEnvironmentMode).toBe('without_attached'); expect(ordinaryDecision.codeWorkspaces ?? []).toEqual([]);