From 357a027acb8f26dedc6d6b3f9d5a74acef4be48a Mon Sep 17 00:00:00 2001
From: "microsoft-playwright-automation[bot]"
<203992400+microsoft-playwright-automation[bot]@users.noreply.github.com>
Date: Thu, 10 Jul 2025 08:17:33 +0000
Subject: [PATCH] feat(roll): roll to 1.54 Playwright
---
.../api/class-browsercontext.mdx | 9 +++-
.../version-stable/api/class-mouse.mdx | 5 +++
dotnet/versioned_docs/version-stable/ci.mdx | 10 ++---
.../versioned_docs/version-stable/clock.mdx | 11 +++++
.../versioned_docs/version-stable/codegen.mdx | 13 ++++++
.../versioned_docs/version-stable/docker.mdx | 16 ++++----
.../version-stable/release-notes.mdx | 21 +++++++++-
.../api/class-browsercontext.mdx | 9 +++-
.../version-stable/api/class-mouse.mdx | 5 +++
java/versioned_docs/version-stable/ci.mdx | 12 +++---
java/versioned_docs/version-stable/clock.mdx | 11 +++++
.../versioned_docs/version-stable/codegen.mdx | 13 ++++++
java/versioned_docs/version-stable/docker.mdx | 16 ++++----
java/versioned_docs/version-stable/intro.mdx | 2 +-
.../version-stable/release-notes.mdx | 21 +++++++++-
.../version-stable/test-runners.mdx | 4 +-
.../api/class-browsercontext.mdx | 9 +++-
.../api/class-consolemessage.mdx | 4 +-
.../version-stable/api/class-mouse.mdx | 5 +++
.../version-stable/api/class-test.mdx | 2 +-
.../version-stable/api/class-testcase.mdx | 3 ++
.../version-stable/api/class-testinfo.mdx | 3 ++
.../version-stable/api/class-testresult.mdx | 3 ++
.../version-stable/api/class-teststep.mdx | 3 ++
.../version-stable/chrome-extensions.mdx | 25 ++++-------
nodejs/versioned_docs/version-stable/ci.mdx | 20 ++++-----
.../versioned_docs/version-stable/codegen.mdx | 13 ++++++
.../versioned_docs/version-stable/docker.mdx | 18 ++++----
.../versioned_docs/version-stable/intro.mdx | 14 +++++--
.../version-stable/release-notes.mdx | 41 ++++++++++++++++++-
.../version-stable/test-reporters.mdx | 7 ++--
.../version-stable/test-snapshots.mdx | 6 +--
.../api/class-browsercontext.mdx | 9 +++-
.../api/class-consolemessage.mdx | 4 +-
.../version-stable/api/class-mouse.mdx | 5 +++
.../version-stable/chrome-extensions.mdx | 31 ++++++--------
python/versioned_docs/version-stable/ci.mdx | 12 +++---
.../versioned_docs/version-stable/clock.mdx | 35 ++++++++++++++++
.../versioned_docs/version-stable/codegen.mdx | 13 ++++++
.../versioned_docs/version-stable/docker.mdx | 18 ++++----
.../version-stable/release-notes.mdx | 21 +++++++++-
41 files changed, 380 insertions(+), 122 deletions(-)
diff --git a/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx b/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx
index d2c02a4a9c4..c19df7a3476 100644
--- a/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx
+++ b/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx
@@ -71,6 +71,9 @@ await context.AddCookiesAsync(new[] { cookie1, cookie2 });
- `SameSite` `enum SameSiteAttribute { Strict, Lax, None }?` *(optional)*
Optional.
+ - `PartitionKey` [string]? *(optional)*
+
+ For partitioned third-party cookies (aka [CHIPS](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies)), the partition key. Optional.
**Returns**
- [void]#
@@ -140,7 +143,7 @@ BrowserContext.BackgroundPages
Added before v1.9browserContext.Browser
-Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
+Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron.
**Usage**
@@ -279,6 +282,9 @@ await BrowserContext.CookiesAsync(urls);
- `sameSite` `enum SameSiteAttribute { Strict, Lax, None }`
+ - `partitionKey` [string]? *(optional)*
+
+
---
### ExposeBindingAsync {#browser-context-expose-binding}
@@ -436,6 +442,7 @@ await BrowserContext.GrantPermissionsAsync(permissions, options);
* `'notifications'`
* `'payment-handler'`
* `'storage-access'`
+ * `'local-fonts'`
- `options` `BrowserContextGrantPermissionsOptions?` *(optional)*
- `Origin` [string]? *(optional)*#
diff --git a/dotnet/versioned_docs/version-stable/api/class-mouse.mdx b/dotnet/versioned_docs/version-stable/api/class-mouse.mdx
index 65216056577..ace213b7186 100644
--- a/dotnet/versioned_docs/version-stable/api/class-mouse.mdx
+++ b/dotnet/versioned_docs/version-stable/api/class-mouse.mdx
@@ -9,6 +9,11 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
+:::tip
+
+If you want to debug where the mouse moved, you can use the [Trace viewer](../trace-viewer-intro.mdx) or [Playwright Inspector](../running-tests.mdx). A red dot showing the location of the mouse will be shown for every mouse action.
+:::
+
Every `page` object has its own Mouse, accessible with [Page.Mouse](/api/class-page.mdx#page-mouse).
```csharp
diff --git a/dotnet/versioned_docs/version-stable/ci.mdx b/dotnet/versioned_docs/version-stable/ci.mdx
index b7d102ca015..da2d1134ed2 100644
--- a/dotnet/versioned_docs/version-stable/ci.mdx
+++ b/dotnet/versioned_docs/version-stable/ci.mdx
@@ -76,7 +76,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
- image: mcr.microsoft.com/playwright/dotnet:v1.52.0-noble
+ image: mcr.microsoft.com/playwright/dotnet:v1.53.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v4
@@ -159,7 +159,7 @@ trigger:
pool:
vmImage: ubuntu-latest
-container: mcr.microsoft.com/playwright/dotnet:v1.52.0-noble
+container: mcr.microsoft.com/playwright/dotnet:v1.53.0-noble
steps:
- task: UseDotNet@2
@@ -182,7 +182,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-noble-development:
docker:
- - image: mcr.microsoft.com/playwright/dotnet:v1.52.0-noble
+ - image: mcr.microsoft.com/playwright/dotnet:v1.53.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.
@@ -193,7 +193,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](
```groovy
pipeline {
- agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.52.0-noble' } }
+ agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.53.0-noble' } }
stages {
stage('e2e-tests') {
steps {
@@ -210,7 +210,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/dotnet:v1.52.0-noble
+image: mcr.microsoft.com/playwright/dotnet:v1.53.0-noble
```
### GitLab CI
diff --git a/dotnet/versioned_docs/version-stable/clock.mdx b/dotnet/versioned_docs/version-stable/clock.mdx
index 92513de8ccc..07adfe38211 100644
--- a/dotnet/versioned_docs/version-stable/clock.mdx
+++ b/dotnet/versioned_docs/version-stable/clock.mdx
@@ -58,6 +58,17 @@ Often you only need to fake `Date.now` while keeping the timers going. That way
```
+```csharp
+// Set the fixed time for the clock.
+await Page.Clock.SetFixedTimeAsync(new DateTime(2024, 2, 2, 10, 0, 0));
+await Page.GotoAsync("http://localhost:3333");
+await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:00:00 AM");
+// Set the fixed time for the clock.
+await Page.Clock.SetFixedTimeAsync(new DateTime(2024, 2, 2, 10, 30, 0));
+// We know that the page has a timer that updates the time every second.
+await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:30:00 AM");
+```
+
## Consistent time and timers
Sometimes your timers depend on `Date.now` and are confused when the `Date.now` value does not change over time. In this case, you can install the clock and fast forward to the time of interest when testing.
diff --git a/dotnet/versioned_docs/version-stable/codegen.mdx b/dotnet/versioned_docs/version-stable/codegen.mdx
index f106141b0ad..90f4855ac72 100644
--- a/dotnet/versioned_docs/version-stable/codegen.mdx
+++ b/dotnet/versioned_docs/version-stable/codegen.mdx
@@ -134,6 +134,19 @@ pwsh bin/Debug/netX/playwright.ps1 codegen --load-storage=auth.json github.com/m
######
+#### Use existing userDataDir
+
+Run `codegen` with `--user-data-dir` to set a fixed [user data directory](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-user-data-dir) for the browser session. If you create a custom browser user data directory, codegen will use this existing browser profile and have access to any authentication state present in that profile.
+
+:::warning
+
+[As of Chrome 136, the default user data directory cannot be accessed via automated tooling](https://developer.chrome.com/blog/remote-debugging-port), such as Playwright. You must create a separate user data directory for use in testing.
+:::
+
+```bash
+pwsh bin/Debug/netX/playwright.ps1 codegen --user-data-dir=/path/to/your/browser/data/ github.com/microsoft/playwright
+```
+
## Record using custom setup
If you would like to use codegen in some non-standard setup (for example, use [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route)), it is possible to call [Page.PauseAsync()](/api/class-page.mdx#page-pause) that will open a separate window with codegen controls.
diff --git a/dotnet/versioned_docs/version-stable/docker.mdx b/dotnet/versioned_docs/version-stable/docker.mdx
index c353f3353da..90730270f59 100644
--- a/dotnet/versioned_docs/version-stable/docker.mdx
+++ b/dotnet/versioned_docs/version-stable/docker.mdx
@@ -22,7 +22,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/dotnet:v1.52.0-noble
+docker pull mcr.microsoft.com/playwright/dotnet:v1.53.0-noble
```
### Run the image
@@ -34,7 +34,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/dotnet:v1.52.0-noble /bin/bash
+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.53.0-noble /bin/bash
```
#### Crawling and scraping
@@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.52.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/dotnet:v1.52.0-noble /bin/bash
+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.53.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:
@@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the
Start the Playwright Server in Docker:
```bash
-docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.52.0-noble /bin/sh -c "npx -y playwright@1.52.0 run-server --port 3000 --host 0.0.0.0"
+docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
```
#### Connecting to the Server
@@ -99,7 +99,7 @@ await using var browser = await playwright.Chromium.ConnectAsync("ws://127.0.0.1
If you need to access local servers from within the Docker container:
```bash
-docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.52.0-noble /bin/sh -c "npx -y playwright@1.52.0 run-server --port 3000 --host 0.0.0.0"
+docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
```
This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers.
@@ -114,9 +114,9 @@ When running tests remotely, ensure the Playwright version in your tests matches
See [all available image tags].
We currently publish images with the following tags:
-- `:v1.52.0` - Playwright v1.52.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.52.0-noble` - Playwright v1.52.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.52.0-jammy` - Playwright v1.52.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
+- `:v1.53.0` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.0-noble` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.0-jammy` - Playwright v1.53.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
:::note
diff --git a/dotnet/versioned_docs/version-stable/release-notes.mdx b/dotnet/versioned_docs/version-stable/release-notes.mdx
index 7d2ff0d4b4d..3b1eb6a4fe3 100644
--- a/dotnet/versioned_docs/version-stable/release-notes.mdx
+++ b/dotnet/versioned_docs/version-stable/release-notes.mdx
@@ -7,10 +7,29 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
+## Version 1.54
+- New cookie property `PartitionKey` in [BrowserContext.CookiesAsync()](/api/class-browsercontext.mdx#browser-context-cookies) and [BrowserContext.AddCookiesAsync()](/api/class-browsercontext.mdx#browser-context-add-cookies). This property allows to save and restore partitioned cookies. See [CHIPS MDN article](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) for more information. Note that browsers have different support and defaults for cookie partitioning.
+- New option `--user-data-dir` in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
+
+ ```bash
+ pwsh bin/Debug/netX/playwright.ps1 codegen --user-data-dir=./user-data
+ ```
+
+- `pwsh bin/Debug/netX/playwright.ps1 open` does not open the test recorder anymore. Use `pwsh bin/Debug/netX/playwright.ps1 codegen` instead.
+
+### Browser Versions
+- Chromium 139.0.7258.5
+- Mozilla Firefox 140.0.2
+- WebKit 26.0
+
+This version was also tested against the following stable channels:
+- Google Chrome 140
+- Microsoft Edge 140
+
## Version 1.53
### Miscellaneous
-- New Steps in Trace Viewer: 
+- New Steps in Trace Viewer: 
- New method [Locator.Describe()](/api/class-locator.mdx#locator-describe) to describe a locator. Used for trace viewer.
```csharp
diff --git a/java/versioned_docs/version-stable/api/class-browsercontext.mdx b/java/versioned_docs/version-stable/api/class-browsercontext.mdx
index 0fb746f1094..71d675fb5cd 100644
--- a/java/versioned_docs/version-stable/api/class-browsercontext.mdx
+++ b/java/versioned_docs/version-stable/api/class-browsercontext.mdx
@@ -69,6 +69,9 @@ browserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2));
- `setSameSite` `enum SameSiteAttribute { STRICT, LAX, NONE }` *(optional)*
Optional.
+ - `setPartitionKey` [String] *(optional)*
+
+ For partitioned third-party cookies (aka [CHIPS](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies)), the partition key. Optional.
**Returns**
- [void]#
@@ -139,7 +142,7 @@ BrowserContext.backgroundPages();
Added before v1.9browserContext.browser
-Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
+Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron.
**Usage**
@@ -280,6 +283,9 @@ BrowserContext.cookies(urls);
- `sameSite` `enum SameSiteAttribute { STRICT, LAX, NONE }`
+ - `partitionKey` [String] *(optional)*
+
+
---
### exposeBinding {#browser-context-expose-binding}
@@ -447,6 +453,7 @@ BrowserContext.grantPermissions(permissions, options);
* `'notifications'`
* `'payment-handler'`
* `'storage-access'`
+ * `'local-fonts'`
- `options` `BrowserContext.GrantPermissionsOptions` *(optional)*
- `setOrigin` [String] *(optional)*#
diff --git a/java/versioned_docs/version-stable/api/class-mouse.mdx b/java/versioned_docs/version-stable/api/class-mouse.mdx
index 1bbffe88751..2ce1015698f 100644
--- a/java/versioned_docs/version-stable/api/class-mouse.mdx
+++ b/java/versioned_docs/version-stable/api/class-mouse.mdx
@@ -9,6 +9,11 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
+:::tip
+
+If you want to debug where the mouse moved, you can use the [Trace viewer](../trace-viewer-intro.mdx) or [Playwright Inspector](../running-tests.mdx). A red dot showing the location of the mouse will be shown for every mouse action.
+:::
+
Every `page` object has its own Mouse, accessible with [Page.mouse()](/api/class-page.mdx#page-mouse).
```java
diff --git a/java/versioned_docs/version-stable/ci.mdx b/java/versioned_docs/version-stable/ci.mdx
index 02023ffa94d..8e84328bb22 100644
--- a/java/versioned_docs/version-stable/ci.mdx
+++ b/java/versioned_docs/version-stable/ci.mdx
@@ -75,7 +75,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
- image: mcr.microsoft.com/playwright/java:v1.52.0-noble
+ image: mcr.microsoft.com/playwright/java:v1.53.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v4
@@ -160,7 +160,7 @@ trigger:
pool:
vmImage: ubuntu-latest
-container: mcr.microsoft.com/playwright/java:v1.52.0-noble
+container: mcr.microsoft.com/playwright/java:v1.53.0-noble
steps:
- task: JavaToolInstaller@0
@@ -183,7 +183,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-noble-development:
docker:
- - image: mcr.microsoft.com/playwright/java:v1.52.0-noble
+ - image: mcr.microsoft.com/playwright/java:v1.53.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.
@@ -194,7 +194,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](
```groovy
pipeline {
- agent { docker { image 'mcr.microsoft.com/playwright/java:v1.52.0-noble' } }
+ agent { docker { image 'mcr.microsoft.com/playwright/java:v1.53.0-noble' } }
stages {
stage('e2e-tests') {
steps {
@@ -211,7 +211,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.52.0-noble
+image: mcr.microsoft.com/playwright/java:v1.53.0-noble
```
### GitLab CI
@@ -224,7 +224,7 @@ stages:
tests:
stage: test
- image: mcr.microsoft.com/playwright/java:v1.52.0-noble
+ image: mcr.microsoft.com/playwright/java:v1.53.0-noble
script:
...
```
diff --git a/java/versioned_docs/version-stable/clock.mdx b/java/versioned_docs/version-stable/clock.mdx
index 15434ec0ca6..64655dd6fb1 100644
--- a/java/versioned_docs/version-stable/clock.mdx
+++ b/java/versioned_docs/version-stable/clock.mdx
@@ -58,6 +58,17 @@ Often you only need to fake `Date.now` while keeping the timers going. That way
```
+```java
+SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+page.clock().setFixedTime(format.parse("2024-02-02T10:00:00"));
+page.navigate("http://localhost:3333");
+Locator locator = page.getByTestId("current-time");
+assertThat(locator).hasText("2/2/2024, 10:00:00 AM");
+page.clock().setFixedTime(format.parse("2024-02-02T10:30:00"));
+// We know that the page has a timer that updates the time every second.
+assertThat(locator).hasText("2/2/2024, 10:30:00 AM");
+```
+
## Consistent time and timers
Sometimes your timers depend on `Date.now` and are confused when the `Date.now` value does not change over time. In this case, you can install the clock and fast forward to the time of interest when testing.
diff --git a/java/versioned_docs/version-stable/codegen.mdx b/java/versioned_docs/version-stable/codegen.mdx
index dc44d203f23..1d5ec814d2c 100644
--- a/java/versioned_docs/version-stable/codegen.mdx
+++ b/java/versioned_docs/version-stable/codegen.mdx
@@ -134,6 +134,19 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="co
######
+#### Use existing userDataDir
+
+Run `codegen` with `--user-data-dir` to set a fixed [user data directory](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-user-data-dir) for the browser session. If you create a custom browser user data directory, codegen will use this existing browser profile and have access to any authentication state present in that profile.
+
+:::warning
+
+[As of Chrome 136, the default user data directory cannot be accessed via automated tooling](https://developer.chrome.com/blog/remote-debugging-port), such as Playwright. You must create a separate user data directory for use in testing.
+:::
+
+```bash
+mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="codegen --user-data-dir=/path/to/your/browser/data/ github.com/microsoft/playwright"
+```
+
## Record using custom setup
If you would like to use codegen in some non-standard setup (for example, use [BrowserContext.route()](/api/class-browsercontext.mdx#browser-context-route)), it is possible to call [Page.pause()](/api/class-page.mdx#page-pause) that will open a separate window with codegen controls.
diff --git a/java/versioned_docs/version-stable/docker.mdx b/java/versioned_docs/version-stable/docker.mdx
index 30379ce2dba..7866a099eee 100644
--- a/java/versioned_docs/version-stable/docker.mdx
+++ b/java/versioned_docs/version-stable/docker.mdx
@@ -22,7 +22,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.52.0-noble
+docker pull mcr.microsoft.com/playwright/java:v1.53.0-noble
```
### Run the image
@@ -34,7 +34,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.52.0-noble /bin/bash
+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.53.0-noble /bin/bash
```
#### Crawling and scraping
@@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.52.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.52.0-noble /bin/bash
+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.53.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:
@@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the
Start the Playwright Server in Docker:
```bash
-docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.52.0-noble /bin/sh -c "npx -y playwright@1.52.0 run-server --port 3000 --host 0.0.0.0"
+docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
```
#### Connecting to the Server
@@ -107,7 +107,7 @@ public class App {
If you need to access local servers from within the Docker container:
```bash
-docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.52.0-noble /bin/sh -c "npx -y playwright@1.52.0 run-server --port 3000 --host 0.0.0.0"
+docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
```
This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers.
@@ -122,9 +122,9 @@ When running tests remotely, ensure the Playwright version in your tests matches
See [all available image tags].
We currently publish images with the following tags:
-- `:v1.52.0` - Playwright v1.52.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.52.0-noble` - Playwright v1.52.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.52.0-jammy` - Playwright v1.52.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
+- `:v1.53.0` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.0-noble` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.0-jammy` - Playwright v1.53.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
:::note
diff --git a/java/versioned_docs/version-stable/intro.mdx b/java/versioned_docs/version-stable/intro.mdx
index e5ab83d4f1a..a54a65d7d9d 100644
--- a/java/versioned_docs/version-stable/intro.mdx
+++ b/java/versioned_docs/version-stable/intro.mdx
@@ -58,7 +58,7 @@ public class App {
com.microsoft.playwright
playwright
- 1.52.0
+ 1.53.0
diff --git a/java/versioned_docs/version-stable/release-notes.mdx b/java/versioned_docs/version-stable/release-notes.mdx
index 1e59dbb0051..e60edacfdae 100644
--- a/java/versioned_docs/version-stable/release-notes.mdx
+++ b/java/versioned_docs/version-stable/release-notes.mdx
@@ -7,10 +7,29 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
+## Version 1.54
+- New cookie property `partitionKey` in [BrowserContext.cookies()](/api/class-browsercontext.mdx#browser-context-cookies) and [BrowserContext.addCookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). This property allows to save and restore partitioned cookies. See [CHIPS MDN article](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) for more information. Note that browsers have different support and defaults for cookie partitioning.
+- New option `--user-data-dir` in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
+
+ ```bash
+ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="codegen --user-data-dir=./user-data"
+ ```
+
+- `open` command does not open the test recorder anymore. Use `codegen` instead.
+
+### Browser Versions
+- Chromium 139.0.7258.5
+- Mozilla Firefox 140.0.2
+- WebKit 26.0
+
+This version was also tested against the following stable channels:
+- Google Chrome 140
+- Microsoft Edge 140
+
## Version 1.53
### Miscellaneous
-- New Steps in Trace Viewer: 
+- New Steps in Trace Viewer: 
- New method [Locator.describe()](/api/class-locator.mdx#locator-describe) to describe a locator. Used for trace viewer.
```java
diff --git a/java/versioned_docs/version-stable/test-runners.mdx b/java/versioned_docs/version-stable/test-runners.mdx
index 06932d4c8a0..84ed12671c9 100644
--- a/java/versioned_docs/version-stable/test-runners.mdx
+++ b/java/versioned_docs/version-stable/test-runners.mdx
@@ -198,7 +198,7 @@ repositories {
}
dependencies {
- implementation 'com.microsoft.playwright:playwright:1.52.0'
+ implementation 'com.microsoft.playwright:playwright:1.53.0'
}
application {
@@ -231,7 +231,7 @@ repositories {
}
dependencies {
- implementation("com.microsoft.playwright:playwright:1.52.0")
+ implementation("com.microsoft.playwright:playwright:1.53.0")
}
application {
diff --git a/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx b/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx
index 09f8b105d2a..510e28809c3 100644
--- a/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx
@@ -69,6 +69,9 @@ await browserContext.addCookies([cookieObject1, cookieObject2]);
- `sameSite` "Strict" | "Lax" | "None" *(optional)*
Optional.
+ - `partitionKey` [string] *(optional)*
+
+ For partitioned third-party cookies (aka [CHIPS](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies)), the partition key. Optional.
**Returns**
- [Promise]<[void]>#
@@ -150,7 +153,7 @@ browserContext.backgroundPages();
Added before v1.9browserContext.browser
-Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
+Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron.
**Usage**
@@ -290,6 +293,9 @@ await browserContext.cookies(urls);
- `sameSite` "Strict" | "Lax" | "None"
+ - `partitionKey` [string] *(optional)*
+
+
---
### exposeBinding {#browser-context-expose-binding}
@@ -439,6 +445,7 @@ await browserContext.grantPermissions(permissions, options);
* `'notifications'`
* `'payment-handler'`
* `'storage-access'`
+ * `'local-fonts'`
- `options` [Object] *(optional)*
- `origin` [string] *(optional)*#
diff --git a/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx b/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx
index f82c991d2d2..2b92dadfdae 100644
--- a/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx
@@ -115,8 +115,6 @@ consoleMessage.text();
Added before v1.9consoleMessage.type
-One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`, `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`, `'count'`, `'timeEnd'`.
-
**Usage**
```js
@@ -124,7 +122,7 @@ consoleMessage.type();
```
**Returns**
-- [string]#
+- "log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd"#
[Accessibility]: /api/class-accessibility.mdx "Accessibility"
diff --git a/nodejs/versioned_docs/version-stable/api/class-mouse.mdx b/nodejs/versioned_docs/version-stable/api/class-mouse.mdx
index 415de779f99..46415239c00 100644
--- a/nodejs/versioned_docs/version-stable/api/class-mouse.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-mouse.mdx
@@ -9,6 +9,11 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
+:::tip
+
+If you want to debug where the mouse moved, you can use the [Trace viewer](../trace-viewer-intro.mdx) or [Playwright Inspector](../running-tests.mdx). A red dot showing the location of the mouse will be shown for every mouse action.
+:::
+
Every `page` object has its own Mouse, accessible with [page.mouse](/api/class-page.mdx#page-mouse).
```js
diff --git a/nodejs/versioned_docs/version-stable/api/class-test.mdx b/nodejs/versioned_docs/version-stable/api/class-test.mdx
index 5d6be06a801..5a289da65ae 100644
--- a/nodejs/versioned_docs/version-stable/api/class-test.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-test.mdx
@@ -1191,7 +1191,7 @@ Timeout for the currently running test is available through [testInfo.timeout](/
Skip a test. Playwright will not run the test past the `test.skip()` call.
-Skipped tests are not supposed to be ever run. If you intent to fix the test, use [test.fixme()](/api/class-test.mdx#test-fixme) instead.
+Skipped tests are not supposed to be ever run. If you intend to fix the test, use [test.fixme()](/api/class-test.mdx#test-fixme) instead.
To declare a skipped test:
* `test.skip(title, body)`
diff --git a/nodejs/versioned_docs/version-stable/api/class-testcase.mdx b/nodejs/versioned_docs/version-stable/api/class-testcase.mdx
index 5a24aa60f9c..7b0079fe2ba 100644
--- a/nodejs/versioned_docs/version-stable/api/class-testcase.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-testcase.mdx
@@ -89,6 +89,9 @@ testCase.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/versioned_docs/version-stable/api/class-testinfo.mdx b/nodejs/versioned_docs/version-stable/api/class-testinfo.mdx
index eae95f81e85..54fe20911a8 100644
--- a/nodejs/versioned_docs/version-stable/api/class-testinfo.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-testinfo.mdx
@@ -366,6 +366,9 @@ testInfo.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/versioned_docs/version-stable/api/class-testresult.mdx b/nodejs/versioned_docs/version-stable/api/class-testresult.mdx
index e3bdcd8f488..9361fbeba0d 100644
--- a/nodejs/versioned_docs/version-stable/api/class-testresult.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-testresult.mdx
@@ -41,6 +41,9 @@ testResult.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/versioned_docs/version-stable/api/class-teststep.mdx b/nodejs/versioned_docs/version-stable/api/class-teststep.mdx
index 6c3de2b7897..0175c490198 100644
--- a/nodejs/versioned_docs/version-stable/api/class-teststep.mdx
+++ b/nodejs/versioned_docs/version-stable/api/class-teststep.mdx
@@ -53,6 +53,9 @@ testStep.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/versioned_docs/version-stable/chrome-extensions.mdx b/nodejs/versioned_docs/version-stable/chrome-extensions.mdx
index 58600712ef4..a0b1c340890 100644
--- a/nodejs/versioned_docs/version-stable/chrome-extensions.mdx
+++ b/nodejs/versioned_docs/version-stable/chrome-extensions.mdx
@@ -13,7 +13,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
Extensions only work in Chrome / Chromium launched with a persistent context. Use custom browser args at your own risk, as some of them may break Playwright functionality.
:::
-The snippet below retrieves the [background page](https://developer.chrome.com/extensions/background_pages) of a [Manifest v2](https://developer.chrome.com/docs/extensions/mv2/) extension whose source is located in `./my-extension`.
+The snippet below retrieves the [service worker](https://developer.chrome.com/docs/extensions/develop/concepts/service-workers) of a [Manifest v3](https://developer.chrome.com/docs/extensions/develop/migrate) extension whose source is located in `./my-extension`.
Note the use of the `chromium` channel that allows to run extensions in headless mode. Alternatively, you can launch the browser in headed mode.
@@ -30,11 +30,11 @@ const { chromium } = require('playwright');
`--load-extension=${pathToExtension}`
]
});
- let [backgroundPage] = browserContext.backgroundPages();
- if (!backgroundPage)
- backgroundPage = await browserContext.waitForEvent('backgroundpage');
+ let [serviceWorker] = browserContext.serviceWorkers();
+ if (!serviceWorker)
+ serviceWorker = await browserContext.waitForEvent('serviceworker');
- // Test the background page as you would any other page.
+ // Test the service worker as you would any other worker.
await browserContext.close();
})();
```
@@ -68,19 +68,12 @@ export const test = base.extend<{
await context.close();
},
extensionId: async ({ context }, use) => {
- /*
- // for manifest v2:
- let [background] = context.backgroundPages()
- if (!background)
- background = await context.waitForEvent('backgroundpage')
- */
-
// for manifest v3:
- let [background] = context.serviceWorkers();
- if (!background)
- background = await context.waitForEvent('serviceworker');
+ let [serviceWorker] = context.serviceWorkers();
+ if (!serviceWorker)
+ serviceWorker = await context.waitForEvent('serviceworker');
- const extensionId = background.url().split('/')[2];
+ const extensionId = serviceWorker.url().split('/')[2];
await use(extensionId);
},
});
diff --git a/nodejs/versioned_docs/version-stable/ci.mdx b/nodejs/versioned_docs/version-stable/ci.mdx
index 26d3451b650..d42de5d8db3 100644
--- a/nodejs/versioned_docs/version-stable/ci.mdx
+++ b/nodejs/versioned_docs/version-stable/ci.mdx
@@ -101,7 +101,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
- image: mcr.microsoft.com/playwright:v1.53.0-noble
+ image: mcr.microsoft.com/playwright:v1.53.2-noble
options: --user 1001
steps:
- uses: actions/checkout@v4
@@ -335,7 +335,7 @@ trigger:
pool:
vmImage: ubuntu-latest
-container: mcr.microsoft.com/playwright:v1.53.0-noble
+container: mcr.microsoft.com/playwright:v1.53.2-noble
steps:
- task: NodeTool@0
@@ -359,7 +359,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-noble-development:
docker:
- - image: mcr.microsoft.com/playwright:v1.53.0-noble
+ - image: mcr.microsoft.com/playwright:v1.53.2-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.
@@ -382,7 +382,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](
```groovy
pipeline {
- agent { docker { image 'mcr.microsoft.com/playwright:v1.53.0-noble' } }
+ agent { docker { image 'mcr.microsoft.com/playwright:v1.53.2-noble' } }
stages {
stage('e2e-tests') {
steps {
@@ -399,7 +399,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.53.0-noble
+image: mcr.microsoft.com/playwright:v1.53.2-noble
```
### GitLab CI
@@ -412,7 +412,7 @@ stages:
tests:
stage: test
- image: mcr.microsoft.com/playwright:v1.53.0-noble
+ image: mcr.microsoft.com/playwright:v1.53.2-noble
script:
...
```
@@ -427,7 +427,7 @@ stages:
tests:
stage: test
- image: mcr.microsoft.com/playwright:v1.53.0-noble
+ image: mcr.microsoft.com/playwright:v1.53.2-noble
parallel: 7
script:
- npm ci
@@ -442,7 +442,7 @@ stages:
tests:
stage: test
- image: mcr.microsoft.com/playwright:v1.53.0-noble
+ image: mcr.microsoft.com/playwright:v1.53.2-noble
parallel:
matrix:
- PROJECT: ['chromium', 'webkit']
@@ -458,7 +458,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see
```yml
steps:
-- name: mcr.microsoft.com/playwright:v1.53.0-noble
+- name: mcr.microsoft.com/playwright:v1.53.2-noble
script:
...
env:
@@ -476,7 +476,7 @@ type: docker
steps:
- name: test
- image: mcr.microsoft.com/playwright:v1.53.0-noble
+ image: mcr.microsoft.com/playwright:v1.53.2-noble
commands:
- npx playwright test
```
diff --git a/nodejs/versioned_docs/version-stable/codegen.mdx b/nodejs/versioned_docs/version-stable/codegen.mdx
index a219dd44e1b..f38a1d9f376 100644
--- a/nodejs/versioned_docs/version-stable/codegen.mdx
+++ b/nodejs/versioned_docs/version-stable/codegen.mdx
@@ -184,6 +184,19 @@ npx playwright codegen --load-storage=auth.json github.com/microsoft/playwright
######
+#### Use existing userDataDir
+
+Run `codegen` with `--user-data-dir` to set a fixed [user data directory](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-user-data-dir) for the browser session. If you create a custom browser user data directory, codegen will use this existing browser profile and have access to any authentication state present in that profile.
+
+:::warning
+
+[As of Chrome 136, the default user data directory cannot be accessed via automated tooling](https://developer.chrome.com/blog/remote-debugging-port), such as Playwright. You must create a separate user data directory for use in testing.
+:::
+
+```bash
+npx playwright codegen --user-data-dir=/path/to/your/browser/data/ github.com/microsoft/playwright
+```
+
## Record using custom setup
If you would like to use codegen in some non-standard setup (for example, use [browserContext.route()](/api/class-browsercontext.mdx#browser-context-route)), it is possible to call [page.pause()](/api/class-page.mdx#page-pause) that will open a separate window with codegen controls.
diff --git a/nodejs/versioned_docs/version-stable/docker.mdx b/nodejs/versioned_docs/version-stable/docker.mdx
index d2acb67802f..64b78c0f0aa 100644
--- a/nodejs/versioned_docs/version-stable/docker.mdx
+++ b/nodejs/versioned_docs/version-stable/docker.mdx
@@ -22,7 +22,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.53.0-noble
+docker pull mcr.microsoft.com/playwright:v1.53.2-noble
```
### Run the image
@@ -34,7 +34,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.53.0-noble /bin/bash
+docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.53.2-noble /bin/bash
```
#### Crawling and scraping
@@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.53.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.53.0-noble /bin/bash
+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.53.2-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:
@@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the
Start the Playwright Server in Docker:
```bash
-docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
+docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.2-noble /bin/sh -c "npx -y playwright@1.53.2 run-server --port 3000 --host 0.0.0.0"
```
#### Connecting to the Server
@@ -105,7 +105,7 @@ const browser = await playwright['chromium'].connect('ws://127.0.0.1:3000/');
If you need to access local servers from within the Docker container:
```bash
-docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
+docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.2-noble /bin/sh -c "npx -y playwright@1.53.2 run-server --port 3000 --host 0.0.0.0"
```
This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers.
@@ -120,9 +120,9 @@ When running tests remotely, ensure the Playwright version in your tests matches
See [all available image tags].
We currently publish images with the following tags:
-- `:v1.53.0` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.53.0-noble` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.53.0-jammy` - Playwright v1.53.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
+- `:v1.53.2` - Playwright v1.53.2 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.2-noble` - Playwright v1.53.2 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.2-jammy` - Playwright v1.53.2 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
:::note
@@ -146,7 +146,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers]
```Dockerfile
FROM node:20-bookworm
-RUN npx -y playwright@1.53.0 install --with-deps
+RUN npx -y playwright@1.53.2 install --with-deps
```
diff --git a/nodejs/versioned_docs/version-stable/intro.mdx b/nodejs/versioned_docs/version-stable/intro.mdx
index 8f5ce8463a4..de310012e32 100644
--- a/nodejs/versioned_docs/version-stable/intro.mdx
+++ b/nodejs/versioned_docs/version-stable/intro.mdx
@@ -18,7 +18,11 @@ Playwright Test was created specifically to accommodate the needs of end-to-end
## Installing Playwright
-Get started by installing Playwright using npm, yarn or pnpm. Alternatively you can also get started and run your tests using the [VS Code Extension](./getting-started-vscode.mdx).
+Get started by installing Playwright using one of the following methods.
+
+### Using npm, yarn or pnpm
+
+The command below either initializes a new project with Playwright, or adds Playwright setup to your current project.
@@ -50,10 +54,14 @@ pnpm create playwright
Run the install command and select the following to get started:
- Choose between TypeScript or JavaScript (default is TypeScript)
-- Name of your Tests folder (default is tests or e2e if you already have a tests folder in your project)
+- Name of your Tests folder (default is `tests`, or `e2e` if you already have a `tests` folder in your project)
- Add a GitHub Actions workflow to easily run tests on CI
- Install Playwright browsers (default is true)
+### Using the VS Code Extension
+
+Alternatively you can also get started and run your tests using the [VS Code Extension](./getting-started-vscode.mdx).
+
## What's Installed
Playwright will download the browsers needed as well as create the following files.
@@ -245,7 +253,7 @@ pnpm exec playwright --version
## System requirements
-- Latest version of Node.js 18, 20 or 22.
+- Latest version of Node.js 20, 22 or 24.
- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).
- macOS 14 Ventura, or later.
- Debian 12, Ubuntu 22.04, Ubuntu 24.04, on x86-64 and arm64 architecture.
diff --git a/nodejs/versioned_docs/version-stable/release-notes.mdx b/nodejs/versioned_docs/version-stable/release-notes.mdx
index e77d3dd41c3..63de29ef9e6 100644
--- a/nodejs/versioned_docs/version-stable/release-notes.mdx
+++ b/nodejs/versioned_docs/version-stable/release-notes.mdx
@@ -9,10 +9,49 @@ import HTMLCard from '@site/src/components/HTMLCard';
import LiteYouTube from '@site/src/components/LiteYouTube';
+## Version 1.54
+
+### Highlights
+- New cookie property `partitionKey` in [browserContext.cookies()](/api/class-browsercontext.mdx#browser-context-cookies) and [browserContext.addCookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). This property allows to save and restore partitioned cookies. See [CHIPS MDN article](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) for more information. Note that browsers have different support and defaults for cookie partitioning.
+- New option `noSnippets` to disable code snippets in the html report.
+
+ ```js
+ import { defineConfig } from '@playwright/test';
+
+ export default defineConfig({
+ reporter: [['html', { noSnippets: true }]]
+ });
+ ```
+
+- New property `location` in test annotations, for example in [testResult.annotations](/api/class-testresult.mdx#test-result-annotations) and [testInfo.annotations](/api/class-testinfo.mdx#test-info-annotations). It shows where the annotation like `test.skip` or `test.fixme` was added.
+
+### Command Line
+- New option `--user-data-dir` in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
+
+ ```bash
+ npx playwright codegen --user-data-dir=./user-data
+ ```
+
+- Option `-gv` has been removed from the `npx playwright test` command. Use `--grep-invert` instead.
+- `npx playwright open` does not open the test recorder anymore. Use `npx playwright codegen` instead.
+
+### Miscellaneous
+- Support for Node.js 16 has been removed.
+- Support for Node.js 18 has been deprecated, and will be removed in the future.
+
+### Browser Versions
+- Chromium 139.0.7258.5
+- Mozilla Firefox 140.0.2
+- WebKit 26.0
+
+This version was also tested against the following stable channels:
+- Google Chrome 140
+- Microsoft Edge 140
+
## Version 1.53
### Trace Viewer and HTML Reporter Updates
-- New Steps in Trace Viewer and HTML reporter: 
+- New Steps in Trace Viewer and HTML reporter: 
- New option in `'html'` reporter to set the title of a specific test run:
```js
diff --git a/nodejs/versioned_docs/version-stable/test-reporters.mdx b/nodejs/versioned_docs/version-stable/test-reporters.mdx
index 18008654dd4..fbf782ca202 100644
--- a/nodejs/versioned_docs/version-stable/test-reporters.mdx
+++ b/nodejs/versioned_docs/version-stable/test-reporters.mdx
@@ -105,7 +105,7 @@ List report supports the following configuration options and environment variabl
| Environment Variable Name | Reporter Config Option| Description | Default
|---|---|---|---|
| `PLAYWRIGHT_LIST_PRINT_STEPS` | `printSteps` | Whether to print each step on its own line. | `false`
-| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. If a number is specified, it will also be used as the terminal width. | `true` when terminal is in TTY mode, `false` otherwise.
+| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise.
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise.
### Line reporter
@@ -143,7 +143,7 @@ Line report supports the following configuration options and environment variabl
| Environment Variable Name | Reporter Config Option| Description | Default
|---|---|---|---|
-| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. If a number is specified, it will also be used as the terminal width. | `true` when terminal is in TTY mode, `false` otherwise.
+| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise.
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise.
### Dot reporter
@@ -185,7 +185,7 @@ Dot report supports the following configuration options and environment variable
| Environment Variable Name | Reporter Config Option| Description | Default
|---|---|---|---|
-| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. If a number is specified, it will also be used as the terminal width. | `true` when terminal is in TTY mode, `false` otherwise.
+| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise.
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise.
### HTML reporter
@@ -252,6 +252,7 @@ HTML report supports the following configuration options and environment variabl
| `PLAYWRIGHT_HTML_HOST` | `host` | When report opens in the browser, it will be served bound to this hostname. | `localhost`
| `PLAYWRIGHT_HTML_PORT` | `port` | When report opens in the browser, it will be served on this port. | `9323` or any available port when `9323` is not available.
| `PLAYWRIGHT_HTML_ATTACHMENTS_BASE_URL` | `attachmentsBaseURL` | A separate location where attachments from the `data` subdirectory are uploaded. Only needed when you upload report and `data` separately to different locations. | `data/`
+| `PLAYWRIGHT_HTML_NO_SNIPPETS` | `noSnippets` | If true, disable rendering code snippets in the action log. If there is a top level error, that report section with code snippet will still render. Supports `true`, `1`, `false`, and `0`. | `false`
### Blob reporter
diff --git a/nodejs/versioned_docs/version-stable/test-snapshots.mdx b/nodejs/versioned_docs/version-stable/test-snapshots.mdx
index 8ae67f7bd44..1fbe962cc2c 100644
--- a/nodejs/versioned_docs/version-stable/test-snapshots.mdx
+++ b/nodejs/versioned_docs/version-stable/test-snapshots.mdx
@@ -53,6 +53,9 @@ The snapshot name `example-test-1-chromium-darwin.png` consists of a few parts:
The snapshot name and path can be configured with [testConfig.snapshotPathTemplate](/api/class-testconfig.mdx#test-config-snapshot-path-template) in the playwright config.
+> Note that `toHaveScreenshot()` also accepts an array of path segments to the snapshot file such as `expect().toHaveScreenshot(['relative', 'path', 'to', 'snapshot.png'])`.
+> However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`), otherwise it will throw.
+
## Updating screenshots
Sometimes you need to update the reference screenshot, for example when the page has changed. Do this with the `--update-snapshots` flag.
@@ -61,9 +64,6 @@ Sometimes you need to update the reference screenshot, for example when the page
npx playwright test --update-snapshots
```
-> Note that `snapshotName` also accepts an array of path segments to the snapshot file such as `expect().toHaveScreenshot(['relative', 'path', 'to', 'snapshot.png'])`.
-> However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`), otherwise it will throw.
-
## Options
### maxDiffPixels
diff --git a/python/versioned_docs/version-stable/api/class-browsercontext.mdx b/python/versioned_docs/version-stable/api/class-browsercontext.mdx
index 8c40ed071b0..6d3d5e37dcd 100644
--- a/python/versioned_docs/version-stable/api/class-browsercontext.mdx
+++ b/python/versioned_docs/version-stable/api/class-browsercontext.mdx
@@ -115,6 +115,9 @@ await browser_context.add_cookies([cookie_object1, cookie_object2])
- `sameSite` "Strict" | "Lax" | "None" *(optional)*
Optional.
+ - `partitionKey` [str] *(optional)*
+
+ For partitioned third-party cookies (aka [CHIPS](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies)), the partition key. Optional.
**Returns**
- [NoneType]#
@@ -355,6 +358,9 @@ browser_context.cookies(**kwargs)
- `sameSite` "Strict" | "Lax" | "None"
+ - `partitionKey` [str] *(optional)*
+
+
---
### expect_console_message {#browser-context-wait-for-console-message}
@@ -710,6 +716,7 @@ browser_context.grant_permissions(permissions, **kwargs)
* `'notifications'`
* `'payment-handler'`
* `'storage-access'`
+ * `'local-fonts'`
- `origin` [str] *(optional)*#
The [origin] to grant permissions to, e.g. "https://example.com".
@@ -1350,7 +1357,7 @@ browser_context.background_pages
Added before v1.9browserContext.browser
-Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
+Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron.
**Usage**
diff --git a/python/versioned_docs/version-stable/api/class-consolemessage.mdx b/python/versioned_docs/version-stable/api/class-consolemessage.mdx
index 1778e667082..c59988a3847 100644
--- a/python/versioned_docs/version-stable/api/class-consolemessage.mdx
+++ b/python/versioned_docs/version-stable/api/class-consolemessage.mdx
@@ -145,8 +145,6 @@ console_message.text
Added before v1.9consoleMessage.type
-One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`, `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`, `'count'`, `'timeEnd'`.
-
**Usage**
```python
@@ -154,7 +152,7 @@ console_message.type
```
**Returns**
-- [str]#
+- "log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd"#
[Accessibility]: /api/class-accessibility.mdx "Accessibility"
diff --git a/python/versioned_docs/version-stable/api/class-mouse.mdx b/python/versioned_docs/version-stable/api/class-mouse.mdx
index 13f0de0283c..48a001261bd 100644
--- a/python/versioned_docs/version-stable/api/class-mouse.mdx
+++ b/python/versioned_docs/version-stable/api/class-mouse.mdx
@@ -9,6 +9,11 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
+:::tip
+
+If you want to debug where the mouse moved, you can use the [Trace viewer](../trace-viewer-intro.mdx) or [Playwright Inspector](../running-tests.mdx). A red dot showing the location of the mouse will be shown for every mouse action.
+:::
+
Every `page` object has its own Mouse, accessible with [page.mouse](/api/class-page.mdx#page-mouse).
Generator[BrowserContext, None, None]:
@pytest.fixture()
def extension_id(context) -> Generator[str, None, None]:
- # for manifest v2:
- # background = context.background_pages[0]
- # if not background:
- # background = context.wait_for_event("backgroundpage")
-
# for manifest v3:
- background = context.service_workers[0]
- if not background:
- background = context.wait_for_event("serviceworker")
+ service_worker = context.service_workers[0]
+ if not service_worker:
+ service_worker = context.wait_for_event("serviceworker")
- extension_id = background.url.split("/")[2]
+ extension_id = service_worker.url.split("/")[2]
yield extension_id
```
diff --git a/python/versioned_docs/version-stable/ci.mdx b/python/versioned_docs/version-stable/ci.mdx
index 71a1c60e053..24437ea3a4f 100644
--- a/python/versioned_docs/version-stable/ci.mdx
+++ b/python/versioned_docs/version-stable/ci.mdx
@@ -83,7 +83,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
- image: mcr.microsoft.com/playwright/python:v1.52.0-noble
+ image: mcr.microsoft.com/playwright/python:v1.53.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v4
@@ -173,7 +173,7 @@ trigger:
pool:
vmImage: ubuntu-latest
-container: mcr.microsoft.com/playwright/python:v1.52.0-noble
+container: mcr.microsoft.com/playwright/python:v1.53.0-noble
steps:
- task: UsePythonVersion@0
@@ -197,7 +197,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-noble-development:
docker:
- - image: mcr.microsoft.com/playwright/python:v1.52.0-noble
+ - image: mcr.microsoft.com/playwright/python:v1.53.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.
@@ -208,7 +208,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](
```groovy
pipeline {
- agent { docker { image 'mcr.microsoft.com/playwright/python:v1.52.0-noble' } }
+ agent { docker { image 'mcr.microsoft.com/playwright/python:v1.53.0-noble' } }
stages {
stage('e2e-tests') {
steps {
@@ -225,7 +225,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/python:v1.52.0-noble
+image: mcr.microsoft.com/playwright/python:v1.53.0-noble
```
### GitLab CI
@@ -238,7 +238,7 @@ stages:
tests:
stage: test
- image: mcr.microsoft.com/playwright/python:v1.52.0-noble
+ image: mcr.microsoft.com/playwright/python:v1.53.0-noble
script:
...
```
diff --git a/python/versioned_docs/version-stable/clock.mdx b/python/versioned_docs/version-stable/clock.mdx
index b55fa036429..987d7f07e59 100644
--- a/python/versioned_docs/version-stable/clock.mdx
+++ b/python/versioned_docs/version-stable/clock.mdx
@@ -58,6 +58,41 @@ Often you only need to fake `Date.now` while keeping the timers going. That way
```
+
+
+
+```py
+page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 0, 0))
+page.goto("http://localhost:3333")
+expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM")
+page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 30, 0))
+# We know that the page has a timer that updates the time every second.
+expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM")
+```
+
+
+
+
+```py
+await page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 0, 0))
+await page.goto("http://localhost:3333")
+await expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM")
+
+await page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 30, 0))
+# We know that the page has a timer that updates the time every second.
+await expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM")
+```
+
+
+
+
## Consistent time and timers
Sometimes your timers depend on `Date.now` and are confused when the `Date.now` value does not change over time. In this case, you can install the clock and fast forward to the time of interest when testing.
diff --git a/python/versioned_docs/version-stable/codegen.mdx b/python/versioned_docs/version-stable/codegen.mdx
index 29461b9770d..991da16486e 100644
--- a/python/versioned_docs/version-stable/codegen.mdx
+++ b/python/versioned_docs/version-stable/codegen.mdx
@@ -134,6 +134,19 @@ playwright codegen --load-storage=auth.json github.com/microsoft/playwright
######
+#### Use existing userDataDir
+
+Run `codegen` with `--user-data-dir` to set a fixed [user data directory](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-user-data-dir) for the browser session. If you create a custom browser user data directory, codegen will use this existing browser profile and have access to any authentication state present in that profile.
+
+:::warning
+
+[As of Chrome 136, the default user data directory cannot be accessed via automated tooling](https://developer.chrome.com/blog/remote-debugging-port), such as Playwright. You must create a separate user data directory for use in testing.
+:::
+
+```bash
+playwright codegen --user-data-dir=/path/to/your/browser/data/ github.com/microsoft/playwright
+```
+
## Record using custom setup
If you would like to use codegen in some non-standard setup (for example, use [browser_context.route()](/api/class-browsercontext.mdx#browser-context-route)), it is possible to call [page.pause()](/api/class-page.mdx#page-pause) that will open a separate window with codegen controls.
diff --git a/python/versioned_docs/version-stable/docker.mdx b/python/versioned_docs/version-stable/docker.mdx
index a41defe9ed6..6cf99dea661 100644
--- a/python/versioned_docs/version-stable/docker.mdx
+++ b/python/versioned_docs/version-stable/docker.mdx
@@ -22,7 +22,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/python:v1.52.0-noble
+docker pull mcr.microsoft.com/playwright/python:v1.53.0-noble
```
### Run the image
@@ -34,7 +34,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/python:v1.52.0-noble /bin/bash
+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.53.0-noble /bin/bash
```
#### Crawling and scraping
@@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.52.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/python:v1.52.0-noble /bin/bash
+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v1.53.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:
@@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the
Start the Playwright Server in Docker:
```bash
-docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.52.0-noble /bin/sh -c "npx -y playwright@1.52.0 run-server --port 3000 --host 0.0.0.0"
+docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
```
#### Connecting to the Server
@@ -122,7 +122,7 @@ async with async_playwright() as p:
If you need to access local servers from within the Docker container:
```bash
-docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.52.0-noble /bin/sh -c "npx -y playwright@1.52.0 run-server --port 3000 --host 0.0.0.0"
+docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.53.0-noble /bin/sh -c "npx -y playwright@1.53.0 run-server --port 3000 --host 0.0.0.0"
```
This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers.
@@ -137,9 +137,9 @@ When running tests remotely, ensure the Playwright version in your tests matches
See [all available image tags].
We currently publish images with the following tags:
-- `:v1.52.0` - Playwright v1.52.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.52.0-noble` - Playwright v1.52.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
-- `:v1.52.0-jammy` - Playwright v1.52.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
+- `:v1.53.0` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.0-noble` - Playwright v1.53.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
+- `:v1.53.0-jammy` - Playwright v1.53.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
:::note
@@ -163,7 +163,7 @@ To run Playwright inside Docker, you need to have Python, [Playwright browsers](
```Dockerfile
FROM python:3.12-bookworm
-RUN pip install playwright==@1.52.0 && \
+RUN pip install playwright==@1.53.0 && \
playwright install --with-deps
```
diff --git a/python/versioned_docs/version-stable/release-notes.mdx b/python/versioned_docs/version-stable/release-notes.mdx
index 49b8f189f94..0cc6bc57f48 100644
--- a/python/versioned_docs/version-stable/release-notes.mdx
+++ b/python/versioned_docs/version-stable/release-notes.mdx
@@ -7,10 +7,29 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
+## Version 1.54
+- New cookie property `partition_key` in [browser_context.cookies()](/api/class-browsercontext.mdx#browser-context-cookies) and [browser_context.add_cookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). This property allows to save and restore partitioned cookies. See [CHIPS MDN article](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) for more information. Note that browsers have different support and defaults for cookie partitioning.
+- New option `--user-data-dir` in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
+
+ ```bash
+ playwright codegen --user-data-dir=./user-data
+ ```
+
+- `playwright open` does not open the test recorder anymore. Use `playwright codegen` instead.
+
+### Browser Versions
+- Chromium 139.0.7258.5
+- Mozilla Firefox 140.0.2
+- WebKit 26.0
+
+This version was also tested against the following stable channels:
+- Google Chrome 140
+- Microsoft Edge 140
+
## Version 1.53
### Miscellaneous
-- New Steps in Trace Viewer: 
+- New Steps in Trace Viewer: 
- New method [locator.describe()](/api/class-locator.mdx#locator-describe) to describe a locator. Used for trace viewer.
```python