From 4de9724f9e36322cc69c0068705db580463ebd67 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 2 Aug 2024 08:02:15 -0300 Subject: [PATCH] Improve `external markdown link` test By using `page.route` we weren't changing the response of `https://example.com` since we where only changing it on the initial page. By using `context` we are able to change the response for any request to that site on all playwright pages. --- tests/e2e/project.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/project.spec.ts b/tests/e2e/project.spec.ts index 2dc1b6ade..d1af45cf6 100644 --- a/tests/e2e/project.spec.ts +++ b/tests/e2e/project.spec.ts @@ -480,7 +480,7 @@ test.describe("browser error handling", () => { }); test("external markdown link", async ({ context, page }) => { - await page.route("https://example.com/**", route => { + await context.route("https://example.com/**", route => { return route.fulfill({ body: "hello", contentType: "text/plain" }); }); await page.goto(`${markdownUrl}/tree/main/footnotes.md`);