Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/playwright
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.23.1
Choose a base ref
...
head repository: microsoft/playwright
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.23.2
Choose a head ref
  • 8 commits
  • 24 files changed
  • 4 contributors

Commits on Jun 30, 2022

  1. Copy the full SHA
    a126a2f View commit details

Commits on Jul 1, 2022

  1. Copy the full SHA
    e9c42a1 View commit details
  2. Copy the full SHA
    354f6ea View commit details
  3. Copy the full SHA
    2b64bca View commit details
  4. Copy the full SHA
    19790a0 View commit details

Commits on Jul 6, 2022

  1. Copy the full SHA
    741e338 View commit details
  2. Copy the full SHA
    a2acf76 View commit details

Commits on Jul 7, 2022

  1. Copy the full SHA
    56e04df View commit details
10 changes: 5 additions & 5 deletions docs/src/ci.md
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ Alternatively, you can use [Command line tools](./cli.md#install-system-dependen
pool:
vmImage: 'ubuntu-20.04'
container: mcr.microsoft.com/playwright:v1.23.1-focal
container: mcr.microsoft.com/playwright:v1.23.2-focal
steps:
...
@@ -157,7 +157,7 @@ Running Playwright on CircleCI requires the following steps:

```yml
docker:
- image: mcr.microsoft.com/playwright:v1.23.1-focal
- image: mcr.microsoft.com/playwright:v1.23.2-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
```
@@ -179,7 +179,7 @@ to run tests on Jenkins.

```groovy
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright:v1.23.1-focal' } }
agent { docker { image 'mcr.microsoft.com/playwright:v1.23.2-focal' } }
stages {
stage('e2e-tests') {
steps {
@@ -196,7 +196,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.md)).

```yml
image: mcr.microsoft.com/playwright:v1.23.1-focal
image: mcr.microsoft.com/playwright:v1.23.2-focal
```

### GitLab CI
@@ -209,7 +209,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.23.1-focal
image: mcr.microsoft.com/playwright:v1.23.2-focal
script:
...
```
24 changes: 12 additions & 12 deletions docs/src/docker.md
Original file line number Diff line number Diff line change
@@ -14,19 +14,19 @@ This image is published on [Docker Hub].
### Pull the image

```bash js
docker pull mcr.microsoft.com/playwright:v1.23.1-focal
docker pull mcr.microsoft.com/playwright:v1.23.2-focal
```

```bash python
docker pull mcr.microsoft.com/playwright/python:v1.23.1-focal
docker pull mcr.microsoft.com/playwright/python:v1.23.2-focal
```

```bash csharp
docker pull mcr.microsoft.com/playwright/dotnet:v1.23.1-focal
docker pull mcr.microsoft.com/playwright/dotnet:v1.23.2-focal
```

```bash java
docker pull mcr.microsoft.com/playwright/java:v1.23.1-focal
docker pull mcr.microsoft.com/playwright/java:v1.23.2-focal
```

### Run the image
@@ -38,39 +38,39 @@ 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 js
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.23.2-focal /bin/bash
```

```bash python
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.23.2-focal /bin/bash
```

```bash csharp
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.23.2-focal /bin/bash
```

```bash java
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.23.2-focal /bin/bash
```

#### Crawling and scraping

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 js
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.23.2-focal /bin/bash
```

```bash python
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v1.23.2-focal /bin/bash
```

```bash csharp
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.23.2-focal /bin/bash
```

```bash java
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.23.1-focal /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.23.2-focal /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:
118 changes: 118 additions & 0 deletions docs/src/release-notes-csharp.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,124 @@ title: "Release notes"

<!-- TOC -->

## Version 1.23

### API Testing

Playwright for .NET 1.23 introduces new [API Testing](./api/class-apirequestcontext) that lets you send requests to the server directly from .NET!
Now you can:

- test your server API
- prepare server side state before visiting the web application in a test
- validate server side post-conditions after running some actions in the browser

To do a request on behalf of Playwright's Page, use **new [`property: Page.request`] API**:

```csharp
// Do a GET request on behalf of page
var response = await Page.APIRequest.GetAsync("http://example.com/foo.json");
Console.WriteLine(response.Status);
Console.WriteLine(response.StatusText);
Console.WriteLine(response.Ok);
Console.WriteLine(response.Headers["Content-Type"]);
Console.WriteLine(await response.TextAsync());
Console.WriteLine((await response.JsonAsync())?.GetProperty("foo").GetString());
```

Read more about it in our [API testing guide](./api-testing).

### Network Replay

Now you can record network traffic into a HAR file and re-use this traffic in your tests.

To record network into HAR file:

```bash
pwsh bin\Debug\netX\playwright.ps1 open --save-har=example.har --save-har-glob="**/api/**" https://example.com
```

Alternatively, you can record HAR programmatically:

```csharp
var context = await browser.NewContextAsync(new ()
{
RecordHarPath = harPath,
RecordHarUrlFilterString = "**/api/**",
});

// ... Perform actions ...
// Close context to ensure HAR is saved to disk.
context.CloseAsync();
```

Use the new methods [`method: Page.routeFromHAR`] or [`method: BrowserContext.routeFromHAR`] to serve matching responses from the [HAR](http://www.softwareishard.com/blog/har-12-spec/) file:


```csharp
await context.RouteFromHARAsync("example.har");
```

Read more in [our documentation](./network#record-and-replay-requests).


### Advanced Routing

You can now use [`method: Route.fallback`] to defer routing to other handlers.

Consider the following example:

```csharp
// Remove a header from all requests.
await page.RouteAsync("**/*", async route =>
{
var headers = route.Request.Headers;
headers.Remove("X-Secret");
await route.ContinueAsync(new () { Headers = headers });
});

// Abort all images.
await page.RouteAsync("**/*", async route =>
{
if (route.Request.ResourceType == "image")
{
await route.AbortAsync();
}
else
{
await route.FallbackAsync();
}
});
```

Note that the new methods [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`] also participate in routing and could be deferred to.

