From 426de8226ddff7698bf0b314557aa0a807416a49 Mon Sep 17 00:00:00 2001
From: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 07:46:58 +0000
Subject: [PATCH] feat(roll): roll to ToT Playwright (03-04-25)
---
dotnet/docs/api/class-browsercontext.mdx | 6 ---
dotnet/docs/api/class-browsertype.mdx | 30 ++++++++++++
dotnet/docs/pom.mdx | 2 +-
java/docs/api/class-browsercontext.mdx | 6 ---
java/docs/api/class-browsertype.mdx | 30 ++++++++++++
java/docs/pom.mdx | 2 +-
nodejs/docs/accessibility-testing.mdx | 7 ++-
nodejs/docs/api-testing.mdx | 2 +-
nodejs/docs/api/class-browsercontext.mdx | 6 ---
nodejs/docs/api/class-browsertype.mdx | 30 ++++++++++++
nodejs/docs/api/class-test.mdx | 13 +++++-
nodejs/docs/api/class-testcase.mdx | 6 ++-
nodejs/docs/api/class-testinfo.mdx | 3 ++
nodejs/docs/api/class-testresult.mdx | 32 +++++++++++++
nodejs/docs/api/class-teststep.mdx | 3 ++
nodejs/docs/aria-snapshots.mdx | 2 +-
nodejs/docs/canary-releases.mdx | 6 +--
nodejs/docs/debug.mdx | 4 ++
nodejs/docs/pom.mdx | 2 +-
nodejs/docs/release-notes.mdx | 56 +++++++++++------------
nodejs/docs/test-components.mdx | 4 +-
nodejs/docs/test-fixtures.mdx | 8 ++--
nodejs/docs/test-parallel.mdx | 12 +++++
nodejs/docs/test-sharding.mdx | 4 +-
python/docs/api/class-browsercontext.mdx | 6 ---
python/docs/api/class-browsertype.mdx | 30 ++++++++++++
python/docs/pom.mdx | 2 +-
src/components/GitHubStarButton/index.tsx | 2 +-
28 files changed, 237 insertions(+), 79 deletions(-)
diff --git a/dotnet/docs/api/class-browsercontext.mdx b/dotnet/docs/api/class-browsercontext.mdx
index 6c81f1ec6f8..d2c02a4a9c4 100644
--- a/dotnet/docs/api/class-browsercontext.mdx
+++ b/dotnet/docs/api/class-browsercontext.mdx
@@ -921,12 +921,6 @@ await BrowserContext.StorageStateAsync(options);
- `IndexedDB` [bool]? *(optional)* Added in: v1.51#
Set to `true` to include [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this.
-
- :::note
-
- IndexedDBs with typed arrays are currently not supported.
- :::
-
- `Path` [string]? *(optional)*#
The file path to save the storage state to. If [Path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
diff --git a/dotnet/docs/api/class-browsertype.mdx b/dotnet/docs/api/class-browsertype.mdx
index e2349ec5d09..ea518d3aa4c 100644
--- a/dotnet/docs/api/class-browsertype.mdx
+++ b/dotnet/docs/api/class-browsertype.mdx
@@ -71,6 +71,21 @@ await BrowserType.ConnectAsync(wsEndpoint, options);
- `Headers` [IDictionary]?<[string], [string]> *(optional)* Added in: v1.11#
Additional HTTP headers to be sent with web socket connect request. Optional.
+ - `Proxy` Proxy? *(optional)* Added in: v1.52#
+ - `Server` [string]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `Bypass` [string]? *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `Username` [string]? *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `Password` [string]? *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `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.
@@ -116,6 +131,21 @@ var page = defaultContext.Pages[0];
- `Headers` [IDictionary]?<[string], [string]> *(optional)* Added in: v1.11#
Additional HTTP headers to be sent with connect request. Optional.
+ - `Proxy` Proxy? *(optional)* Added in: v1.52#
+ - `Server` [string]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `Bypass` [string]? *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `Username` [string]? *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `Password` [string]? *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `SlowMo` [float]? *(optional)* Added in: v1.11#
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
diff --git a/dotnet/docs/pom.mdx b/dotnet/docs/pom.mdx
index a3fb41ec9cc..da302a6704a 100644
--- a/dotnet/docs/pom.mdx
+++ b/dotnet/docs/pom.mdx
@@ -8,7 +8,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
## Introduction
-Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
+Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
A page object represents a part of your web application. An e-commerce web application might have a home page, a listings page and a checkout page. Each of them can be represented by page object models.
diff --git a/java/docs/api/class-browsercontext.mdx b/java/docs/api/class-browsercontext.mdx
index 6036e38768f..0fb746f1094 100644
--- a/java/docs/api/class-browsercontext.mdx
+++ b/java/docs/api/class-browsercontext.mdx
@@ -819,12 +819,6 @@ BrowserContext.storageState(options);
- `setIndexedDB` [boolean] *(optional)* Added in: v1.51#
Set to `true` to include [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this.
-
- :::note
-
- IndexedDBs with typed arrays are currently not supported.
- :::
-
- `setPath` [Path] *(optional)*#
The file path to save the storage state to. If [setPath](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
diff --git a/java/docs/api/class-browsertype.mdx b/java/docs/api/class-browsertype.mdx
index 4c94347b25c..6d42725e2f3 100644
--- a/java/docs/api/class-browsertype.mdx
+++ b/java/docs/api/class-browsertype.mdx
@@ -70,6 +70,21 @@ BrowserType.connect(wsEndpoint, options);
- `setHeaders` [Map]<[String], [String]> *(optional)* Added in: v1.11#
Additional HTTP headers to be sent with web socket connect request. Optional.
+ - `setProxy` Proxy *(optional)* Added in: v1.52#
+ - `setServer` [String]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `setBypass` [String] *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `setUsername` [String] *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `setPassword` [String] *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `setSlowMo` [double] *(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.
@@ -115,6 +130,21 @@ Page page = defaultContext.pages().get(0);
- `setHeaders` [Map]<[String], [String]> *(optional)* Added in: v1.11#
Additional HTTP headers to be sent with connect request. Optional.
+ - `setProxy` Proxy *(optional)* Added in: v1.52#
+ - `setServer` [String]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `setBypass` [String] *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `setUsername` [String] *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `setPassword` [String] *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `setSlowMo` [double] *(optional)* Added in: v1.11#
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
diff --git a/java/docs/pom.mdx b/java/docs/pom.mdx
index 3ee733bef3b..25a69f6b6b8 100644
--- a/java/docs/pom.mdx
+++ b/java/docs/pom.mdx
@@ -8,7 +8,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
## Introduction
-Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
+Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
A page object represents a part of your web application. An e-commerce web application might have a home page, a listings page and a checkout page. Each of them can be represented by page object models.
diff --git a/nodejs/docs/accessibility-testing.mdx b/nodejs/docs/accessibility-testing.mdx
index 81bd8412038..1001896d000 100644
--- a/nodejs/docs/accessibility-testing.mdx
+++ b/nodejs/docs/accessibility-testing.mdx
@@ -275,7 +275,7 @@ type AxeFixture = {
// This new "test" can be used in multiple test files, and each of them will get
// a consistently configured AxeBuilder instance.
export const test = base.extend({
- makeAxeBuilder: async ({ page }, use, testInfo) => {
+ makeAxeBuilder: async ({ page }, use) => {
const makeAxeBuilder = () => new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.exclude('#commonly-reused-element-with-known-issue');
@@ -289,8 +289,7 @@ export { expect } from '@playwright/test';
-```js
-// axe-test.js
+```js title="axe-test.js"
const base = require('@playwright/test');
const AxeBuilder = require('@axe-core/playwright').default;
@@ -299,7 +298,7 @@ const AxeBuilder = require('@axe-core/playwright').default;
// This new "test" can be used in multiple test files, and each of them will get
// a consistently configured AxeBuilder instance.
exports.test = base.test.extend({
- makeAxeBuilder: async ({ page }, use, testInfo) => {
+ makeAxeBuilder: async ({ page }, use) => {
const makeAxeBuilder = () => new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.exclude('#commonly-reused-element-with-known-issue');
diff --git a/nodejs/docs/api-testing.mdx b/nodejs/docs/api-testing.mdx
index 263dad2afcc..45f4e7a5af0 100644
--- a/nodejs/docs/api-testing.mdx
+++ b/nodejs/docs/api-testing.mdx
@@ -257,7 +257,7 @@ test('last created issue should be on the server', async ({ page }) => {
await page.getByRole('textbox', { name: 'Title' }).fill('Bug report 1');
await page.getByRole('textbox', { name: 'Comment body' }).fill('Bug description');
await page.getByText('Submit new issue').click();
- const issueId = page.url().substr(page.url().lastIndexOf('/'));
+ const issueId = new URL(page.url()).pathname.split('/').pop();
const newIssue = await apiContext.get(
`https://api.github.com/repos/${USER}/${REPO}/issues/${issueId}`
diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx
index 636ad4a1ec5..09f8b105d2a 100644
--- a/nodejs/docs/api/class-browsercontext.mdx
+++ b/nodejs/docs/api/class-browsercontext.mdx
@@ -861,12 +861,6 @@ await browserContext.storageState(options);
- `indexedDB` [boolean] *(optional)* Added in: v1.51#
Set to `true` to include [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this.
-
- :::note
-
- IndexedDBs with typed arrays are currently not supported.
- :::
-
- `path` [string] *(optional)*#
The file path to save the storage state to. If [path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
diff --git a/nodejs/docs/api/class-browsertype.mdx b/nodejs/docs/api/class-browsertype.mdx
index 4e6a81ec5f6..1c1a21cdfb3 100644
--- a/nodejs/docs/api/class-browsertype.mdx
+++ b/nodejs/docs/api/class-browsertype.mdx
@@ -68,6 +68,21 @@ await browserType.connect(wsEndpoint, options);
- `logger` [Logger] *(optional)* Added in: v1.14#
Logger sink for Playwright logging. Optional.
+ - `proxy` [Object] *(optional)* Added in: v1.52#
+ - `server` [string]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `bypass` [string] *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `username` [string] *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `password` [string] *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `slowMo` [number] *(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.
@@ -119,6 +134,21 @@ const page = defaultContext.pages()[0];
- `logger` [Logger] *(optional)* Added in: v1.14#
Logger sink for Playwright logging. Optional.
+ - `proxy` [Object] *(optional)* Added in: v1.52#
+ - `server` [string]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `bypass` [string] *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `username` [string] *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `password` [string] *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `slowMo` [number] *(optional)* Added in: v1.11#
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
diff --git a/nodejs/docs/api/class-test.mdx b/nodejs/docs/api/class-test.mdx
index 5f91549f426..8c12ac9f275 100644
--- a/nodejs/docs/api/class-test.mdx
+++ b/nodejs/docs/api/class-test.mdx
@@ -460,7 +460,18 @@ Learn more about the execution modes [here](../test-parallel.mdx).
test('runs in parallel 2', async ({ page }) => {});
```
-* Running tests serially, retrying from the start.
+* Running tests in order, retrying each failed test independetly.
+
+ This is the default mode. It can be useful to set it explicitly to override project configuration that uses `fullyParallel`.
+
+ ```js
+ // Tests in this file run in order. Retries, if any, run independently.
+ test.describe.configure({ mode: 'default' });
+ test('runs first', async ({ page }) => {});
+ test('runs second', async ({ page }) => {});
+ ```
+
+* Running tests serially, retrying from the start. If one of the serial tests fails, all subsequent tests are skipped.
:::note
diff --git a/nodejs/docs/api/class-testcase.mdx b/nodejs/docs/api/class-testcase.mdx
index 8093f51cfc3..63d7284dd5b 100644
--- a/nodejs/docs/api/class-testcase.mdx
+++ b/nodejs/docs/api/class-testcase.mdx
@@ -75,8 +75,7 @@ testCase.titlePath();
The list of annotations applicable to the current test. Includes:
* annotations defined on the test or suite via [test()](/api/class-test.mdx#test-call) and [test.describe()](/api/class-test.mdx#test-describe);
-* annotations implicitly added by methods [test.skip()](/api/class-test.mdx#test-skip), [test.fixme()](/api/class-test.mdx#test-fixme) and [test.fail()](/api/class-test.mdx#test-fail);
-* annotations appended to [testInfo.annotations](/api/class-testinfo.mdx#test-info-annotations) during the test execution.
+* annotations implicitly added by methods [test.skip()](/api/class-test.mdx#test-skip), [test.fixme()](/api/class-test.mdx#test-fixme) and [test.fail()](/api/class-test.mdx#test-fail) prior to test execution.
Annotations are available during test execution through [testInfo.annotations](/api/class-testinfo.mdx#test-info-annotations).
@@ -96,6 +95,9 @@ testCase.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/docs/api/class-testinfo.mdx b/nodejs/docs/api/class-testinfo.mdx
index f8e567bd10b..beb8d315634 100644
--- a/nodejs/docs/api/class-testinfo.mdx
+++ b/nodejs/docs/api/class-testinfo.mdx
@@ -346,6 +346,9 @@ testInfo.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/docs/api/class-testresult.mdx b/nodejs/docs/api/class-testresult.mdx
index 3f416fa340a..dc4c782bfec 100644
--- a/nodejs/docs/api/class-testresult.mdx
+++ b/nodejs/docs/api/class-testresult.mdx
@@ -14,6 +14,38 @@ A result of a single [TestCase] run.
## Properties
+### annotations {#test-result-annotations}
+
+Added in: v1.52testResult.annotations
+
+The list of annotations appended during test execution. Includes:
+* annotations implicitly added by methods [test.skip()](/api/class-test.mdx#test-skip), [test.fixme()](/api/class-test.mdx#test-fixme) and [test.fail()](/api/class-test.mdx#test-fail) during test execution;
+* annotations appended to [testInfo.annotations](/api/class-testinfo.mdx#test-info-annotations).
+
+Annotations are available during test execution through [testInfo.annotations](/api/class-testinfo.mdx#test-info-annotations).
+
+Learn more about [test annotations](../test-annotations.mdx).
+
+**Usage**
+
+```js
+testResult.annotations
+```
+
+**Type**
+- [Array]<[Object]>
+ - `type` [string]
+
+ Annotation type, for example `'skip'` or `'fail'`.
+ - `description` [string] *(optional)*
+
+ Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
+
+---
+
### attachments {#test-result-attachments}
Added in: v1.10testResult.attachments
diff --git a/nodejs/docs/api/class-teststep.mdx b/nodejs/docs/api/class-teststep.mdx
index d20c9431b70..52346e5318c 100644
--- a/nodejs/docs/api/class-teststep.mdx
+++ b/nodejs/docs/api/class-teststep.mdx
@@ -53,6 +53,9 @@ testStep.annotations
- `description` [string] *(optional)*
Optional description.
+ - `location` [Location] *(optional)*
+
+ Optional location in the source where the annotation is added.
---
diff --git a/nodejs/docs/aria-snapshots.mdx b/nodejs/docs/aria-snapshots.mdx
index 9e7dc2c4b56..61162285546 100644
--- a/nodejs/docs/aria-snapshots.mdx
+++ b/nodejs/docs/aria-snapshots.mdx
@@ -218,7 +218,7 @@ The way source code is updated can be changed using the `--update-source-method`
- **"overwrite"**: Overwrites the source code with the new snapshot values.
```bash
-npx playwright test --update-snapshots --update-source-mode=3way
+npx playwright test --update-snapshots --update-source-method=3way
```
#### Snapshots as separate files
diff --git a/nodejs/docs/canary-releases.mdx b/nodejs/docs/canary-releases.mdx
index c4c701119d1..9340c37001d 100644
--- a/nodejs/docs/canary-releases.mdx
+++ b/nodejs/docs/canary-releases.mdx
@@ -21,10 +21,6 @@ Using a canary release in production might seem risky, but in practice, it's not
A canary release passes all automated tests and is used to test e.g. the HTML report, Trace Viewer, or Playwright Inspector with end-to-end tests.
:::
-```txt
-npm install -D @playwright/test@next
-```
-
## Next npm Dist Tag
For any code-related commit on `main`, the continuous integration will publish a daily canary release under the `@next` npm dist tag.
@@ -36,7 +32,7 @@ You can see on [npm](https://www.npmjs.com/package/@playwright/test?activeTab=ve
## Using a Canary Release
-```txt
+```bash
npm install -D @playwright/test@next
```
diff --git a/nodejs/docs/debug.mdx b/nodejs/docs/debug.mdx
index f3d19eb5a95..1ea5f659d0c 100644
--- a/nodejs/docs/debug.mdx
+++ b/nodejs/docs/debug.mdx
@@ -46,6 +46,10 @@ A browser window will open and the test will run and pause at where the breakpoi
+### Debug Tests Using Chrome DevTools
+
+Instead of using `Debug Test`, choose `Run Test` in VS Code. With `Show Browser` enabled, the browser session is reused, letting you open Chrome DevTools for continuous debugging of your tests and the web application.
+
### Debug in different Browsers
By default, debugging is done using the Chromium profile. You can debug your tests on different browsers by right clicking on the debug icon in the testing sidebar and clicking on the 'Select Default Profile' option from the dropdown.
diff --git a/nodejs/docs/pom.mdx b/nodejs/docs/pom.mdx
index e4e50ec4d6e..fdfa1163b3e 100644
--- a/nodejs/docs/pom.mdx
+++ b/nodejs/docs/pom.mdx
@@ -8,7 +8,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
## Introduction
-Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
+Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
A page object represents a part of your web application. An e-commerce web application might have a home page, a listings page and a checkout page. Each of them can be represented by page object models.
diff --git a/nodejs/docs/release-notes.mdx b/nodejs/docs/release-notes.mdx
index 02180d201cc..d797eddbc65 100644
--- a/nodejs/docs/release-notes.mdx
+++ b/nodejs/docs/release-notes.mdx
@@ -307,7 +307,7 @@ npx playwright test --tsconfig tsconfig.test.json
You can now pass [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) and `string` as query parameters to [APIRequestContext]:
-```ts
+```js
test('query params', async ({ request }) => {
const searchParams = new URLSearchParams();
searchParams.set('userId', 1);
@@ -348,7 +348,7 @@ Playwright now allows you to supply client-side certificates, so that server can
The following snippet sets up a client certificate for `https://example.com`:
-```ts
+```js
import { defineConfig } from '@playwright/test';
export default defineConfig({
@@ -387,7 +387,7 @@ This release introduces an experimental `router` fixture to intercept and handle
Here is an example of reusing your existing MSW handlers in the test.
-```ts
+```js
import { handlers } from '@src/mocks/handlers';
test.beforeEach(async ({ router }) => {
@@ -471,7 +471,7 @@ See [the clock guide](./clock.mdx) for more details.
- New options [testConfig.respectGitIgnore](/api/class-testconfig.mdx#test-config-respect-git-ignore) and [testProject.respectGitIgnore](/api/class-testproject.mdx#test-project-respect-git-ignore) control whether files matching `.gitignore` patterns are excluded when searching for tests.
- New property `timeout` is now available for custom expect matchers. This property takes into account `playwright.config.ts` and `expect.configure()`.
- ```ts
+ ```js
import { expect as baseExpect } from '@playwright/test';
export const expect = baseExpect.extend({
@@ -486,13 +486,13 @@ See [the clock guide](./clock.mdx) for more details.
### Miscellaneous
- Method [locator.setInputFiles()](/api/class-locator.mdx#locator-set-input-files) now supports uploading a directory for `` elements.
- ```ts
+ ```js
await page.getByLabel('Upload directory').setInputFiles(path.join(__dirname, 'mydir'));
```
- Multiple methods like [locator.click()](/api/class-locator.mdx#locator-click) or [locator.press()](/api/class-locator.mdx#locator-press) now support a `ControlOrMeta` modifier key. This key maps to `Meta` on macOS and maps to `Control` on Windows and Linux.
- ```ts
+ ```js
// Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
await page.keyboard.press('ControlOrMeta+S');
```
@@ -1654,7 +1654,7 @@ This version was also tested against the following stable channels:
### Test Runner
* [test.step()](/api/class-test.mdx#test-step) now returns the value of the step function:
- ```ts
+ ```js
test('should work', async ({ page }) => {
const pageTitle = await test.step('get title', async () => {
await page.goto('https://playwright.dev');
@@ -1691,7 +1691,7 @@ This version was also tested against the following stable channels:
Launch multiple web servers, databases, or other processes by passing an array of configurations:
-```ts title="playwright.config.ts"
+```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';
export default defineConfig({
webServer: [
@@ -1730,7 +1730,7 @@ Linux support looks like this:
It is now possible to call [test.describe()](/api/class-test.mdx#test-describe) to create suites without a title. This is useful for giving a group of tests a common option with [test.use()](/api/class-test.mdx#test-use).
-```ts
+```js
test.describe(() => {
test.use({ colorScheme: 'dark' });
@@ -1817,7 +1817,7 @@ npx playwright open --save-har=github.har.zip https://github.com/microsoft
Alternatively, you can record HAR programmatically:
-```ts
+```js
const context = await browser.newContext({
recordHar: { path: 'github.har.zip' }
});
@@ -1827,7 +1827,7 @@ await context.close();
Use the new methods [page.routeFromHAR()](/api/class-page.mdx#page-route-from-har) or [browserContext.routeFromHAR()](/api/class-browsercontext.mdx#browser-context-route-from-har) to serve matching responses from the [HAR](http://www.softwareishard.com/blog/har-12-spec/) file:
-```ts
+```js
await context.routeFromHAR('github.har.zip');
```
@@ -1839,7 +1839,7 @@ You can now use [route.fallback()](/api/class-route.mdx#route-fallback) to defer
Consider the following example:
-```ts
+```js
// Remove a header from all requests.
test.beforeEach(async ({ page }) => {
await page.route('**/*', async route => {
@@ -1874,7 +1874,7 @@ Read more about [component testing with Playwright](./test-components).
### Miscellaneous
* If there's a service worker that's in your way, you can now easily disable it with a new context option `serviceWorkers`:
- ```ts title="playwright.config.ts"
+ ```js title="playwright.config.ts"
export default {
use: {
serviceWorkers: 'block',
@@ -1884,7 +1884,7 @@ Read more about [component testing with Playwright](./test-components).
* Using `.zip` path for `recordHar` context option automatically zips the resulting HAR:
- ```ts
+ ```js
const context = await browser.newContext({
recordHar: {
path: 'github.har.zip',
@@ -1894,7 +1894,7 @@ Read more about [component testing with Playwright](./test-components).
* 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
+ ```js
const context = await browser.newContext({
recordHar: {
path: 'github.har',
@@ -1923,7 +1923,7 @@ WebServer is now considered "ready" if request to the specified url has any of t
Here is what a typical component test looks like:
- ```ts title="App.spec.tsx"
+ ```js title="App.spec.tsx"
import { test, expect } from '@playwright/experimental-ct-react';
import App from './App';
@@ -2039,7 +2039,7 @@ This version was also tested against the following stable channels:
It is most convenient to specify `maxDiffPixels` or `maxDiffPixelRatio` once in [testConfig.expect](/api/class-testconfig.mdx#test-config-expect).
- Playwright Test now adds [testConfig.fullyParallel](/api/class-testconfig.mdx#test-config-fully-parallel) mode. By default, Playwright Test parallelizes between files. In fully parallel mode, tests inside a single file are also run in parallel. You can also use `--fully-parallel` command line flag.
- ```ts title="playwright.config.ts"
+ ```js title="playwright.config.ts"
export default {
fullyParallel: true,
};
@@ -2047,7 +2047,7 @@ This version was also tested against the following stable channels:
- [testProject.grep](/api/class-testproject.mdx#test-project-grep) and [testProject.grepInvert](/api/class-testproject.mdx#test-project-grep-invert) are now configurable per project. For example, you can now configure smoke tests project using `grep`:
- ```ts title="playwright.config.ts"
+ ```js title="playwright.config.ts"
export default {
projects: [
{
@@ -2320,7 +2320,7 @@ Playwright 1.16 introduces new [API Testing](./api/class-apirequestcontext) that
To do a request on behalf of Playwright's Page, use **new [page.request](/api/class-page.mdx#page-request) API**:
-```ts
+```js
import { test, expect } from '@playwright/test';
test('context fetch', async ({ page }) => {
@@ -2332,7 +2332,7 @@ test('context fetch', async ({ page }) => {
To do a stand-alone request from node.js to an API endpoint, use **new [`request` fixture](./api/class-fixtures#fixtures-request)**:
-```ts
+```js
import { test, expect } from '@playwright/test';
test('context fetch', async ({ request }) => {
@@ -2350,7 +2350,7 @@ It is now possible to do response interception by combining [API Testing](./api-
For example, we can blur all the images on the page:
-```ts
+```js
import { test, expect } from '@playwright/test';
import jimp from 'jimp'; // image processing library
@@ -2393,7 +2393,7 @@ Wait for a locator to resolve to a single element with a given state. Defaults t
Comes especially handy when working with lists:
-```ts
+```js
import { test, expect } from '@playwright/test';
test('context fetch', async ({ page }) => {
@@ -2464,7 +2464,7 @@ Its now possible to emulate the `forced-colors` CSS media feature by passing it
#### 🤝 `test.parallel()` run tests in the same file in parallel
-```ts
+```js
test.describe.parallel('group', () => {
test('runs in parallel 1', async ({ page }) => {
});
@@ -2582,7 +2582,7 @@ List of all new assertions:
Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are skipped. All tests in a group are retried together.
-```ts
+```js
test.describe.serial('group', () => {
test('runs first', async ({ page }) => { /* ... */ });
test('runs second', async ({ page }) => { /* ... */ });
@@ -2595,7 +2595,7 @@ Learn more in the [documentation](./api/class-test#test-describe-serial).
Split long tests into multiple steps using `test.step()` API:
-```ts
+```js
import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
@@ -2614,7 +2614,7 @@ Step information is exposed in reporters API.
To launch a server during the tests, use the [`webServer`](./test-webserver) option in the configuration file. The server will wait for a given url to be available before running the tests, and the url will be passed over to Playwright as a [`baseURL`](./api/class-testoptions#test-options-base-url) when creating a context.
-```ts title="playwright.config.ts"
+```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';
export default defineConfig({
webServer: {
@@ -2688,7 +2688,7 @@ npm i -D @playwright/test
Simple test `tests/foo.spec.ts`:
-```ts
+```js
import { test, expect } from '@playwright/test';
test('basic test', async ({ page }) => {
@@ -2715,7 +2715,7 @@ npx playwright test
Traces are recorded using the new [browserContext.tracing](/api/class-browsercontext.mdx#browser-context-tracing) API:
-```ts
+```js
const browser = await chromium.launch();
const context = await browser.newContext();
diff --git a/nodejs/docs/test-components.mdx b/nodejs/docs/test-components.mdx
index c4be070d004..da6683274f1 100644
--- a/nodejs/docs/test-components.mdx
+++ b/nodejs/docs/test-components.mdx
@@ -632,7 +632,7 @@ Playwright provides an **experimental** `router` fixture to intercept and handle
Here is an example of reusing your existing MSW handlers in the test.
-```ts
+```js
import { handlers } from '@src/mocks/handlers';
test.beforeEach(async ({ router }) => {
@@ -648,7 +648,7 @@ test('example test', async ({ mount }) => {
You can also introduce a one-off handler for a specific test.
-```ts
+```js
import { http, HttpResponse } from 'msw';
test('example test', async ({ mount, router }) => {
diff --git a/nodejs/docs/test-fixtures.mdx b/nodejs/docs/test-fixtures.mdx
index 459ecf66080..7da9e265347 100644
--- a/nodejs/docs/test-fixtures.mdx
+++ b/nodejs/docs/test-fixtures.mdx
@@ -742,7 +742,7 @@ export const test = base.extend({
[test.beforeEach()](/api/class-test.mdx#test-before-each) and [test.afterEach()](/api/class-test.mdx#test-after-each) hooks run before/after each test declared in the same file and same [test.describe()](/api/class-test.mdx#test-describe) block (if any). If you want to declare hooks that run before/after each test globally, you can declare them as auto fixtures like this:
-```ts title="fixtures.ts"
+```js title="fixtures.ts"
import { test as base } from '@playwright/test';
export const test = base.extend<{ forEachTest: void }>({
@@ -758,7 +758,7 @@ export const test = base.extend<{ forEachTest: void }>({
And then import the fixtures in all your tests:
-```ts title="mytest.spec.ts"
+```js title="mytest.spec.ts"
import { test } from './fixtures';
import { expect } from '@playwright/test';
@@ -772,7 +772,7 @@ test('basic', async ({ page }) => {
[test.beforeAll()](/api/class-test.mdx#test-before-all) and [test.afterAll()](/api/class-test.mdx#test-after-all) hooks run before/after all tests declared in the same file and same [test.describe()](/api/class-test.mdx#test-describe) block (if any), once per worker process. If you want to declare hooks that run before/after all tests in every file, you can declare them as auto fixtures with `scope: 'worker'` as follows:
-```ts title="fixtures.ts"
+```js title="fixtures.ts"
import { test as base } from '@playwright/test';
export const test = base.extend<{}, { forEachWorker: void }>({
@@ -788,7 +788,7 @@ export const test = base.extend<{}, { forEachWorker: void }>({
And then import the fixtures in all your tests:
-```ts title="mytest.spec.ts"
+```js title="mytest.spec.ts"
import { test } from './fixtures';
import { expect } from '@playwright/test';
diff --git a/nodejs/docs/test-parallel.mdx b/nodejs/docs/test-parallel.mdx
index b18f14f790f..c766c0bb3e3 100644
--- a/nodejs/docs/test-parallel.mdx
+++ b/nodejs/docs/test-parallel.mdx
@@ -128,6 +128,18 @@ test('runs second', async () => {
});
```
+## Opt out of fully parallel mode
+
+If your configuration applies parallel mode to all tests using [testConfig.fullyParallel](/api/class-testconfig.mdx#test-config-fully-parallel), you might still want to run some tests with default settings. You can override the mode per describe:
+
+```js
+test.describe('runs in parallel with other describes', () => {
+ test.describe.configure({ mode: 'default' });
+ test('in order 1', async ({ page }) => {});
+ test('in order 2', async ({ page }) => {});
+});
+```
+
## Shard tests between multiple machines
Playwright Test can shard a test suite, so that it can be executed on multiple machines. See [sharding guide](./test-sharding.mdx) for more details.
diff --git a/nodejs/docs/test-sharding.mdx b/nodejs/docs/test-sharding.mdx
index 2b833f39490..80cf9156145 100644
--- a/nodejs/docs/test-sharding.mdx
+++ b/nodejs/docs/test-sharding.mdx
@@ -52,7 +52,7 @@ In the previous example, each test shard has its own test report. If you want to
Start with adding `blob` reporter to the config when running on CI:
-```ts title="playwright.config.ts"
+```js title="playwright.config.ts"
export default defineConfig({
testDir: './tests',
reporter: process.env.CI ? 'blob' : 'html',
@@ -186,7 +186,7 @@ Supported options:
npx playwright merge-reports --config=merge.config.ts ./blob-reports
```
- ```ts title="merge.config.ts"
+ ```js title="merge.config.ts"
export default {
testDir: 'e2e',
reporter: [['html', { open: 'never' }]],
diff --git a/python/docs/api/class-browsercontext.mdx b/python/docs/api/class-browsercontext.mdx
index fca51f293ed..8c40ed071b0 100644
--- a/python/docs/api/class-browsercontext.mdx
+++ b/python/docs/api/class-browsercontext.mdx
@@ -1189,12 +1189,6 @@ browser_context.storage_state(**kwargs)
- `indexed_db` [bool] *(optional)* Added in: v1.51#
Set to `true` to include [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this.
-
- :::note
-
- IndexedDBs with typed arrays are currently not supported.
- :::
-
- `path` [Union]\[[str], [pathlib.Path]\] *(optional)*#
The file path to save the storage state to. If [path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
diff --git a/python/docs/api/class-browsertype.mdx b/python/docs/api/class-browsertype.mdx
index f022cefd575..bab40195f37 100644
--- a/python/docs/api/class-browsertype.mdx
+++ b/python/docs/api/class-browsertype.mdx
@@ -101,6 +101,21 @@ browser_type.connect(ws_endpoint, **kwargs)
- `headers` [Dict]\[[str], [str]\] *(optional)* Added in: v1.11#
Additional HTTP headers to be sent with web socket connect request. Optional.
+- `proxy` [Dict] *(optional)* Added in: v1.52#
+ - `server` [str]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `bypass` [str] *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `username` [str] *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `password` [str] *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `slow_mo` [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.
@@ -167,6 +182,21 @@ page = default_context.pages[0]
- `headers` [Dict]\[[str], [str]\] *(optional)* Added in: v1.11#
Additional HTTP headers to be sent with connect request. Optional.
+- `proxy` [Dict] *(optional)* Added in: v1.52#
+ - `server` [str]
+
+ Proxy to be used for the remote connection. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
+ - `bypass` [str] *(optional)*
+
+ Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
+ - `username` [str] *(optional)*
+
+ Optional username to use if HTTP proxy requires authentication.
+ - `password` [str] *(optional)*
+
+ Optional password to use if HTTP proxy requires authentication.
+
+ Proxy settings to use for the connection between the client and the remote browser. Note this proxy **is not** used by the browser to load web pages.
- `slow_mo` [float] *(optional)* Added in: v1.11#
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
diff --git a/python/docs/pom.mdx b/python/docs/pom.mdx
index 167733dd4cf..7ac51b989a4 100644
--- a/python/docs/pom.mdx
+++ b/python/docs/pom.mdx
@@ -8,7 +8,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
## Introduction
-Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
+Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite.
A page object represents a part of your web application. An e-commerce web application might have a home page, a listings page and a checkout page. Each of them can be represented by page object models.
diff --git a/src/components/GitHubStarButton/index.tsx b/src/components/GitHubStarButton/index.tsx
index 213ca6c0cce..04fce7e12a7 100644
--- a/src/components/GitHubStarButton/index.tsx
+++ b/src/components/GitHubStarButton/index.tsx
@@ -6,7 +6,7 @@ type StarButtonProps = {
repo: string
}
-const STARS = '70k+'; // NOTE: this line is generated by src/generate.js. Do not change!
+const STARS = '71k+'; // NOTE: this line is generated by src/generate.js. Do not change!
const StarButton: React.FC = ({owner, repo}) => {
if (!repo)