Skip to content

Commit a5f4be6

Browse files
committed
Merge branch 'main' into mockingproxy-headers-only
2 parents 5e49e08 + 7aac96d commit a5f4be6

File tree

130 files changed

+3947
-1147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+3947
-1147
lines changed

.github/workflows/roll_browser_into_playwright.yml

+17-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ name: Roll Browser into Playwright
33
on:
44
repository_dispatch:
55
types: [roll_into_pw]
6+
workflow_dispatch:
7+
inputs:
8+
browser:
9+
description: 'Browser name, e.g. chromium'
10+
required: true
11+
type: string
12+
revision:
13+
description: 'Browser revision without v prefix, e.g. 1234'
14+
required: true
15+
type: string
616

717
env:
818
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
19+
BROWSER: ${{ github.event.client_payload.browser || github.event.inputs.browser }}
20+
REVISION: ${{ github.event.client_payload.revision || github.event.inputs.revision }}
921

1022
permissions:
1123
contents: write
@@ -24,19 +36,19 @@ jobs:
2436
run: npx playwright install-deps
2537
- name: Roll to new revision
2638
run: |
27-
./utils/roll_browser.js ${{ github.event.client_payload.browser }} ${{ github.event.client_payload.revision }}
39+
./utils/roll_browser.js $BROWSER $REVISION
2840
npm run build
2941
- name: Prepare branch
3042
id: prepare-branch
3143
run: |
32-
BRANCH_NAME="roll-into-pw-${{ github.event.client_payload.browser }}/${{ github.event.client_payload.revision }}"
44+
BRANCH_NAME="roll-into-pw-${BROWSER}/${REVISION}"
3345
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT
3446
git config --global user.name github-actions
3547
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
3648
git checkout -b "$BRANCH_NAME"
3749
git add .
38-
git commit -m "feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}"
39-
git push origin $BRANCH_NAME
50+
git commit -m "feat(${BROWSER}): roll to r${REVISION}"
51+
git push origin $BRANCH_NAME --force
4052
- name: Create Pull Request
4153
uses: actions/github-script@v7
4254
with:
@@ -47,7 +59,7 @@ jobs:
4759
repo: 'playwright',
4860
head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
4961
base: 'main',
50-
title: 'feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}',
62+
title: 'feat(${{ env.BROWSER }}): roll to r${{ env.REVISION }}',
5163
});
5264
await github.rest.issues.addLabels({
5365
owner: 'microsoft',

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# 🎭 Playwright
22

3-
[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-133.0.6943.27-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-134.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-18.2-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop --> [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://aka.ms/playwright/discord)
3+
[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-133.0.6943.35-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-134.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-18.2-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop --> [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://aka.ms/playwright/discord)
44

55
## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright)
66

77
Playwright is a framework for Web Testing and Automation. It allows testing [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.
88

99
| | Linux | macOS | Windows |
1010
| :--- | :---: | :---: | :---: |
11-
| Chromium <!-- GEN:chromium-version -->133.0.6943.27<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
11+
| Chromium <!-- GEN:chromium-version -->133.0.6943.35<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1212
| WebKit <!-- GEN:webkit-version -->18.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1313
| Firefox <!-- GEN:firefox-version -->134.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414

docs/src/api/class-apirequest.md

+19
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,25 @@ Methods like [`method: APIRequestContext.get`] take the base URL into considerat
6464
- `localStorage` <[Array]<[Object]>>
6565
- `name` <[string]>
6666
- `value` <[string]>
67+
- `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context
68+
- `name` <[string]> database name
69+
- `version` <[int]> database version
70+
- `stores` <[Array]<[Object]>>
71+
- `name` <[string]>
72+
- `keyPath` ?<[string]>
73+
- `keyPathArray` ?<[Array]<[string]>>
74+
- `autoIncrement` <[boolean]>
75+
- `indexes` <[Array]<[Object]>>
76+
- `name` <[string]>
77+
- `keyPath` ?<[string]>
78+
- `keyPathArray` ?<[Array]<[string]>>
79+
- `unique` <[boolean]>
80+
- `multiEntry` <[boolean]>
81+
- `records` <[Array]<[Object]>>
82+
- `key` ?<[Object]>
83+
- `keyEncoded` ?<[Object]> if `key` is not JSON-serializable, this contains an encoded version that preserves types.
84+
- `value` <[Object]>
85+
- `valueEncoded` ?<[Object]> if `value` is not JSON-serializable, this contains an encoded version that preserves types.
6786

6887
Populates context with given storage state. This option can be used to initialize context with logged-in information
6988
obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`]. Either a path to the

docs/src/api/class-apirequestcontext.md

+19
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,25 @@ context cookies from the response. The method will automatically follow redirect
880880
- `localStorage` <[Array]<[Object]>>
881881
- `name` <[string]>
882882
- `value` <[string]>
883+
- `indexedDB` <[Array]<[Object]>>
884+
- `name` <[string]>
885+
- `version` <[int]>
886+
- `stores` <[Array]<[Object]>>
887+
- `name` <[string]>
888+
- `keyPath` ?<[string]>
889+
- `keyPathArray` ?<[Array]<[string]>>
890+
- `autoIncrement` <[boolean]>
891+
- `indexes` <[Array]<[Object]>>
892+
- `name` <[string]>
893+
- `keyPath` ?<[string]>
894+
- `keyPathArray` ?<[Array]<[string]>>
895+
- `unique` <[boolean]>
896+
- `multiEntry` <[boolean]>
897+
- `records` <[Array]<[Object]>>
898+
- `key` ?<[Object]>
899+
- `keyEncoded` ?<[Object]> if `key` is not JSON-serializable, this contains an encoded version that preserves types.
900+
- `value` <[Object]>
901+
- `valueEncoded` ?<[Object]> if `value` is not JSON-serializable, this contains an encoded version that preserves types.
883902

884903
Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to the constructor.
885904

docs/src/api/class-browsercontext.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -1511,8 +1511,27 @@ Whether to emulate network being offline for the browser context.
15111511
- `localStorage` <[Array]<[Object]>>
15121512
- `name` <[string]>
15131513
- `value` <[string]>
1514-
1515-
Returns storage state for this browser context, contains current cookies and local storage snapshot.
1514+
- `indexedDB` <[Array]<[Object]>>
1515+
- `name` <[string]>
1516+
- `version` <[int]>
1517+
- `stores` <[Array]<[Object]>>
1518+
- `name` <[string]>
1519+
- `keyPath` ?<[string]>
1520+
- `keyPathArray` ?<[Array]<[string]>>
1521+
- `autoIncrement` <[boolean]>
1522+
- `indexes` <[Array]<[Object]>>
1523+
- `name` <[string]>
1524+
- `keyPath` ?<[string]>
1525+
- `keyPathArray` ?<[Array]<[string]>>
1526+
- `unique` <[boolean]>
1527+
- `multiEntry` <[boolean]>
1528+
- `records` <[Array]<[Object]>>
1529+
- `key` ?<[Object]>
1530+
- `keyEncoded` ?<[Object]> if `key` is not JSON-serializable, this contains an encoded version that preserves types.
1531+
- `value` <[Object]>
1532+
- `valueEncoded` ?<[Object]> if `value` is not JSON-serializable, this contains an encoded version that preserves types.
1533+
1534+
Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.
15161535

15171536
## async method: BrowserContext.storageState
15181537
* since: v1.8

docs/src/api/class-browsertype.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,17 @@ class BrowserTypeExamples
8989
* since: v1.8
9090
- returns: <[Browser]>
9191

92-
This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x).
92+
This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
93+
94+
:::note
95+
The major and minor version of the Playwright instance that connects needs to match the version of Playwright that launches the browser (1.2.3 → is compatible with 1.2.x).
96+
:::
9397

9498
### param: BrowserType.connect.wsEndpoint
9599
* since: v1.10
96100
- `wsEndpoint` <[string]>
97101

98-
A browser websocket endpoint to connect to.
102+
A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`.
99103

100104
### option: BrowserType.connect.headers
101105
* since: v1.11
@@ -152,6 +156,10 @@ The default browser context is accessible via [`method: Browser.contexts`].
152156
Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
153157
:::
154158

159+
:::note
160+
This connection is significantly lower fidelity than the Playwright protocol connection via [`method: BrowserType.connect`]. If you are experiencing issues or attempting to use advanced functionality, you probably want to use [`method: BrowserType.connect`].
161+
:::
162+
155163
**Usage**
156164

157165
```js

docs/src/api/class-locator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Additional locator to match.
155155
- returns: <[string]>
156156

157157
Captures the aria snapshot of the given element.
158-
Read more about [aria snapshots](../aria-snapshots.md) and [`method: LocatorAssertions.toMatchAriaSnapshot#1`] for the corresponding assertion.
158+
Read more about [aria snapshots](../aria-snapshots.md) and [`method: LocatorAssertions.toMatchAriaSnapshot`] for the corresponding assertion.
159159

160160
**Usage**
161161

docs/src/api/class-locatorassertions.md

+27-23
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,24 @@ Expected accessible description.
240240
### option: LocatorAssertions.NotToHaveAccessibleDescription.timeout = %%-csharp-java-python-assertions-timeout-%%
241241
* since: v1.44
242242

243+
## async method: LocatorAssertions.NotToHaveAccessibleErrorMessage
244+
* since: v1.50
245+
* langs: python
246+
247+
The opposite of [`method: LocatorAssertions.toHaveAccessibleErrorMessage`].
248+
249+
### param: LocatorAssertions.NotToHaveAccessibleErrorMessage.errorMessage
250+
* since: v1.50
251+
- `errorMessage` <[string]|[RegExp]>
252+
253+
Expected accessible error message.
254+
255+
### option: LocatorAssertions.NotToHaveAccessibleErrorMessage.ignoreCase = %%-assertions-ignore-case-%%
256+
* since: v1.50
257+
258+
### option: LocatorAssertions.NotToHaveAccessibleErrorMessage.timeout = %%-csharp-java-python-assertions-timeout-%%
259+
* since: v1.50
260+
243261

244262
## async method: LocatorAssertions.NotToHaveAccessibleName
245263
* since: v1.44
@@ -446,7 +464,7 @@ Expected options currently selected.
446464
* since: v1.49
447465
* langs: python
448466

449-
The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot#1`].
467+
The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot`].
450468

451469
### param: LocatorAssertions.NotToMatchAriaSnapshot.expected
452470
* since: v1.49
@@ -2180,7 +2198,7 @@ Expected options currently selected.
21802198
* since: v1.23
21812199

21822200

2183-
## async method: LocatorAssertions.toMatchAriaSnapshot#1
2201+
## async method: LocatorAssertions.toMatchAriaSnapshot
21842202
* since: v1.49
21852203
* langs:
21862204
- alias-java: matchesAriaSnapshot
@@ -2229,14 +2247,14 @@ assertThat(page.locator("body")).matchesAriaSnapshot("""
22292247
""");
22302248
```
22312249

2232-
### param: LocatorAssertions.toMatchAriaSnapshot#1.expected
2250+
### param: LocatorAssertions.toMatchAriaSnapshot.expected
22332251
* since: v1.49
22342252
- `expected` <string>
22352253

2236-
### option: LocatorAssertions.toMatchAriaSnapshot#1.timeout = %%-js-assertions-timeout-%%
2254+
### option: LocatorAssertions.toMatchAriaSnapshot.timeout = %%-js-assertions-timeout-%%
22372255
* since: v1.49
22382256

2239-
### option: LocatorAssertions.toMatchAriaSnapshot#1.timeout = %%-csharp-java-python-assertions-timeout-%%
2257+
### option: LocatorAssertions.toMatchAriaSnapshot.timeout = %%-csharp-java-python-assertions-timeout-%%
22402258
* since: v1.49
22412259

22422260
## async method: LocatorAssertions.toMatchAriaSnapshot#2
@@ -2245,35 +2263,21 @@ assertThat(page.locator("body")).matchesAriaSnapshot("""
22452263

22462264
Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.md).
22472265

2266+
Snapshot is stored in a separate `.yml` file in a location configured by `expect.toMatchAriaSnapshot.pathTemplate` and/or `snapshotPathTemplate` properties in the configuration file.
2267+
22482268
**Usage**
22492269

22502270
```js
22512271
await expect(page.locator('body')).toMatchAriaSnapshot();
2252-
await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'snapshot' });
2253-
```
2254-
2255-
```python async
2256-
await expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml')
2257-
```
2258-
2259-
```python sync
2260-
expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml')
2261-
```
2262-
2263-
```csharp
2264-
await Expect(page.Locator("body")).ToMatchAriaSnapshotAsync(new { Path = "/path/to/snapshot.yml" });
2265-
```
2266-
2267-
```java
2268-
assertThat(page.locator("body")).matchesAriaSnapshot(new LocatorAssertions.MatchesAriaSnapshotOptions().setPath("/path/to/snapshot.yml"));
2272+
await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.yml' });
22692273
```
22702274

22712275
### option: LocatorAssertions.toMatchAriaSnapshot#2.name
22722276
* since: v1.50
22732277
* langs: js
22742278
- `name` <[string]>
22752279

2276-
Name of the snapshot to store in the snapshot (screenshot) folder corresponding to this test.
2280+
Name of the snapshot to store in the snapshot folder corresponding to this test.
22772281
Generates sequential names if not specified.
22782282

22792283
### option: LocatorAssertions.toMatchAriaSnapshot#2.timeout = %%-js-assertions-timeout-%%

docs/src/api/class-page.md

+12
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,18 @@ Emulates `'forced-colors'` media feature, supported values are `'active'` and `'
13091309
* langs: csharp, python
13101310
- `forcedColors` <[ForcedColors]<"active"|"none"|"null">>
13111311

1312+
### option: Page.emulateMedia.contrast
1313+
* since: v1.51
1314+
* langs: js, java
1315+
- `contrast` <null|[Contrast]<"no-preference"|"more">>
1316+
1317+
Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. Passing `null` disables contrast emulation.
1318+
1319+
### option: Page.emulateMedia.contrast
1320+
* since: v1.51
1321+
* langs: csharp, python
1322+
- `contrast` <[Contrast]<"no-preference"|"more"|"null">>
1323+
13121324
## async method: Page.evalOnSelector
13131325
* since: v1.9
13141326
* discouraged: This method does not wait for the element to pass actionability

docs/src/api/class-websocket.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# class: WebSocket
22
* since: v1.8
33

4-
The [WebSocket] class represents websocket connections in the page.
4+
The [WebSocket] class represents WebSocket connections within a page. It provides the ability to inspect and manipulate the data being transmitted and received.
5+
6+
If you want to intercept or modify WebSocket frames, consider using [WebSocketRoute].
57

68
## event: WebSocket.close
79
* since: v1.8

0 commit comments

Comments
 (0)