From 6d4bc3b44222440774d608e5dbae574c7502626a Mon Sep 17 00:00:00 2001 From: Playwright Service <89237858+playwrightmachine@users.noreply.github.com> Date: Sat, 14 Sep 2024 03:17:46 -0700 Subject: [PATCH] feat(roll): roll to ToT Playwright (14-09-24) (#1523) --- dotnet/docs/api/class-page.mdx | 17 +++++++++++++++++ dotnet/docs/api/class-tracing.mdx | 8 ++++---- dotnet/docs/trace-viewer.mdx | 6 +++--- java/docs/api/class-page.mdx | 17 +++++++++++++++++ java/docs/api/class-tracing.mdx | 8 ++++---- java/docs/ci.mdx | 12 ++++++------ java/docs/docker.mdx | 14 +++++++------- java/docs/intro.mdx | 2 +- java/docs/test-runners.mdx | 4 ++-- java/docs/trace-viewer-intro.mdx | 6 +++--- java/docs/trace-viewer.mdx | 10 +++++----- nodejs/docs/api/class-apirequestcontext.mdx | 14 +++++++------- nodejs/docs/api/class-page.mdx | 17 +++++++++++++++++ nodejs/docs/api/class-tracing.mdx | 8 ++++---- nodejs/docs/ci.mdx | 20 ++++++++++---------- nodejs/docs/docker.mdx | 16 ++++++++-------- nodejs/docs/test-global-setup-teardown.mdx | 4 ++-- nodejs/docs/trace-viewer-intro.mdx | 2 +- nodejs/docs/trace-viewer.mdx | 10 +++++----- python/docs/api/class-page.mdx | 17 +++++++++++++++++ python/docs/api/class-tracing.mdx | 16 ++++++++-------- python/docs/trace-viewer-intro.mdx | 8 ++++---- python/docs/trace-viewer.mdx | 12 ++++++------ 23 files changed, 158 insertions(+), 90 deletions(-) diff --git a/dotnet/docs/api/class-page.mdx b/dotnet/docs/api/class-page.mdx index 65fbe599da..e08187fee4 100644 --- a/dotnet/docs/api/class-page.mdx +++ b/dotnet/docs/api/class-page.mdx @@ -673,6 +673,23 @@ class PageExamples --- +### ForceGarbageCollectionAsync {#page-force-garbage-collection} + +Added in: v1.47page.ForceGarbageCollectionAsync + +Force the browser to perform garbage collection. + +**Usage** + +```csharp +await Page.ForceGarbageCollectionAsync(); +``` + +**Returns** +- [void]# + +--- + ### Frame {#page-frame} Added before v1.9page.Frame diff --git a/dotnet/docs/api/class-tracing.mdx b/dotnet/docs/api/class-tracing.mdx index e113dc8959..b93a40536e 100644 --- a/dotnet/docs/api/class-tracing.mdx +++ b/dotnet/docs/api/class-tracing.mdx @@ -24,7 +24,7 @@ var page = await context.NewPageAsync(); await page.GotoAsync("https://playwright.dev"); await context.Tracing.StopAsync(new() { - Path = "trace.zip" + Path = "trace.pwtrace.zip" }); ``` @@ -54,7 +54,7 @@ var page = await context.NewPageAsync(); await page.GotoAsync("https://playwright.dev"); await context.Tracing.StopAsync(new() { - Path = "trace.zip" + Path = "trace.pwtrace.zip" }); ``` @@ -108,7 +108,7 @@ await page.GetByText("Get Started").ClickAsync(); // Everything between StartChunkAsync and StopChunkAsync will be recorded in the trace. await context.Tracing.StopChunkAsync(new() { - Path = "trace1.zip" + Path = "trace1.pwtrace.zip" }); await context.Tracing.StartChunkAsync(); @@ -116,7 +116,7 @@ await page.GotoAsync("http://example.com"); // Save a second trace file with different actions. await context.Tracing.StopChunkAsync(new() { - Path = "trace2.zip" + Path = "trace2.pwtrace.zip" }); ``` diff --git a/dotnet/docs/trace-viewer.mdx b/dotnet/docs/trace-viewer.mdx index 31d794a6cf..bf62013e11 100644 --- a/dotnet/docs/trace-viewer.mdx +++ b/dotnet/docs/trace-viewer.mdx @@ -312,10 +312,10 @@ public class ExampleTest : PageTest ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. ```bash -pwsh bin/Debug/netX/playwright.ps1 show-trace trace.zip +pwsh bin/Debug/netX/playwright.ps1 show-trace trace.pwtrace.zip ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -329,7 +329,7 @@ pwsh bin/Debug/netX/playwright.ps1 show-trace trace.zip You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -pwsh bin/Debug/netX/playwright.ps1 show-trace https://example.com/trace.zip +pwsh bin/Debug/netX/playwright.ps1 show-trace https://example.com/trace.pwtrace.zip ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. diff --git a/java/docs/api/class-page.mdx b/java/docs/api/class-page.mdx index 15582b02fc..cc4b1b1a6a 100644 --- a/java/docs/api/class-page.mdx +++ b/java/docs/api/class-page.mdx @@ -674,6 +674,23 @@ public class Example { --- +### forceGarbageCollection {#page-force-garbage-collection} + +Added in: v1.47page.forceGarbageCollection + +Force the browser to perform garbage collection. + +**Usage** + +```java +Page.forceGarbageCollection(); +``` + +**Returns** +- [void]# + +--- + ### frame {#page-frame} Added before v1.9page.frame diff --git a/java/docs/api/class-tracing.mdx b/java/docs/api/class-tracing.mdx index 23afdbe27a..79398c909b 100644 --- a/java/docs/api/class-tracing.mdx +++ b/java/docs/api/class-tracing.mdx @@ -20,7 +20,7 @@ context.tracing().start(new Tracing.StartOptions() Page page = context.newPage(); page.navigate("https://playwright.dev"); context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.zip"))); + .setPath(Paths.get("trace.pwtrace.zip"))); ``` @@ -43,7 +43,7 @@ context.tracing().start(new Tracing.StartOptions() Page page = context.newPage(); page.navigate("https://playwright.dev"); context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.zip"))); + .setPath(Paths.get("trace.pwtrace.zip"))); ``` **Arguments** @@ -90,13 +90,13 @@ context.tracing().startChunk(); page.getByText("Get Started").click(); // Everything between startChunk and stopChunk will be recorded in the trace. context.tracing().stopChunk(new Tracing.StopChunkOptions() - .setPath(Paths.get("trace1.zip"))); + .setPath(Paths.get("trace1.pwtrace.zip"))); context.tracing().startChunk(); page.navigate("http://example.com"); // Save a second trace file with different actions. context.tracing().stopChunk(new Tracing.StopChunkOptions() - .setPath(Paths.get("trace2.zip"))); + .setPath(Paths.get("trace2.pwtrace.zip"))); ``` **Arguments** diff --git a/java/docs/ci.mdx b/java/docs/ci.mdx index a2914acd0a..6fa059ac42 100644 --- a/java/docs/ci.mdx +++ b/java/docs/ci.mdx @@ -75,7 +75,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright/java:v1.46.0-jammy + image: mcr.microsoft.com/playwright/java:v1.47.0-jammy steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v3 @@ -166,7 +166,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright/java:v1.46.0-noble +container: mcr.microsoft.com/playwright/java:v1.47.0-noble steps: - task: JavaToolInstaller@0 @@ -189,7 +189,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-jammy-development: docker: - - image: mcr.microsoft.com/playwright/java:v1.46.0-noble + - image: mcr.microsoft.com/playwright/java:v1.47.0-noble ``` Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures. @@ -200,7 +200,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright/java:v1.46.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright/java:v1.47.0-noble' } } stages { stage('e2e-tests') { steps { @@ -217,7 +217,7 @@ pipeline { Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)). ```yml -image: mcr.microsoft.com/playwright/java:v1.46.0-noble +image: mcr.microsoft.com/playwright/java:v1.47.0-noble ``` ### GitLab CI @@ -230,7 +230,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright/java:v1.46.0-noble + image: mcr.microsoft.com/playwright/java:v1.47.0-noble script: ... ``` diff --git a/java/docs/docker.mdx b/java/docs/docker.mdx index c89fa6c679..154d7795a9 100644 --- a/java/docs/docker.mdx +++ b/java/docs/docker.mdx @@ -21,7 +21,7 @@ This Docker image is intended to be used for testing and development purposes on ### Pull the image ```bash -docker pull mcr.microsoft.com/playwright/java:v1.46.0-noble +docker pull mcr.microsoft.com/playwright/java:v1.47.0-noble ``` ### Run the image @@ -33,7 +33,7 @@ By default, the Docker image will use the `root` user to run the browsers. This On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers. ```bash -docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.46.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.47.0-noble /bin/bash ``` #### Crawling and scraping @@ -41,7 +41,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.46.0-noble / On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it. ```bash -docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.46.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.47.0-noble /bin/bash ``` [`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions: @@ -74,10 +74,10 @@ See our [Continuous Integration guides](./ci.mdx) for sample configs. See [all available image tags]. We currently publish images with the following tags: -- `:v1.46.0` - Playwright v1.46.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.46.0-noble` - Playwright v1.46.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.46.0-jammy` - Playwright v1.46.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). -- `:v1.46.0-focal` - Playwright v1.46.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). +- `:v1.47.0` - Playwright v1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.0-noble` - Playwright v1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.0-jammy` - Playwright v1.47.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.47.0-focal` - Playwright v1.47.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). :::note It is recommended to always pin your Docker image to a specific version if possible. If the Playwright version in your Docker image does not match the version in your project/tests, Playwright will be unable to locate browser executables. diff --git a/java/docs/intro.mdx b/java/docs/intro.mdx index efebbcc8b9..624b5e3c71 100644 --- a/java/docs/intro.mdx +++ b/java/docs/intro.mdx @@ -58,7 +58,7 @@ public class App { com.microsoft.playwright playwright - 1.46.0 + 1.47.0 diff --git a/java/docs/test-runners.mdx b/java/docs/test-runners.mdx index 8eb0c5b7b5..c0cd3e294e 100644 --- a/java/docs/test-runners.mdx +++ b/java/docs/test-runners.mdx @@ -198,7 +198,7 @@ repositories { } dependencies { - implementation 'com.microsoft.playwright:playwright:1.46.0' + implementation 'com.microsoft.playwright:playwright:1.47.0' } application { @@ -231,7 +231,7 @@ repositories { } dependencies { - implementation("com.microsoft.playwright:playwright:1.46.0") + implementation("com.microsoft.playwright:playwright:1.47.0") } application { diff --git a/java/docs/trace-viewer-intro.mdx b/java/docs/trace-viewer-intro.mdx index 9788ec6bae..97eb9d9e01 100644 --- a/java/docs/trace-viewer-intro.mdx +++ b/java/docs/trace-viewer-intro.mdx @@ -33,17 +33,17 @@ page.navigate("https://playwright.dev"); // Stop tracing and export it into a zip archive. context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.zip"))); + .setPath(Paths.get("trace.pwtrace.zip"))); ``` -This will record the trace and place it into the file named `trace.zip`. +This will record the trace and place it into the file named `trace.pwtrace.zip`. ## Opening the trace You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your trace's zip file is located. Once opened you can click on each action or use the timeline to see the state of the page before and after each action. You can also inspect the log, source and network during each step of the test. The trace viewer creates a DOM snapshot so you can fully interact with it, open devtools etc. ```bash -mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.zip" +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.pwtrace.zip" ``` ###### diff --git a/java/docs/trace-viewer.mdx b/java/docs/trace-viewer.mdx index 227b01587a..a0e2272bd3 100644 --- a/java/docs/trace-viewer.mdx +++ b/java/docs/trace-viewer.mdx @@ -120,17 +120,17 @@ page.navigate("https://playwright.dev"); // Stop tracing and export it into a zip archive. context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.zip"))); + .setPath(Paths.get("trace.pwtracezip"))); ``` -This will record the trace and place it into the file named `trace.zip`. +This will record the trace and place it into the file named `trace.pwtrace.zip`. ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. ```bash -mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.zip" +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.pwtrace.zip" ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -144,7 +144,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="sh You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace https://example.com/trace.zip" +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace https://example.com/trace.pwtrace.zip" ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. diff --git a/nodejs/docs/api/class-apirequestcontext.mdx b/nodejs/docs/api/class-apirequestcontext.mdx index fd4aab4a13..d8c02a87ce 100644 --- a/nodejs/docs/api/class-apirequestcontext.mdx +++ b/nodejs/docs/api/class-apirequestcontext.mdx @@ -46,7 +46,7 @@ await apiRequestContext.delete(url, options); - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)* Added in: v1.17# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)* Added in: v1.17# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# @@ -154,7 +154,7 @@ await request.fetch('https://example.com/api/uploadForm', { - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)*# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)*# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# @@ -238,7 +238,7 @@ await request.get('https://example.com/api/getText', { params: queryString }); - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)* Added in: v1.26# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)* Added in: v1.26# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# @@ -301,7 +301,7 @@ await apiRequestContext.head(url, options); - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)* Added in: v1.26# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)* Added in: v1.26# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# @@ -364,7 +364,7 @@ await apiRequestContext.patch(url, options); - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)*# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)*# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# @@ -458,7 +458,7 @@ await request.post('https://example.com/api/uploadForm', { - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)*# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)*# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# @@ -521,7 +521,7 @@ await apiRequestContext.put(url, options); - `failOnStatusCode` [boolean] *(optional)*# Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes. - - `form` [Object]<[string], [string] | [number] | [boolean]> *(optional)*# + - `form` [Object]<[string], [string] | [number] | [boolean]> | [FormData] *(optional)*# Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded` unless explicitly provided. - `headers` [Object]<[string], [string]> *(optional)*# diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx index a002a3f170..46f92eba33 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -672,6 +672,23 @@ const crypto = require('crypto'); --- +### forceGarbageCollection {#page-force-garbage-collection} + +Added in: v1.47page.forceGarbageCollection + +Force the browser to perform garbage collection. + +**Usage** + +```js +await page.forceGarbageCollection(); +``` + +**Returns** +- [Promise]<[void]># + +--- + ### frame {#page-frame} Added before v1.9page.frame diff --git a/nodejs/docs/api/class-tracing.mdx b/nodejs/docs/api/class-tracing.mdx index 50073d161b..e32d303fc1 100644 --- a/nodejs/docs/api/class-tracing.mdx +++ b/nodejs/docs/api/class-tracing.mdx @@ -17,7 +17,7 @@ const context = await browser.newContext(); await context.tracing.start({ screenshots: true, snapshots: true }); const page = await context.newPage(); await page.goto('https://playwright.dev'); -await context.tracing.stop({ path: 'trace.zip' }); +await context.tracing.stop({ path: 'trace.pwtrace.zip' }); ``` @@ -37,7 +37,7 @@ Start tracing. await context.tracing.start({ screenshots: true, snapshots: true }); const page = await context.newPage(); await page.goto('https://playwright.dev'); -await context.tracing.stop({ path: 'trace.zip' }); +await context.tracing.stop({ path: 'trace.pwtrace.zip' }); ``` **Arguments** @@ -81,12 +81,12 @@ await page.goto('https://playwright.dev'); await context.tracing.startChunk(); await page.getByText('Get Started').click(); // Everything between startChunk and stopChunk will be recorded in the trace. -await context.tracing.stopChunk({ path: 'trace1.zip' }); +await context.tracing.stopChunk({ path: 'trace1.pwtrace.zip' }); await context.tracing.startChunk(); await page.goto('http://example.com'); // Save a second trace file with different actions. -await context.tracing.stopChunk({ path: 'trace2.zip' }); +await context.tracing.stopChunk({ path: 'trace2.pwtrace.zip' }); ``` **Arguments** diff --git a/nodejs/docs/ci.mdx b/nodejs/docs/ci.mdx index b2960dc62f..cbbed985ad 100644 --- a/nodejs/docs/ci.mdx +++ b/nodejs/docs/ci.mdx @@ -101,7 +101,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright:v1.47.0-jammy + image: mcr.microsoft.com/playwright:v1.47.1-jammy steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -341,7 +341,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright:v1.47.0-noble +container: mcr.microsoft.com/playwright:v1.47.1-noble steps: - task: NodeTool@0 @@ -365,7 +365,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-jammy-development: docker: - - image: mcr.microsoft.com/playwright:v1.47.0-noble + - image: mcr.microsoft.com/playwright:v1.47.1-noble ``` Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures. @@ -388,7 +388,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright:v1.47.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright:v1.47.1-noble' } } stages { stage('e2e-tests') { steps { @@ -405,7 +405,7 @@ pipeline { Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)). ```yml -image: mcr.microsoft.com/playwright:v1.47.0-noble +image: mcr.microsoft.com/playwright:v1.47.1-noble ``` ### GitLab CI @@ -418,7 +418,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.47.0-noble + image: mcr.microsoft.com/playwright:v1.47.1-noble script: ... ``` @@ -433,7 +433,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.47.0-noble + image: mcr.microsoft.com/playwright:v1.47.1-noble parallel: 7 script: - npm ci @@ -448,7 +448,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.47.0-noble + image: mcr.microsoft.com/playwright:v1.47.1-noble parallel: matrix: - PROJECT: ['chromium', 'webkit'] @@ -464,7 +464,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see ```yml steps: -- name: mcr.microsoft.com/playwright:v1.47.0-noble +- name: mcr.microsoft.com/playwright:v1.47.1-noble script: ... env: @@ -482,7 +482,7 @@ type: docker steps: - name: test - image: mcr.microsoft.com/playwright:v1.47.0-jammy + image: mcr.microsoft.com/playwright:v1.47.1-jammy commands: - npx playwright test ``` diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx index 9338f46d02..7a98a63315 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/docker.mdx @@ -21,7 +21,7 @@ This Docker image is intended to be used for testing and development purposes on ### Pull the image ```bash -docker pull mcr.microsoft.com/playwright:v1.47.0-noble +docker pull mcr.microsoft.com/playwright:v1.47.1-noble ``` ### Run the image @@ -33,7 +33,7 @@ By default, the Docker image will use the `root` user to run the browsers. This On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers. ```bash -docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.47.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.47.1-noble /bin/bash ``` #### Crawling and scraping @@ -41,7 +41,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.47.0-noble /bin/b On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it. ```bash -docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.47.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.47.1-noble /bin/bash ``` [`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions: @@ -74,10 +74,10 @@ See our [Continuous Integration guides](./ci.mdx) for sample configs. See [all available image tags]. We currently publish images with the following tags: -- `:v1.47.0` - Playwright v1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.47.0-noble` - Playwright v1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.47.0-jammy` - Playwright v1.47.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). -- `:v1.47.0-focal` - Playwright v1.47.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). +- `:v1.47.1` - Playwright v1.47.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.1-noble` - Playwright v1.47.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.1-jammy` - Playwright v1.47.1 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.47.1-focal` - Playwright v1.47.1 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). :::note It is recommended to always pin your Docker image to a specific version if possible. If the Playwright version in your Docker image does not match the version in your project/tests, Playwright will be unable to locate browser executables. @@ -101,7 +101,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers] ```Dockerfile FROM node:20-bookworm -RUN npx -y playwright@1.47.0 install --with-deps +RUN npx -y playwright@1.47.1 install --with-deps ``` diff --git a/nodejs/docs/test-global-setup-teardown.mdx b/nodejs/docs/test-global-setup-teardown.mdx index 18a10e1999..90a0053880 100644 --- a/nodejs/docs/test-global-setup-teardown.mdx +++ b/nodejs/docs/test-global-setup-teardown.mdx @@ -242,12 +242,12 @@ async function globalSetup(config: FullConfig) { await page.getByText('Sign in').click(); await context.storageState({ path: storageState as string }); await context.tracing.stop({ - path: './test-results/setup-trace.zip', + path: './test-results/setup-trace.pwtrace.zip', }); await browser.close(); } catch (error) { await context.tracing.stop({ - path: './test-results/failed-setup-trace.zip', + path: './test-results/failed-setup-trace.pwtrace.zip', }); await browser.close(); throw error; diff --git a/nodejs/docs/trace-viewer-intro.mdx b/nodejs/docs/trace-viewer-intro.mdx index 0a56c31889..d274ff11b9 100644 --- a/nodejs/docs/trace-viewer-intro.mdx +++ b/nodejs/docs/trace-viewer-intro.mdx @@ -21,7 +21,7 @@ Playwright Trace Viewer is a GUI tool that lets you explore recorded Playwright ## Recording a Trace -By default the [playwright.config](./trace-viewer.mdx#recording-a-trace-on-ci) file will contain the configuration needed to create a `trace.zip` file for each test. Traces are setup to run `on-first-retry` meaning they will be run on the first retry of a failed test. Also `retries` are set to 2 when running on CI and 0 locally. This means the traces will be recorded on the first retry of a failed test but not on the first run and not on the second retry. +By default the [playwright.config](./trace-viewer.mdx#recording-a-trace-on-ci) file will contain the configuration needed to create a `trace.pwtrace.zip` file for each test. Traces are setup to run `on-first-retry` meaning they will be run on the first retry of a failed test. Also `retries` are set to 2 when running on CI and 0 locally. This means the traces will be recorded on the first retry of a failed test but not on the first run and not on the second retry. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; diff --git a/nodejs/docs/trace-viewer.mdx b/nodejs/docs/trace-viewer.mdx index 6feb18a0df..6add354ec9 100644 --- a/nodejs/docs/trace-viewer.mdx +++ b/nodejs/docs/trace-viewer.mdx @@ -126,7 +126,7 @@ npx playwright show-report ## Recording a trace on CI -Traces should be run on continuous integration on the first retry of a failed test by setting the `trace: 'on-first-retry'` option in the test configuration file. This will produce a `trace.zip` file for each test that was retried. +Traces should be run on continuous integration on the first retry of a failed test by setting the `trace: 'on-first-retry'` option in the test configuration file. This will produce a `trace.pwtrace.zip` file for each test that was retried. @@ -183,10 +183,10 @@ If you are not using Playwright as a Test Runner, use the [browserContext.tracin ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. ```bash -npx playwright show-trace path/to/trace.zip +npx playwright show-trace path/to/trace.pwtrace.zip ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -200,7 +200,7 @@ npx playwright show-trace path/to/trace.zip You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -npx playwright show-trace https://example.com/trace.zip +npx playwright show-trace https://example.com/trace.pwtrace.zip ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. diff --git a/python/docs/api/class-page.mdx b/python/docs/api/class-page.mdx index cb86f41fe5..7f3b8e6b52 100644 --- a/python/docs/api/class-page.mdx +++ b/python/docs/api/class-page.mdx @@ -1467,6 +1467,23 @@ asyncio.run(main()) --- +### force_garbage_collection {#page-force-garbage-collection} + +Added in: v1.47page.force_garbage_collection + +Force the browser to perform garbage collection. + +**Usage** + +```python +page.force_garbage_collection() +``` + +**Returns** +- [NoneType]# + +--- + ### frame {#page-frame} Added before v1.9page.frame diff --git a/python/docs/api/class-tracing.mdx b/python/docs/api/class-tracing.mdx index 0f6fabf009..93a7555f86 100644 --- a/python/docs/api/class-tracing.mdx +++ b/python/docs/api/class-tracing.mdx @@ -27,7 +27,7 @@ context = browser.new_context() context.tracing.start(screenshots=True, snapshots=True) page = context.new_page() page.goto("https://playwright.dev") -context.tracing.stop(path = "trace.zip") +context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -39,7 +39,7 @@ context = await browser.new_context() await context.tracing.start(screenshots=True, snapshots=True) page = await context.new_page() await page.goto("https://playwright.dev") -await context.tracing.stop(path = "trace.zip") +await context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -72,7 +72,7 @@ Start tracing. context.tracing.start(screenshots=True, snapshots=True) page = context.new_page() page.goto("https://playwright.dev") -context.tracing.stop(path = "trace.zip") +context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -82,7 +82,7 @@ context.tracing.stop(path = "trace.zip") await context.tracing.start(screenshots=True, snapshots=True) page = await context.new_page() await page.goto("https://playwright.dev") -await context.tracing.stop(path = "trace.zip") +await context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -138,12 +138,12 @@ page.goto("https://playwright.dev") context.tracing.start_chunk() page.get_by_text("Get Started").click() # Everything between start_chunk and stop_chunk will be recorded in the trace. -context.tracing.stop_chunk(path = "trace1.zip") +context.tracing.stop_chunk(path = "trace1.pwtrace.zip") context.tracing.start_chunk() page.goto("http://example.com") # Save a second trace file with different actions. -context.tracing.stop_chunk(path = "trace2.zip") +context.tracing.stop_chunk(path = "trace2.pwtrace.zip") ``` @@ -157,12 +157,12 @@ await page.goto("https://playwright.dev") await context.tracing.start_chunk() await page.get_by_text("Get Started").click() # Everything between start_chunk and stop_chunk will be recorded in the trace. -await context.tracing.stop_chunk(path = "trace1.zip") +await context.tracing.stop_chunk(path = "trace1.pwtrace.zip") await context.tracing.start_chunk() await page.goto("http://example.com") # Save a second trace file with different actions. -await context.tracing.stop_chunk(path = "trace2.zip") +await context.tracing.stop_chunk(path = "trace2.pwtrace.zip") ``` diff --git a/python/docs/trace-viewer-intro.mdx b/python/docs/trace-viewer-intro.mdx index abf9561dce..f3a72c35c9 100644 --- a/python/docs/trace-viewer-intro.mdx +++ b/python/docs/trace-viewer-intro.mdx @@ -27,7 +27,7 @@ Options for tracing are: - `off`: Do not record trace. (default) - `retain-on-failure`: Record trace for each test, but remove all traces from successful test runs. -This will record the trace and place it into the file named `trace.zip` in your `test-results` directory. +This will record the trace and place it into the file named `trace.pwtrace.zip` in your `test-results` directory.
@@ -54,7 +54,7 @@ page = context.new_page() page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -context.tracing.stop(path = "trace.zip") +context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -71,7 +71,7 @@ page = await context.new_page() await page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -await context.tracing.stop(path = "trace.zip") +await context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -84,7 +84,7 @@ await context.tracing.stop(path = "trace.zip") You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your trace's zip file is located. Once opened you can click on each action or use the timeline to see the state of the page before and after each action. You can also inspect the log, source and network during each step of the test. The trace viewer creates a DOM snapshot so you can fully interact with it, open devtools etc. ```bash -playwright show-trace trace.zip +playwright show-trace trace.pwtrace.zip ``` ###### diff --git a/python/docs/trace-viewer.mdx b/python/docs/trace-viewer.mdx index 5ec9fb5e2f..1bf84b1a9f 100644 --- a/python/docs/trace-viewer.mdx +++ b/python/docs/trace-viewer.mdx @@ -114,7 +114,7 @@ Options for tracing are: - `off`: Do not record trace. (default) - `retain-on-failure`: Record trace for each test, but remove all traces from successful test runs. -This will record the trace and place it into the file named `trace.zip` in your `test-results` directory. +This will record the trace and place it into the file named `trace.pwtrace.zip` in your `test-results` directory.
@@ -141,7 +141,7 @@ page = context.new_page() page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -context.tracing.stop(path = "trace.zip") +context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -158,7 +158,7 @@ page = await context.new_page() await page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -await context.tracing.stop(path = "trace.zip") +await context.tracing.stop(path = "trace.pwtrace.zip") ``` @@ -168,10 +168,10 @@ await context.tracing.stop(path = "trace.zip") ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. ```bash -playwright show-trace trace.zip +playwright show-trace trace.pwtrace.zip ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -185,7 +185,7 @@ playwright show-trace trace.zip You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -playwright show-trace https://example.com/trace.zip +playwright show-trace https://example.com/trace.pwtrace.zip ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply.