From 89559986296c94a83535d1f3794a3885da567209 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:11:15 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (04-02-25) --- dotnet/docs/api/class-browsertype.mdx | 30 +++++++++++++++++++++- dotnet/docs/api/class-websocket.mdx | 4 ++- dotnet/docs/ci.mdx | 10 ++++---- dotnet/docs/docker.mdx | 16 ++++++------ dotnet/docs/release-notes.mdx | 26 +++++++++++++++++++ java/docs/api/class-browsertype.mdx | 31 ++++++++++++++++++++++- java/docs/api/class-websocket.mdx | 4 ++- java/docs/release-notes.mdx | 23 +++++++++++++++++ nodejs/docs/api/class-browsertype.mdx | 4 +-- nodejs/docs/api/class-websocket.mdx | 4 ++- nodejs/docs/release-notes.mdx | 2 +- python/docs/api/class-browsertype.mdx | 30 +++++++++++++++++++++- python/docs/api/class-websocket.mdx | 4 ++- python/docs/ci.mdx | 12 ++++----- python/docs/docker.mdx | 18 ++++++------- python/docs/release-notes.mdx | 26 +++++++++++++++++++ src/components/GitHubStarButton/index.tsx | 2 +- 17 files changed, 207 insertions(+), 39 deletions(-) diff --git a/dotnet/docs/api/class-browsertype.mdx b/dotnet/docs/api/class-browsertype.mdx index 4fbc355e591..4eb34bca280 100644 --- a/dotnet/docs/api/class-browsertype.mdx +++ b/dotnet/docs/api/class-browsertype.mdx @@ -47,9 +47,37 @@ The major and minor version of the Playwright instance that connects needs to ma **Usage** ```csharp -await BrowserType.ConnectAsync(); +await BrowserType.ConnectAsync(wsEndpoint, options); ``` +**Arguments** +- `wsEndpoint` [string] Added in: v1.10# + + A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`. +- `options` `BrowserTypeConnectOptions?` *(optional)* + - `ExposeNetwork` [string]? *(optional)* Added in: v1.37# + + This option exposes network available on the connecting client to the browser being connected to. Consists of a list of rules separated by comma. + + Available rules: + 1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`. + 1. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`. + 1. `` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`. + + Some common examples: + 1. `"*"` to expose all network. + 1. `""` to expose localhost network. + 1. `"*.test.internal-domain,*.staging.internal-domain,"` to expose test/staging deployments and localhost. + - `Headers` [IDictionary]?<[string], [string]> *(optional)* Added in: v1.11# + + Additional HTTP headers to be sent with web socket connect request. Optional. + - `SlowMo` [float]? *(optional)* Added in: v1.10# + + Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0. + - `Timeout` [float]? *(optional)* Added in: v1.10# + + Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout). + **Returns** - [Browser]# diff --git a/dotnet/docs/api/class-websocket.mdx b/dotnet/docs/api/class-websocket.mdx index 21e45eefab9..08a9aa0eae5 100644 --- a/dotnet/docs/api/class-websocket.mdx +++ b/dotnet/docs/api/class-websocket.mdx @@ -7,7 +7,9 @@ import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; -The [WebSocket] class represents websocket connections in the page. +The [WebSocket] class represents WebSocket connections within a page. It provides the ability to inspect and manipulate the data being transmitted and received. + +If you want to intercept or modify WebSocket frames, consider using [WebSocketRoute]. --- diff --git a/dotnet/docs/ci.mdx b/dotnet/docs/ci.mdx index 612b5b8d875..c07c454d829 100644 --- a/dotnet/docs/ci.mdx +++ b/dotnet/docs/ci.mdx @@ -76,7 +76,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright/dotnet:v1.49.0-noble + image: mcr.microsoft.com/playwright/dotnet:v1.50.0-noble options: --user 1001 steps: - uses: actions/checkout@v4 @@ -164,7 +164,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright/dotnet:v1.49.0-noble +container: mcr.microsoft.com/playwright/dotnet:v1.50.0-noble steps: - task: UseDotNet@2 @@ -187,7 +187,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.49.0-noble + - image: mcr.microsoft.com/playwright/dotnet:v1.50.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. @@ -198,7 +198,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.49.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.50.0-noble' } } stages { stage('e2e-tests') { steps { @@ -215,7 +215,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.49.0-noble +image: mcr.microsoft.com/playwright/dotnet:v1.50.0-noble ``` ### GitLab CI diff --git a/dotnet/docs/docker.mdx b/dotnet/docs/docker.mdx index 813a6e5f144..d098ae7cee6 100644 --- a/dotnet/docs/docker.mdx +++ b/dotnet/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/dotnet:v1.49.0-noble +docker pull mcr.microsoft.com/playwright/dotnet:v1.50.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.49.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.50.0-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.49.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.49.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.50.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: @@ -79,7 +79,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.49.0-noble /bin/sh -c "npx -y playwright@1.49.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.50.0-noble /bin/sh -c "npx -y playwright@1.50.0 run-server --port 3000 --host 0.0.0.0" ``` #### Connecting to the Server @@ -96,7 +96,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.49.0-noble /bin/sh -c "npx -y playwright@1.49.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.50.0-noble /bin/sh -c "npx -y playwright@1.50.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. @@ -111,9 +111,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.49.0` - Playwright v1.49.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.49.0-noble` - Playwright v1.49.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.49.0-jammy` - Playwright v1.49.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.50.0` - Playwright v1.50.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.50.0-noble` - Playwright v1.50.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.50.0-jammy` - Playwright v1.50.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). :::note diff --git a/dotnet/docs/release-notes.mdx b/dotnet/docs/release-notes.mdx index 1391bc50ed0..16cab37dcc2 100644 --- a/dotnet/docs/release-notes.mdx +++ b/dotnet/docs/release-notes.mdx @@ -7,6 +7,32 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; +## Version 1.50 + +### Support for Xunit +* Support for xUnit 2.8+ via [Microsoft.Playwright.Xunit](https://www.nuget.org/packages/Microsoft.Playwright.Xunit). Follow our [Getting Started](./intro.mdx) guide to learn more. + +### Miscellaneous +* Added method [Expect(Locator).ToHaveAccessibleErrorMessageAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-accessible-error-message) to assert the Locator points to an element with a given [aria errormessage](https://w3c.github.io/aria/#aria-errormessage). + +### UI updates +* New button in Codegen for picking elements to produce aria snapshots. +* Additional details (such as keys pressed) are now displayed alongside action API calls in traces. +* Display of `canvas` content in traces is error-prone. Display is now disabled by default, and can be enabled via the `Display canvas content` UI setting. +* `Call` and `Network` panels now display additional time information. + +### Breaking +* [Expect(Locator).ToBeEditableAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-editable) and [Locator.IsEditableAsync()](/api/class-locator.mdx#locator-is-editable) now throw if the target element is not ``, ``, ``, `