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.
This commit is contained in:
Sebastian Martinez
2024-08-02 08:02:15 -03:00
parent e005cd784e
commit 4de9724f9e
+1 -1
View File
@@ -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`);