Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
Document Precedence of Mocked Routes if Multiple are Matching (#39190)
jklingen5b7e343f063d
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.mdindex f3ef243d35..61f033cb97 100644--- a/docs/src/api/class-page.md+++ b/docs/src/api/class-page.md@@ -3673,6 +3673,8 @@ await page.RouteAsync("/api/**", async r =>});```+If a request matches multiple registered routes, the most recently registered route takes precedence.+Page routes take precedence over browser context routes (set up with [`method: BrowserContext.route`]) when requestmatches both handlers.diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.tsindex 18f9f5e3e5..d417db5dd2 100644--- a/packages/playwright-client/types/types.d.ts+++ b/packages/playwright-client/types/types.d.ts@@ -4092,6 +4092,8 @@ export interface Page {* });* ```*+ * If a request matches multiple registered routes, the most recently registered route takes precedence.+ ** Page routes take precedence over browser context routes (set up with* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route))* when request matches both handlers.diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.tsindex 18f9f5e3e5..d417db5dd2 100644--- a/packages/playwright-core/types/types.d.ts+++ b/packages/playwright-core/types/types.d.ts@@ -4092,6 +4092,8 @@ export interface Page {* });* ```*+ * If a request matches multiple registered routes, the most recently registered route takes precedence.+ ** Page routes take precedence over browser context routes (set up with* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route))* when request matches both handlers.