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
docs: update route.fetch example to use new api (#20040)
Yury Semikhatsky0206d5fb18a7
diff --git a/docs/src/network.md b/docs/src/network.mdindex 4aadde01b4..57bf0856f8 100644--- a/docs/src/network.md+++ b/docs/src/network.md@@ -575,7 +575,7 @@ To modify a response use [APIRequestContext] to get the original response and th```jsawait page.route('**/title.html', async route => {// Fetch original response.- const response = await page.request.fetch(route.request());+ const response = await route.fetch();// Add a prefix to the title.let body = await response.text();body = body.replace('<title>', '<title>My prefix:');@@ -596,7 +596,7 @@ await page.route('**/title.html', async route => {```javapage.route("**/title.html", route -> {// Fetch original response.- APIResponse response = page.request().fetch(route.request());+ APIResponse response = route.fetch();// Add a prefix to the title.String body = response.text();body = body.replace("<title>", "<title>My prefix:");@@ -615,7 +615,7 @@ page.route("**/title.html", route -> {```python asyncasync def handle_route(route: Route) -> None:# Fetch original response.- response = await page.request.fetch(route.request)+ response = await route.fetch()# Add a prefix to the title.body = await response.text()body = body.replace("<title>", "<title>My prefix:")@@ -634,7 +634,7 @@ await page.route("**/title.html", handle_route)```python syncdef handle_route(route: Route) -> None:# Fetch original response.- response = page.request.fetch(route.request)+ response = route.fetch()# Add a prefix to the title.body = response.text()body = body.replace("<title>", "<title>My prefix:")@@ -654,7 +654,7 @@ page.route("**/title.html", handle_route)await Page.RouteAsync("**/title.html", async route =>{// Fetch original response.- var response = await Page.APIRequest.FetchAsync(route.Request);+ var response = await route.FetchAsync();// Add a prefix to the title.var body = await response.TextAsync();body = body.Replace("<title>", "<title>My prefix:");