From d6c699d8f88164c7189c206246dd45bac733882b Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:09:39 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (07-10-25) --- dotnet/docs/api/class-browsercontext.mdx | 6 +-- java/docs/api/class-browsercontext.mdx | 6 +-- nodejs/docs/api/class-browsercontext.mdx | 6 +-- nodejs/docs/ci.mdx | 20 +++++----- nodejs/docs/docker.mdx | 18 ++++----- nodejs/docs/release-notes.mdx | 48 ++++++++++++++++++++++++ nodejs/docs/test-agents.mdx | 6 +++ python/docs/api/class-browsercontext.mdx | 6 +-- 8 files changed, 85 insertions(+), 31 deletions(-) diff --git a/dotnet/docs/api/class-browsercontext.mdx b/dotnet/docs/api/class-browsercontext.mdx index 7ccec4d86a9..0faf1af283e 100644 --- a/dotnet/docs/api/class-browsercontext.mdx +++ b/dotnet/docs/api/class-browsercontext.mdx @@ -52,13 +52,13 @@ await context.AddCookiesAsync(new[] { cookie1, cookie2 }); - `Url` [string]? *(optional)* - Either url or domain / path are required. Optional. + Either `url` or both `domain` and `path` are required. Optional. - `Domain` [string]? *(optional)* - For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url or domain / path are required. Optional. + For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either `url` or both `domain` and `path` are required. Optional. - `Path` [string]? *(optional)* - Either url or domain / path are required Optional. + Either `url` or both `domain` and `path` are required. Optional. - `Expires` [float]? *(optional)* Unix time in seconds. Optional. diff --git a/java/docs/api/class-browsercontext.mdx b/java/docs/api/class-browsercontext.mdx index 045c98910a7..d17d3618bd5 100644 --- a/java/docs/api/class-browsercontext.mdx +++ b/java/docs/api/class-browsercontext.mdx @@ -50,13 +50,13 @@ browserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2)); - `setUrl` [String] *(optional)* - Either url or domain / path are required. Optional. + Either `url` or both `domain` and `path` are required. Optional. - `setDomain` [String] *(optional)* - For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url or domain / path are required. Optional. + For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either `url` or both `domain` and `path` are required. Optional. - `setPath` [String] *(optional)* - Either url or domain / path are required Optional. + Either `url` or both `domain` and `path` are required. Optional. - `setExpires` [double] *(optional)* Unix time in seconds. Optional. diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx index 6648940785c..854be481734 100644 --- a/nodejs/docs/api/class-browsercontext.mdx +++ b/nodejs/docs/api/class-browsercontext.mdx @@ -50,13 +50,13 @@ await browserContext.addCookies([cookieObject1, cookieObject2]); - `url` [string] *(optional)* - Either url or domain / path are required. Optional. + Either `url` or both `domain` and `path` are required. Optional. - `domain` [string] *(optional)* - For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url or domain / path are required. Optional. + For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either `url` or both `domain` and `path` are required. Optional. - `path` [string] *(optional)* - Either url or domain / path are required Optional. + Either `url` or both `domain` and `path` are required. Optional. - `expires` [number] *(optional)* Unix time in seconds. Optional. diff --git a/nodejs/docs/ci.mdx b/nodejs/docs/ci.mdx index e2c78dca996..7681bf665e1 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.55.1-noble + image: mcr.microsoft.com/playwright:v1.56.0-noble options: --user 1001 steps: - uses: actions/checkout@v5 @@ -335,7 +335,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright:v1.55.1-noble +container: mcr.microsoft.com/playwright:v1.56.0-noble steps: - task: UseNode@1 @@ -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.55.1-noble + - image: mcr.microsoft.com/playwright:v1.56.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. @@ -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.55.1-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright:v1.56.0-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.55.1-noble +image: mcr.microsoft.com/playwright:v1.56.0-noble ``` ### GitLab CI @@ -412,7 +412,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.55.1-noble + image: mcr.microsoft.com/playwright:v1.56.0-noble script: ... ``` @@ -427,7 +427,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.55.1-noble + image: mcr.microsoft.com/playwright:v1.56.0-noble parallel: 7 script: - npm ci @@ -442,7 +442,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.55.1-noble + image: mcr.microsoft.com/playwright:v1.56.0-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.55.1-noble +- name: mcr.microsoft.com/playwright:v1.56.0-noble script: ... env: @@ -476,7 +476,7 @@ type: docker steps: - name: test - image: mcr.microsoft.com/playwright:v1.55.1-noble + image: mcr.microsoft.com/playwright:v1.56.0-noble commands: - npx playwright test ``` diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx index 085515b6bff..a14c6470591 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/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.55.1-noble +docker pull mcr.microsoft.com/playwright:v1.56.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:v1.55.1-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.56.0-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.55.1-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.55.1-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.56.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.55.1-noble /bin/sh -c "npx -y playwright@1.55.1 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.56.0-noble /bin/sh -c "npx -y playwright@1.56.0 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.55.1-noble /bin/sh -c "npx -y playwright@1.55.1 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.56.0-noble /bin/sh -c "npx -y playwright@1.56.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. @@ -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.55.1` - Playwright v1.55.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.55.1-noble` - Playwright v1.55.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.55.1-jammy` - Playwright v1.55.1 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.56.0` - Playwright v1.56.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.56.0-noble` - Playwright v1.56.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.56.0-jammy` - Playwright v1.56.0 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.55.1 install --with-deps +RUN npx -y playwright@1.56.0 install --with-deps ``` diff --git a/nodejs/docs/release-notes.mdx b/nodejs/docs/release-notes.mdx index f567fbf7d8b..eb8caf71752 100644 --- a/nodejs/docs/release-notes.mdx +++ b/nodejs/docs/release-notes.mdx @@ -9,6 +9,54 @@ import HTMLCard from '@site/src/components/HTMLCard'; import LiteYouTube from '@site/src/components/LiteYouTube'; +## Version 1.56 + + + +### Playwright Agents + +Introducing Playwright Agents, three custom agent definitions designed to guide LLMs through the core process of building a Playwright test: +* **🎭 planner** explores the app and produces a Markdown test plan +* **🎭 generator** transforms the Markdown plan into the Playwright Test files +* **🎭 healer** executes the test suite and automatically repairs failing tests + +Run `npx playwright init-agents` with your client of choice to generate the latest agent definitions: + +```bash +# Generate agent files for each agentic loop +# Visual Studio Code +npx playwright init-agents --loop=vscode +# Claude Code +npx playwright init-agents --loop=claude +# opencode +npx playwright init-agents --loop=opencode +``` + +[Learn more about Playwright Agents](./test-agents.mdx) + +### New APIs +- New methods [page.consoleMessages()](/api/class-page.mdx#page-console-messages) and [page.pageErrors()](/api/class-page.mdx#page-page-errors) for retrieving the most recent console messages from the page +- New method [page.requests()](/api/class-page.mdx#page-requests) for retrieving the most recent network requests from the page +- Added [`--test-list` and `--test-list-invert`](./test-cli.mdx#test-list) to allow manual specification of specific tests from a file + +### UI Mode and HTML Reporter +- Added option to `'html'` reporter to disable the "Copy prompt" button +- Added option to `'html'` reporter and UI Mode to merge files, collapsing test and describe blocks into a single unified list +- Added option to UI Mode mirroring the `--update-snapshots` options +- Added option to UI Mode to run only a single worker at a time + +### Breaking Changes +- Event [browserContext.on('backgroundpage')](/api/class-browsercontext.mdx#browser-context-event-background-page) has been deprecated and will not be emitted. Method [browserContext.backgroundPages()](/api/class-browsercontext.mdx#browser-context-background-pages) will return an empty list + +### Miscellaneous +- Aria snapshots render and compare `input` `placeholder` +- Added environment variable `PLAYWRIGHT_TEST` to Playwright worker processes to allow discriminating on testing status + +### Browser Versions +- Chromium 141.0.7390.37 +- Mozilla Firefox 142.0.1 +- WebKit 26.0 + ## Version 1.55 ### New APIs diff --git a/nodejs/docs/test-agents.mdx b/nodejs/docs/test-agents.mdx index 41ab3321b18..27ac206cf7a 100644 --- a/nodejs/docs/test-agents.mdx +++ b/nodejs/docs/test-agents.mdx @@ -6,8 +6,12 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; +import LiteYouTube from '@site/src/components/LiteYouTube'; + # Playwright Agents +## Introduction + Playwright comes with three Playwright Agents out of the box: **🎭 planner**, **🎭 generator** and **🎭 healer**. These agents can be used independently, sequentially, or as the chained calls in the agentic loop. Using them sequentially will produce test coverage for your product. @@ -15,6 +19,8 @@ These agents can be used independently, sequentially, or as the chained calls in * **🎭 generator** transforms the Markdown plan into the Playwright Test files * **🎭 healer** executes the test suite and automatically repairs failing tests + + ### Getting Started Start with adding Playwright Agent definitions to your project using the `init-agents` command. These definitions should be regenerated whenever Playwright is updated to pick up new tools and instructions. diff --git a/python/docs/api/class-browsercontext.mdx b/python/docs/api/class-browsercontext.mdx index c7f89830b84..864e6adcbf1 100644 --- a/python/docs/api/class-browsercontext.mdx +++ b/python/docs/api/class-browsercontext.mdx @@ -96,13 +96,13 @@ await browser_context.add_cookies([cookie_object1, cookie_object2]) - `url` [str] *(optional)* - Either url or domain / path are required. Optional. + Either `url` or both `domain` and `path` are required. Optional. - `domain` [str] *(optional)* - For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url or domain / path are required. Optional. + For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either `url` or both `domain` and `path` are required. Optional. - `path` [str] *(optional)* - Either url or domain / path are required Optional. + Either `url` or both `domain` and `path` are required. Optional. - `expires` [float] *(optional)* Unix time in seconds. Optional.