From 38d6c56cd1058f5bb9e06388dd910b4898a3c9d0 Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 10:11:14 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (09-12-25) --- dotnet/docs/docker.mdx | 18 +++++++ java/docs/clock.mdx | 6 +-- java/docs/docker.mdx | 18 +++++++ java/docs/input.mdx | 4 +- java/docs/locators.mdx | 2 +- nodejs/docs/api/class-browser.mdx | 18 +++++++ nodejs/docs/api/class-page.mdx | 59 +++++++++++++++++++++++ nodejs/docs/api/class-testoptions.mdx | 32 ++++++++++++ nodejs/docs/docker.mdx | 18 +++++++ nodejs/docs/test-ui-mode.mdx | 2 +- python/docs/ci.mdx | 12 ++--- python/docs/docker.mdx | 36 ++++++++++---- src/components/GitHubStarButton/index.tsx | 2 +- 13 files changed, 204 insertions(+), 23 deletions(-) diff --git a/dotnet/docs/docker.mdx b/dotnet/docs/docker.mdx index 90dd50511aa..02f19899527 100644 --- a/dotnet/docs/docker.mdx +++ b/dotnet/docs/docker.mdx @@ -109,6 +109,24 @@ This makes `hostmachine` point to the host's localhost. Your tests should use `h When running tests remotely, ensure the Playwright version in your tests matches the version running in the Docker container. ::: +### Connecting using noVNC and GitHub Codespaces + +For Docker and GitHub Codespaces environments, you can view and generate tests using the `noVNC` viewer built into the Docker image. In order for the VNC webviewer to be accessible outside of the container, you can enable the `desktop-lite` feature and specify the `webPort` in your `.devcontainer/devcontainer.json` file: + +```json +{ + "image": "mcr.microsoft.com/playwright:v1.57.0", + "forwardPorts": [6080], + "features": { + "desktop-lite": { + "webPort": "6080" + } + } +} +``` + +Once this is enabled you can open the port specified in a new browser tab and you will have access to the `noVNC` web viewer. This will enable you to record tests, pick selectors, and use codegen directly on your container. + ## Image tags See [all available image tags]. diff --git a/java/docs/clock.mdx b/java/docs/clock.mdx index 64655dd6fb1..2d390c25ccd 100644 --- a/java/docs/clock.mdx +++ b/java/docs/clock.mdx @@ -59,7 +59,7 @@ 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"); +SimpleDateFormat format = new SimpleDateFormat("yyyy-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"); @@ -87,7 +87,7 @@ Sometimes your timers depend on `Date.now` and are confused when the `Date.now` ```java // Initialize clock with some time before the test time and let the page load // naturally. `Date.now` will progress as the timers fire. -SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss"); +SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-02-02T08:00:00"))); page.navigate("http://localhost:3333"); Locator locator = page.getByTestId("current-time"); @@ -162,7 +162,7 @@ In rare cases, you may want to tick through time manually, firing all timers and ``` ```java -SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss"); +SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); // Initialize clock with a specific time, let the page load naturally. page.clock().install(new Clock.InstallOptions() .setTime(format.parse("2024-02-02T08:00:00"))); diff --git a/java/docs/docker.mdx b/java/docs/docker.mdx index 8319cb65c48..7473b189fb8 100644 --- a/java/docs/docker.mdx +++ b/java/docs/docker.mdx @@ -117,6 +117,24 @@ This makes `hostmachine` point to the host's localhost. Your tests should use `h When running tests remotely, ensure the Playwright version in your tests matches the version running in the Docker container. ::: +### Connecting using noVNC and GitHub Codespaces + +For Docker and GitHub Codespaces environments, you can view and generate tests using the `noVNC` viewer built into the Docker image. In order for the VNC webviewer to be accessible outside of the container, you can enable the `desktop-lite` feature and specify the `webPort` in your `.devcontainer/devcontainer.json` file: + +```json +{ + "image": "mcr.microsoft.com/playwright:v1.57.0", + "forwardPorts": [6080], + "features": { + "desktop-lite": { + "webPort": "6080" + } + } +} +``` + +Once this is enabled you can open the port specified in a new browser tab and you will have access to the `noVNC` web viewer. This will enable you to record tests, pick selectors, and use codegen directly on your container. + ## Image tags See [all available image tags]. diff --git a/java/docs/input.mdx b/java/docs/input.mdx index 1527d1df3db..7d8c57d7a96 100644 --- a/java/docs/input.mdx +++ b/java/docs/input.mdx @@ -22,7 +22,7 @@ page.getByRole(AriaRole.TEXTBOX).fill("Peter"); page.getByLabel("Birth date").fill("2020-02-02"); // Time input -page.getByLabel("Appointment time").fill("13-15"); +page.getByLabel("Appointment time").fill("13:15"); // Local datetime input page.getByLabel("Local time").fill("2020-03-02T05:15"); @@ -37,7 +37,7 @@ Using [Locator.setChecked()](/api/class-locator.mdx#locator-set-checked) is the page.getByLabel("I agree to the terms above").check(); // Assert the checked state -assertTrue(page.getByLabel("Subscribe to newsletter")).isChecked(); +assertThat(page.getByLabel("Subscribe to newsletter")).isChecked(); // Select the radio button page.getByLabel("XL").check(); diff --git a/java/docs/locators.mdx b/java/docs/locators.mdx index 0dee6602a99..6498c57b0af 100644 --- a/java/docs/locators.mdx +++ b/java/docs/locators.mdx @@ -878,7 +878,7 @@ rowLocator .setHas(page.getByRole( AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Say goodbye")))) - .screenshot(new Page.ScreenshotOptions().setPath("screenshot.png")); + .screenshot(new Locator.ScreenshotOptions().setPath(Paths.get("screenshot.png"))); ``` You should now have a "screenshot.png" file in your project's root directory. diff --git a/nodejs/docs/api/class-browser.mdx b/nodejs/docs/api/class-browser.mdx index e3208aad8de..0ebd3e090c1 100644 --- a/nodejs/docs/api/class-browser.mdx +++ b/nodejs/docs/api/class-browser.mdx @@ -168,6 +168,24 @@ If directly using this method to create [BrowserContext]s, it is best practice t - `acceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `agent` [Object] *(optional)* Added in: v1.58# + - `provider` [string] + + LLM provider to use. + - `model` [string] + + Model identifier within provider. + - `cacheFile` [string] *(optional)* + + Cache file to use/generate code for performed actions into. Cache is not used if not specified (default). + - `cacheMode` ['force'] | ['ignore'] | ['auto'] *(optional)* + + Cache control, defaults to 'auto'. + - `secrets` [Object]<[string], [string]> *(optional)* + + Secrets to hide from the LLM. + + Agent settings for [page.perform()](/api/class-page.mdx#page-perform) and [page.extract()](/api/class-page.mdx#page-extract). - `baseURL` [string] *(optional)*# When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.waitForURL()](/api/class-page.mdx#page-wait-for-url), [page.waitForRequest()](/api/class-page.mdx#page-wait-for-request), or [page.waitForResponse()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples: diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx index 2d070378d07..5abd0e24f37 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -701,6 +701,36 @@ const crypto = require('crypto'); --- +### extract {#page-extract} + +Added in: v1.58page.extract + +Extract information from the page using the agentic loop, return it in a given Zod format. + +**Usage** + +```js +await page.extract('List of items in the cart', z.object({ + title: z.string().describe('Item title to extract'), + price: z.string().describe('Item price to extract'), +}).array()); +``` + +**Arguments** +- `query` [string]# + + Task to perform using agentic loop. +- `schema` [z.ZodSchema]# +- `options` [Object] *(optional)* + - `maxTurns` [number] *(optional)*# + + Maximum number of agentic steps to take while extracting the information. + +**Returns** +- [Promise]<[Object]># + +--- + ### frame {#page-frame} Added before v1.9page.frame @@ -1485,6 +1515,35 @@ The [format](/api/class-page.mdx#page-pdf-option-format) options are: --- +### perform {#page-perform} + +Added in: v1.58page.perform + +Perform action using agentic loop. + +**Usage** + +```js +await page.perform('Click submit button'); +``` + +**Arguments** +- `task` [string]# + + Task to perform using agentic loop. +- `options` [Object] *(optional)* + - `key` [string] *(optional)*# + + All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally with the `task` as a key. This option allows controlling the cache key explicitly. + - `maxTurns` [number] *(optional)*# + + Maximum number of agentic steps to take while performing this action. + +**Returns** +- [Promise]<[void]># + +--- + ### reload {#page-reload} Added before v1.9page.reload diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx index 6e108dd1698..336191c2f8b 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -92,6 +92,38 @@ Learn more about [various timeouts](../test-timeouts.mdx). --- +### agent {#test-options-agent} + +Added in: v1.58testOptions.agent + +Agent settings for [page.perform()](/api/class-page.mdx#page-perform) and [page.extract()](/api/class-page.mdx#page-extract). + +**Usage** + +```js +testOptions.agent +``` + +**Type** +- [Object] + - `provider` [string] + + LLM provider to use. + - `model` [string] + + Model identifier within provider. + - `cacheFile` [string] *(optional)* + + Cache file to use/generate code for performed actions into. Cache is not used if not specified (default). + - `cacheMode` ['force'] | ['ignore'] | ['auto'] *(optional)* + + Cache control, defaults to 'auto'. + - `secrets` [Object]<[string], [string]> *(optional)* + + Secrets to hide from the LLM. + +--- + ### baseURL {#test-options-base-url} Added in: v1.10testOptions.baseURL diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx index 8407f593416..1fdd5d71370 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/docker.mdx @@ -115,6 +115,24 @@ This makes `hostmachine` point to the host's localhost. Your tests should use `h When running tests remotely, ensure the Playwright version in your tests matches the version running in the Docker container. ::: +### Connecting using noVNC and GitHub Codespaces + +For Docker and GitHub Codespaces environments, you can view and generate tests using the `noVNC` viewer built into the Docker image. In order for the VNC webviewer to be accessible outside of the container, you can enable the `desktop-lite` feature and specify the `webPort` in your `.devcontainer/devcontainer.json` file: + +```json +{ + "image": "mcr.microsoft.com/playwright:v1.57.0", + "forwardPorts": [6080], + "features": { + "desktop-lite": { + "webPort": "6080" + } + } +} +``` + +Once this is enabled you can open the port specified in a new browser tab and you will have access to the `noVNC` web viewer. This will enable you to record tests, pick selectors, and use codegen directly on your container. + ## Image tags See [all available image tags]. diff --git a/nodejs/docs/test-ui-mode.mdx b/nodejs/docs/test-ui-mode.mdx index 2cc40063118..5c80d026ef1 100644 --- a/nodejs/docs/test-ui-mode.mdx +++ b/nodejs/docs/test-ui-mode.mdx @@ -127,7 +127,7 @@ npx playwright test --ui-port=8080 --ui-host=0.0.0.0 ``` :::note -Be aware that when specifying the `--ui-host=0.0.0.0` flag, UI Mode with your traces, the passwords and secrets is accessible from other machines inside your network. In the case of GitHub Codespaces, the ports are only accessible from your account by default. +Be aware that when specifying the `--ui-host=0.0.0.0` flag, UI Mode with your traces, the passwords and secrets are accessible from other machines inside your network. In the case of GitHub Codespaces, the ports are only accessible from your account by default. ::: diff --git a/python/docs/ci.mdx b/python/docs/ci.mdx index 398dcc9b3ac..ef8ac086264 100644 --- a/python/docs/ci.mdx +++ b/python/docs/ci.mdx @@ -83,7 +83,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright/python:v1.56.0-noble + image: mcr.microsoft.com/playwright/python:v1.57.0-noble options: --user 1001 steps: - uses: actions/checkout@v5 @@ -173,7 +173,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright/python:v1.56.0-noble +container: mcr.microsoft.com/playwright/python:v1.57.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.56.0-noble + - image: mcr.microsoft.com/playwright/python:v1.57.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.56.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright/python:v1.57.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.56.0-noble +image: mcr.microsoft.com/playwright/python:v1.57.0-noble ``` ### GitLab CI @@ -238,7 +238,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright/python:v1.56.0-noble + image: mcr.microsoft.com/playwright/python:v1.57.0-noble script: ... ``` diff --git a/python/docs/docker.mdx b/python/docs/docker.mdx index afb776042f2..a93756b1b0a 100644 --- a/python/docs/docker.mdx +++ b/python/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/python:v1.56.0-noble +docker pull mcr.microsoft.com/playwright/python:v1.57.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.56.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.57.0-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.56.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.56.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v1.57.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.56.0-noble /bin/sh -c "npx -y playwright@1.56.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.57.0-noble /bin/sh -c "npx -y playwright@1.57.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.56.0-noble /bin/sh -c "npx -y playwright@1.56.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.57.0-noble /bin/sh -c "npx -y playwright@1.57.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. @@ -132,14 +132,32 @@ This makes `hostmachine` point to the host's localhost. Your tests should use `h When running tests remotely, ensure the Playwright version in your tests matches the version running in the Docker container. ::: +### Connecting using noVNC and GitHub Codespaces + +For Docker and GitHub Codespaces environments, you can view and generate tests using the `noVNC` viewer built into the Docker image. In order for the VNC webviewer to be accessible outside of the container, you can enable the `desktop-lite` feature and specify the `webPort` in your `.devcontainer/devcontainer.json` file: + +```json +{ + "image": "mcr.microsoft.com/playwright:v1.57.0", + "forwardPorts": [6080], + "features": { + "desktop-lite": { + "webPort": "6080" + } + } +} +``` + +Once this is enabled you can open the port specified in a new browser tab and you will have access to the `noVNC` web viewer. This will enable you to record tests, pick selectors, and use codegen directly on your container. + ## Image tags See [all available image tags]. We currently publish images with the following tags: -- `: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). +- `:v1.57.0` - Playwright v1.57.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.57.0-noble` - Playwright v1.57.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.57.0-jammy` - Playwright v1.57.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). :::note @@ -163,7 +181,7 @@ To run Playwright inside Docker, you need to have Python, [Playwright browsers]( ```Dockerfile FROM python:3.12-bookworm -RUN pip install playwright==@1.56.0 && \ +RUN pip install playwright==@1.57.0 && \ playwright install --with-deps ``` diff --git a/src/components/GitHubStarButton/index.tsx b/src/components/GitHubStarButton/index.tsx index da9e750b4d2..2e3656e7307 100644 --- a/src/components/GitHubStarButton/index.tsx +++ b/src/components/GitHubStarButton/index.tsx @@ -6,7 +6,7 @@ type StarButtonProps = { repo: string } -const STARS = '79k+'; // NOTE: this line is generated by src/generate.js. Do not change! +const STARS = '80k+'; // NOTE: this line is generated by src/generate.js. Do not change! const StarButton: React.FC = ({owner, repo}) => { if (!repo)