### Web-First Assertions Update

* New method [`method: LocatorAssertions.toHaveValues`] that asserts all selected values of `<select multiple>` element.
* Methods [`method: LocatorAssertions.toContainText`] and [`method: LocatorAssertions.toHaveText`] now accept `ignoreCase` option.

### Miscellaneous

* If there's a service worker that's in your way, you can now easily disable it with a new context option `serviceWorkers`:
```csharp
var context = await Browser.NewContextAsync(new()
{
ServiceWorkers = ServiceWorkerPolicy.Block
});
```
* Using `.zip` path for `recordHar` context option automatically zips the resulting HAR:
```csharp
var context = await Browser.NewContextAsync(new() { RecordHarPath = "example.har.zip" });
```
* If you intend to edit HAR by hand, consider using the `"minimal"` HAR recording mode
that only records information that is essential for replaying:
```csharp
var context = await Browser.NewContextAsync(new() { RecordHarPath = "example.har", RecordHarMode = HarMode.Minimal });
```
* Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64.
* Playwright for .NET now supports **linux-arm64** and provides a **arm64 Ubuntu 20.04 Docker image** for it.

## Version 1.22

### Highlights
4 changes: 2 additions & 2 deletions docs/src/release-notes-java.md
Original file line number Diff line number Diff line change
@@ -86,10 +86,10 @@ Note that the new methods [`method: Page.routeFromHAR`] and [`method: BrowserCon
that only records information that is essential for replaying:
```java
BrowserContext context = browser.newContext(new Browser.NewContextOptions()
.setRecordHarPath(Paths.get("example.har.zip"))
.setRecordHarPath(Paths.get("example.har"))
.setRecordHarMode(HarMode.MINIMAL));
```
* Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64. We also publish new docker image `mcr.microsoft.com/playwright/java:v1.23.1-jammy`.
* Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64.


## Version 1.22
8 changes: 4 additions & 4 deletions docs/src/release-notes-js.md
Original file line number Diff line number Diff line change
@@ -96,23 +96,23 @@ Read more about [component testing with Playwright](./test-components).
}
});
```
* If you intend to edit HAR by hand, consider using the `"minimal"` HAR recording mode
* If you intend to edit HAR by hand, consider using the `"minimal"` HAR recording mode
that only records information that is essential for replaying:
```ts
const context = await browser.newContext({
recordHar: {
path: 'github.har.zip',
path: 'github.har',
mode: 'minimal',
}
});
```
* Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64. We also publish new docker image `mcr.microsoft.com/playwright:v1.23.1-jammy`.
* Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64. We also publish new docker image `mcr.microsoft.com/playwright:v1.23.2-jammy`.

### ⚠️ Breaking Changes ⚠️

WebServer is now considered "ready" if request to the specified port has any of the following HTTP status codes:

* `200-299`
* `200-299`
* `300-399` (new)
* `400`, `401`, `402`, `403` (new)

Loading