diff --git a/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx b/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx index 5f21adcf0c4..4fbc355e591 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx @@ -37,42 +37,19 @@ class BrowserTypeExamples Added before v1.9browserType.ConnectAsync -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). +This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js. + +:::note + +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). +::: **Usage** ```csharp -await BrowserType.ConnectAsync(wsEndpoint, options); +await BrowserType.ConnectAsync(); ``` -**Arguments** -- `wsEndpoint` [string] Added in: v1.10# - - A browser websocket endpoint to connect to. -- `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]# @@ -91,6 +68,10 @@ The default browser context is accessible via [Browser.Contexts](/api/class-brow Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. ::: +:::note +This connection is significantly lower fidelity than the Playwright protocol connection via [BrowserType.ConnectAsync()](/api/class-browsertype.mdx#browser-type-connect). If you are experiencing issues or attempting to use advanced functionality, you probably want to use [BrowserType.ConnectAsync()](/api/class-browsertype.mdx#browser-type-connect). +::: + **Usage** ```csharp diff --git a/dotnet/versioned_docs/version-stable/api/class-locator.mdx b/dotnet/versioned_docs/version-stable/api/class-locator.mdx index 43f74b359f9..4ff685f4ecd 100644 --- a/dotnet/versioned_docs/version-stable/api/class-locator.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-locator.mdx @@ -115,7 +115,7 @@ var button = page.GetByRole(AriaRole.Button).And(page.GetByTitle("Subscribe")); Added in: v1.49locator.AriaSnapshotAsync -Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) for the corresponding assertion. +Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) for the corresponding assertion. **Usage** diff --git a/dotnet/versioned_docs/version-stable/api/class-locatorassertions.mdx b/dotnet/versioned_docs/version-stable/api/class-locatorassertions.mdx index b89e5005faf..10a839a7fcf 100644 --- a/dotnet/versioned_docs/version-stable/api/class-locatorassertions.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-locatorassertions.mdx @@ -811,7 +811,7 @@ await Expect(locator).ToHaveValuesAsync(new Regex[] { new Regex("R"), new Regex( --- -### ToMatchAriaSnapshotAsync {#locator-assertions-to-match-aria-snapshot-1} +### ToMatchAriaSnapshotAsync {#locator-assertions-to-match-aria-snapshot} Added in: v1.49locatorAssertions.ToMatchAriaSnapshotAsync @@ -828,14 +828,14 @@ await Expect(page.Locator("body")).ToMatchAriaSnapshotAsync(@" ``` **Arguments** -- `expected` [string]# +- `expected` [string]# - `options` `LocatorAssertionsToMatchAriaSnapshotOptions?` *(optional)* - - `Timeout` [float]? *(optional)*# + - `Timeout` [float]? *(optional)*# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [void]# +- [void]# --- diff --git a/dotnet/versioned_docs/version-stable/aria-snapshots.mdx b/dotnet/versioned_docs/version-stable/aria-snapshots.mdx index db218e18d9e..e12fc5bbf38 100644 --- a/dotnet/versioned_docs/version-stable/aria-snapshots.mdx +++ b/dotnet/versioned_docs/version-stable/aria-snapshots.mdx @@ -88,7 +88,7 @@ These values are derived from ARIA attributes or calculated based on HTML semant ## Snapshot matching -The [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. +The [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. For the following DOM: diff --git a/dotnet/versioned_docs/version-stable/release-notes.mdx b/dotnet/versioned_docs/version-stable/release-notes.mdx index 58459e24267..1391bc50ed0 100644 --- a/dotnet/versioned_docs/version-stable/release-notes.mdx +++ b/dotnet/versioned_docs/version-stable/release-notes.mdx @@ -11,7 +11,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; ### Aria snapshots -New assertion [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) verifies page structure by comparing to an expected accessibility tree, represented as YAML. +New assertion [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) verifies page structure by comparing to an expected accessibility tree, represented as YAML. ```csharp await page.GotoAsync("https://playwright.dev"); diff --git a/java/versioned_docs/version-stable/api/class-browsertype.mdx b/java/versioned_docs/version-stable/api/class-browsertype.mdx index d3436c1fa53..04ef549a41d 100644 --- a/java/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/java/versioned_docs/version-stable/api/class-browsertype.mdx @@ -35,43 +35,19 @@ public class Example { Added before v1.9browserType.connect -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). +This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js. + +:::note + +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). +::: **Usage** ```java -BrowserType.connect(wsEndpoint); -BrowserType.connect(wsEndpoint, options); +BrowserType.connect(); ``` -**Arguments** -- `wsEndpoint` [String] Added in: v1.10# - - A browser websocket endpoint to connect to. -- `options` `BrowserType.ConnectOptions` *(optional)* - - `setExposeNetwork` [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. - - `setHeaders` [Map]<[String], [String]> *(optional)* Added in: v1.11# - - Additional HTTP headers to be sent with web socket connect request. Optional. - - `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. - - `setTimeout` [double] *(optional)* Added in: v1.10# - - Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout). - **Returns** - [Browser]# @@ -90,6 +66,10 @@ The default browser context is accessible via [Browser.contexts()](/api/class-br Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. ::: +:::note +This connection is significantly lower fidelity than the Playwright protocol connection via [BrowserType.connect()](/api/class-browsertype.mdx#browser-type-connect). If you are experiencing issues or attempting to use advanced functionality, you probably want to use [BrowserType.connect()](/api/class-browsertype.mdx#browser-type-connect). +::: + **Usage** ```java diff --git a/java/versioned_docs/version-stable/api/class-locator.mdx b/java/versioned_docs/version-stable/api/class-locator.mdx index 4c0842f9884..c9937384c21 100644 --- a/java/versioned_docs/version-stable/api/class-locator.mdx +++ b/java/versioned_docs/version-stable/api/class-locator.mdx @@ -115,7 +115,7 @@ Locator button = page.getByRole(AriaRole.BUTTON).and(page.getByTitle("Subscribe" Added in: v1.49locator.ariaSnapshot -Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [assertThat(locator).matchesAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) for the corresponding assertion. +Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [assertThat(locator).matchesAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) for the corresponding assertion. **Usage** diff --git a/java/versioned_docs/version-stable/api/class-locatorassertions.mdx b/java/versioned_docs/version-stable/api/class-locatorassertions.mdx index ac4c235b14e..90d9da61f98 100644 --- a/java/versioned_docs/version-stable/api/class-locatorassertions.mdx +++ b/java/versioned_docs/version-stable/api/class-locatorassertions.mdx @@ -788,7 +788,7 @@ assertThat( --- -### matchesAriaSnapshot {#locator-assertions-to-match-aria-snapshot-1} +### matchesAriaSnapshot {#locator-assertions-to-match-aria-snapshot} Added in: v1.49locatorAssertions.matchesAriaSnapshot @@ -805,14 +805,14 @@ assertThat(page.locator("body")).matchesAriaSnapshot(""" ``` **Arguments** -- `expected` [String]# +- `expected` [String]# - `options` `LocatorAssertions.MatchesAriaSnapshotOptions` *(optional)* - - `setTimeout` [double] *(optional)*# + - `setTimeout` [double] *(optional)*# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [void]# +- [void]# --- diff --git a/java/versioned_docs/version-stable/aria-snapshots.mdx b/java/versioned_docs/version-stable/aria-snapshots.mdx index 78eba4ad041..7de56e229c7 100644 --- a/java/versioned_docs/version-stable/aria-snapshots.mdx +++ b/java/versioned_docs/version-stable/aria-snapshots.mdx @@ -88,7 +88,7 @@ These values are derived from ARIA attributes or calculated based on HTML semant ## Snapshot matching -The [assertThat(locator).matchesAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. +The [assertThat(locator).matchesAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. For the following DOM: diff --git a/java/versioned_docs/version-stable/release-notes.mdx b/java/versioned_docs/version-stable/release-notes.mdx index a081b7480f9..9a10ba23947 100644 --- a/java/versioned_docs/version-stable/release-notes.mdx +++ b/java/versioned_docs/version-stable/release-notes.mdx @@ -11,7 +11,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; ### Aria snapshots -New assertion [assertThat(locator).matchesAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) verifies page structure by comparing to an expected accessibility tree, represented as YAML. +New assertion [assertThat(locator).matchesAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) verifies page structure by comparing to an expected accessibility tree, represented as YAML. ```java page.navigate("https://playwright.dev"); diff --git a/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx b/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx index b96ebeae216..670cc3a42fc 100644 --- a/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx @@ -30,7 +30,12 @@ const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'. Added before v1.9browserType.connect -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). +This method attaches Playwright to an existing browser instance created via [browserType.launchServer()](/api/class-browsertype.mdx#browser-type-launch-server). + +:::note + +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). +::: **Usage** @@ -42,7 +47,7 @@ await browserType.connect(wsEndpoint, options); **Arguments** - `wsEndpoint` [string] Added in: v1.10# - A browser websocket endpoint to connect to. + A Playwright browser websocket endpoint to connect to. You obtain this endpoint via [browserServer.wsEndpoint()](/api/class-browserserver.mdx#browser-server-ws-endpoint). - `options` [Object] *(optional)* - `exposeNetwork` [string] *(optional)* Added in: v1.37# @@ -88,6 +93,10 @@ The default browser context is accessible via [browser.contexts()](/api/class-br Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. ::: +:::note +This connection is significantly lower fidelity than the Playwright protocol connection via [browserType.connect()](/api/class-browsertype.mdx#browser-type-connect). If you are experiencing issues or attempting to use advanced functionality, you probably want to use [browserType.connect()](/api/class-browsertype.mdx#browser-type-connect). +::: + **Usage** ```js diff --git a/nodejs/versioned_docs/version-stable/api/class-locator.mdx b/nodejs/versioned_docs/version-stable/api/class-locator.mdx index 6aeaafbebf6..cb6b4057b23 100644 --- a/nodejs/versioned_docs/version-stable/api/class-locator.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-locator.mdx @@ -115,7 +115,7 @@ const button = page.getByRole('button').and(page.getByTitle('Subscribe')); Added in: v1.49locator.ariaSnapshot -Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) for the corresponding assertion. +Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) for the corresponding assertion. **Usage** diff --git a/nodejs/versioned_docs/version-stable/api/class-locatorassertions.mdx b/nodejs/versioned_docs/version-stable/api/class-locatorassertions.mdx index f2d3b71a041..f74b89731bf 100644 --- a/nodejs/versioned_docs/version-stable/api/class-locatorassertions.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-locatorassertions.mdx @@ -963,7 +963,7 @@ await expect(locator).toHaveValues([/R/, /G/]); --- -### toMatchAriaSnapshot(expected) {#locator-assertions-to-match-aria-snapshot-1} +### toMatchAriaSnapshot(expected) {#locator-assertions-to-match-aria-snapshot} Added in: v1.49locatorAssertions.toMatchAriaSnapshot(expected) @@ -980,14 +980,14 @@ await expect(page.locator('body')).toMatchAriaSnapshot(` ``` **Arguments** -- `expected` [string]# +- `expected` [string]# - `options` [Object] *(optional)* - - `timeout` [number] *(optional)*# + - `timeout` [number] *(optional)*# Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`. **Returns** -- [Promise]<[void]># +- [Promise]<[void]># --- @@ -997,18 +997,20 @@ await expect(page.locator('body')).toMatchAriaSnapshot(` Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.mdx). +Snapshot is stored in a separate `.yml` file in a location configured by `expect.toMatchAriaSnapshot.pathTemplate` and/or `snapshotPathTemplate` properties in the configuration file. + **Usage** ```js await expect(page.locator('body')).toMatchAriaSnapshot(); -await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'snapshot' }); +await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.yml' }); ``` **Arguments** - `options` [Object] *(optional)* - `name` [string] *(optional)*# - Name of the snapshot to store in the snapshot (screenshot) folder corresponding to this test. Generates sequential names if not specified. + Name of the snapshot to store in the snapshot folder corresponding to this test. Generates sequential names if not specified. - `timeout` [number] *(optional)*# Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`. diff --git a/nodejs/versioned_docs/version-stable/api/class-testconfig.mdx b/nodejs/versioned_docs/version-stable/api/class-testconfig.mdx index 1b605bfaf95..81ce6b2fd15 100644 --- a/nodejs/versioned_docs/version-stable/api/class-testconfig.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-testconfig.mdx @@ -101,8 +101,17 @@ export default defineConfig({ - `threshold` [number] *(optional)* An acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`. + - `pathTemplate` [string] *(optional)* + + A template controlling location of the screenshots. See [testConfig.snapshotPathTemplate](/api/class-testconfig.mdx#test-config-snapshot-path-template) for details. Configuration for the [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1) method. + - `toMatchAriaSnapshot` [Object] *(optional)* + - `pathTemplate` [string] *(optional)* + + A template controlling location of the aria snapshots. See [testConfig.snapshotPathTemplate](/api/class-testconfig.mdx#test-config-snapshot-path-template) for details. + + Configuration for the [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-2) method. - `toMatchSnapshot` [Object] *(optional)* - `maxDiffPixels` [number] *(optional)* @@ -632,7 +641,9 @@ export default defineConfig({ Added in: v1.28testConfig.snapshotPathTemplate -This option configures a template controlling location of snapshots generated by [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1) and [expect(value).toMatchSnapshot()](/api/class-snapshotassertions.mdx#snapshot-assertions-to-match-snapshot-1). +This option configures a template controlling location of snapshots generated by [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1), [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-2) and [expect(value).toMatchSnapshot()](/api/class-snapshotassertions.mdx#snapshot-assertions-to-match-snapshot-1). + +You can configure templates for each assertion separately in [testConfig.expect](/api/class-testconfig.mdx#test-config-expect). **Usage** @@ -641,7 +652,19 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: './tests', + + // Single template for all assertions snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}', + + // Assertion-specific templates + expect: { + toHaveScreenshot: { + pathTemplate: '{testDir}/__screenshots__{/projectName}/{testFilePath}/{arg}{ext}', + }, + toMatchAriaSnapshot: { + pathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}', + }, + }, }); ``` @@ -674,22 +697,22 @@ test.describe('suite', () => { ``` The list of supported tokens: -* `{arg}` - Relative snapshot path **without extension**. These come from the arguments passed to the `toHaveScreenshot()` and `toMatchSnapshot()` calls; if called without arguments, this will be an auto-generated snapshot name. +* `{arg}` - Relative snapshot path **without extension**. This comes from the arguments passed to `toHaveScreenshot()`, `toMatchAriaSnapshot()` or `toMatchSnapshot()`; if called without arguments, this will be an auto-generated snapshot name. * Value: `foo/bar/baz` -* `{ext}` - snapshot extension (with dots) +* `{ext}` - Snapshot extension (with the leading dot). * Value: `.png` * `{platform}` - The value of `process.platform`. * `{projectName}` - Project's file-system-sanitized name, if any. * Value: `''` (empty string). -* `{snapshotDir}` - Project's [testConfig.snapshotDir](/api/class-testconfig.mdx#test-config-snapshot-dir). +* `{snapshotDir}` - Project's [testProject.snapshotDir](/api/class-testproject.mdx#test-project-snapshot-dir). * Value: `/home/playwright/tests` (since `snapshotDir` is not provided in config, it defaults to `testDir`) -* `{testDir}` - Project's [testConfig.testDir](/api/class-testconfig.mdx#test-config-test-dir). - * Value: `/home/playwright/tests` (absolute path is since `testDir` is resolved relative to directory with config) +* `{testDir}` - Project's [testProject.testDir](/api/class-testproject.mdx#test-project-test-dir). + * Value: `/home/playwright/tests` (absolute path since `testDir` is resolved relative to directory with config) * `{testFileDir}` - Directories in relative path from `testDir` to **test file**. * Value: `page` * `{testFileName}` - Test file name with extension. * Value: `page-click.spec.ts` -* `{testFilePath}` - Relative path from `testDir` to **test file** +* `{testFilePath}` - Relative path from `testDir` to **test file**. * Value: `page/page-click.spec.ts` * `{testName}` - File-system-sanitized test title, including parent describes but excluding file name. * Value: `suite-test-should-work` diff --git a/nodejs/versioned_docs/version-stable/api/class-testproject.mdx b/nodejs/versioned_docs/version-stable/api/class-testproject.mdx index fa53caaad8c..566602efddb 100644 --- a/nodejs/versioned_docs/version-stable/api/class-testproject.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-testproject.mdx @@ -138,8 +138,17 @@ testProject.expect - `stylePath` [string] | [Array]<[string]> *(optional)* See [style](/api/class-page.mdx#page-screenshot-option-style) in [page.screenshot()](/api/class-page.mdx#page-screenshot). + - `pathTemplate` [string] *(optional)* + + A template controlling location of the screenshots. See [testProject.snapshotPathTemplate](/api/class-testproject.mdx#test-project-snapshot-path-template) for details. Configuration for the [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1) method. + - `toMatchAriaSnapshot` [Object] *(optional)* + - `pathTemplate` [string] *(optional)* + + A template controlling location of the aria snapshots. See [testProject.snapshotPathTemplate](/api/class-testproject.mdx#test-project-snapshot-path-template) for details. + + Configuration for the [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-2) method. - `toMatchSnapshot` [Object] *(optional)* - `threshold` [number] *(optional)* @@ -408,7 +417,9 @@ testProject.snapshotDir Added in: v1.28testProject.snapshotPathTemplate -This option configures a template controlling location of snapshots generated by [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1) and [expect(value).toMatchSnapshot()](/api/class-snapshotassertions.mdx#snapshot-assertions-to-match-snapshot-1). +This option configures a template controlling location of snapshots generated by [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1), [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-2) and [expect(value).toMatchSnapshot()](/api/class-snapshotassertions.mdx#snapshot-assertions-to-match-snapshot-1). + +You can configure templates for each assertion separately in [testConfig.expect](/api/class-testconfig.mdx#test-config-expect). **Usage** @@ -417,7 +428,19 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: './tests', + + // Single template for all assertions snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}', + + // Assertion-specific templates + expect: { + toHaveScreenshot: { + pathTemplate: '{testDir}/__screenshots__{/projectName}/{testFilePath}/{arg}{ext}', + }, + toMatchAriaSnapshot: { + pathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}', + }, + }, }); ``` @@ -450,22 +473,22 @@ test.describe('suite', () => { ``` The list of supported tokens: -* `{arg}` - Relative snapshot path **without extension**. These come from the arguments passed to the `toHaveScreenshot()` and `toMatchSnapshot()` calls; if called without arguments, this will be an auto-generated snapshot name. +* `{arg}` - Relative snapshot path **without extension**. This comes from the arguments passed to `toHaveScreenshot()`, `toMatchAriaSnapshot()` or `toMatchSnapshot()`; if called without arguments, this will be an auto-generated snapshot name. * Value: `foo/bar/baz` -* `{ext}` - snapshot extension (with dots) +* `{ext}` - Snapshot extension (with the leading dot). * Value: `.png` * `{platform}` - The value of `process.platform`. * `{projectName}` - Project's file-system-sanitized name, if any. * Value: `''` (empty string). -* `{snapshotDir}` - Project's [testConfig.snapshotDir](/api/class-testconfig.mdx#test-config-snapshot-dir). +* `{snapshotDir}` - Project's [testProject.snapshotDir](/api/class-testproject.mdx#test-project-snapshot-dir). * Value: `/home/playwright/tests` (since `snapshotDir` is not provided in config, it defaults to `testDir`) -* `{testDir}` - Project's [testConfig.testDir](/api/class-testconfig.mdx#test-config-test-dir). - * Value: `/home/playwright/tests` (absolute path is since `testDir` is resolved relative to directory with config) +* `{testDir}` - Project's [testProject.testDir](/api/class-testproject.mdx#test-project-test-dir). + * Value: `/home/playwright/tests` (absolute path since `testDir` is resolved relative to directory with config) * `{testFileDir}` - Directories in relative path from `testDir` to **test file**. * Value: `page` * `{testFileName}` - Test file name with extension. * Value: `page-click.spec.ts` -* `{testFilePath}` - Relative path from `testDir` to **test file** +* `{testFilePath}` - Relative path from `testDir` to **test file**. * Value: `page/page-click.spec.ts` * `{testName}` - File-system-sanitized test title, including parent describes but excluding file name. * Value: `suite-test-should-work` diff --git a/nodejs/versioned_docs/version-stable/aria-snapshots.mdx b/nodejs/versioned_docs/version-stable/aria-snapshots.mdx index 7753c44e48b..78abbbc7083 100644 --- a/nodejs/versioned_docs/version-stable/aria-snapshots.mdx +++ b/nodejs/versioned_docs/version-stable/aria-snapshots.mdx @@ -88,7 +88,7 @@ These values are derived from ARIA attributes or calculated based on HTML semant ## Snapshot matching -The [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. +The [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. For the following DOM: diff --git a/nodejs/versioned_docs/version-stable/ci.mdx b/nodejs/versioned_docs/version-stable/ci.mdx index 847e1ebb5f1..b1c84171ecd 100644 --- a/nodejs/versioned_docs/version-stable/ci.mdx +++ b/nodejs/versioned_docs/version-stable/ci.mdx @@ -101,7 +101,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright:v1.50.0-noble + image: mcr.microsoft.com/playwright:v1.50.1-noble options: --user 1001 steps: - uses: actions/checkout@v4 @@ -340,7 +340,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright:v1.50.0-noble +container: mcr.microsoft.com/playwright:v1.50.1-noble steps: - task: NodeTool@0 @@ -364,7 +364,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-noble-development: docker: - - image: mcr.microsoft.com/playwright:v1.50.0-noble + - image: mcr.microsoft.com/playwright:v1.50.1-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. @@ -387,7 +387,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright:v1.50.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright:v1.50.1-noble' } } stages { stage('e2e-tests') { steps { @@ -404,7 +404,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:v1.50.0-noble +image: mcr.microsoft.com/playwright:v1.50.1-noble ``` ### GitLab CI @@ -417,7 +417,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.50.0-noble + image: mcr.microsoft.com/playwright:v1.50.1-noble script: ... ``` @@ -432,7 +432,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.50.0-noble + image: mcr.microsoft.com/playwright:v1.50.1-noble parallel: 7 script: - npm ci @@ -447,7 +447,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.50.0-noble + image: mcr.microsoft.com/playwright:v1.50.1-noble parallel: matrix: - PROJECT: ['chromium', 'webkit'] @@ -463,7 +463,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see ```yml steps: -- name: mcr.microsoft.com/playwright:v1.50.0-noble +- name: mcr.microsoft.com/playwright:v1.50.1-noble script: ... env: @@ -481,7 +481,7 @@ type: docker steps: - name: test - image: mcr.microsoft.com/playwright:v1.50.0-noble + image: mcr.microsoft.com/playwright:v1.50.1-noble commands: - npx playwright test ``` diff --git a/nodejs/versioned_docs/version-stable/docker.mdx b/nodejs/versioned_docs/version-stable/docker.mdx index 780d673339f..935c86c5b53 100644 --- a/nodejs/versioned_docs/version-stable/docker.mdx +++ b/nodejs/versioned_docs/version-stable/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:v1.50.0-noble +docker pull mcr.microsoft.com/playwright:v1.50.1-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:v1.50.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.50.1-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.50.0-noble /bin/b 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:v1.50.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.50.1-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.50.0-noble /bin/sh -c "npx -y playwright@1.50.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.1-noble /bin/sh -c "npx -y playwright@1.50.1 run-server --port 3000 --host 0.0.0.0" ``` #### Connecting to the Server @@ -102,7 +102,7 @@ const browser = await playwright['chromium'].connect('ws://127.0.0.1:3000/'); 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.50.0-noble /bin/sh -c "npx -y playwright@1.50.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.1-noble /bin/sh -c "npx -y playwright@1.50.1 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. @@ -117,9 +117,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.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). +- `:v1.50.1` - Playwright v1.50.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.50.1-noble` - Playwright v1.50.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.50.1-jammy` - Playwright v1.50.1 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). :::note @@ -143,7 +143,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers] ```Dockerfile FROM node:20-bookworm -RUN npx -y playwright@1.50.0 install --with-deps +RUN npx -y playwright@1.50.1 install --with-deps ``` diff --git a/nodejs/versioned_docs/version-stable/release-notes.mdx b/nodejs/versioned_docs/version-stable/release-notes.mdx index 71c5d110fb7..cc2558f7371 100644 --- a/nodejs/versioned_docs/version-stable/release-notes.mdx +++ b/nodejs/versioned_docs/version-stable/release-notes.mdx @@ -51,6 +51,7 @@ import LiteYouTube from '@site/src/components/LiteYouTube'; * Option [testConfig.webServer](/api/class-testconfig.mdx#test-config-web-server) added a `gracefulShutdown` field for specifying a process kill signal other than the default `SIGKILL`. * Exposed [testStep.attachments](/api/class-teststep.mdx#test-step-attachments) from the reporter API to allow retrieval of all attachments created by that step. +* New option `pathTemplate` for `toHaveScreenshot` and `toMatchAriaSnapshot` assertions in the [testConfig.expect](/api/class-testconfig.mdx#test-config-expect) configuration. ### UI updates * Updated default HTML reporter to improve display of attachments. @@ -78,7 +79,7 @@ This version was also tested against the following stable channels: ### Aria snapshots -New assertion [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) verifies page structure by comparing to an expected accessibility tree, represented as YAML. +New assertion [expect(locator).toMatchAriaSnapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) verifies page structure by comparing to an expected accessibility tree, represented as YAML. ```js await page.goto('https://playwright.dev'); diff --git a/nodejs/versioned_docs/version-stable/test-snapshots.mdx b/nodejs/versioned_docs/version-stable/test-snapshots.mdx index 21fbee2d26f..6a759de3f6d 100644 --- a/nodejs/versioned_docs/version-stable/test-snapshots.mdx +++ b/nodejs/versioned_docs/version-stable/test-snapshots.mdx @@ -51,7 +51,7 @@ The snapshot name `example-test-1-chromium-darwin.png` consists of a few parts: - `chromium-darwin` - the browser name and the platform. Screenshots differ between browsers and platforms due to different rendering, fonts and more, so you will need different snapshots for them. If you use multiple projects in your [configuration file](./test-configuration.mdx), project name will be used instead of `chromium`. -The snapshot name and path can be configured with [`snapshotPathTemplate`](./api/class-testproject#test-project-snapshot-path-template) in the playwright config. +The snapshot name and path can be configured with [testConfig.snapshotPathTemplate](/api/class-testconfig.mdx#test-config-snapshot-path-template) in the playwright config. ## Updating screenshots diff --git a/python/versioned_docs/version-stable/api/class-browsertype.mdx b/python/versioned_docs/version-stable/api/class-browsertype.mdx index 765bebf03be..eecd232db65 100644 --- a/python/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/python/versioned_docs/version-stable/api/class-browsertype.mdx @@ -67,42 +67,19 @@ asyncio.run(main()) Added before v1.9browserType.connect -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). +This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js. + +:::note + +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). +::: **Usage** ```python -browser_type.connect(ws_endpoint) -browser_type.connect(ws_endpoint, **kwargs) +browser_type.connect() ``` -**Arguments** -- `ws_endpoint` [str] Added in: v1.10# - - A browser websocket endpoint to connect to. -- `expose_network` [str] *(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` [Dict]\[[str], [str]\] *(optional)* Added in: v1.11# - - Additional HTTP headers to be sent with web socket connect request. Optional. -- `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. -- `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]# @@ -121,6 +98,10 @@ The default browser context is accessible via [browser.contexts](/api/class-brow Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. ::: +:::note +This connection is significantly lower fidelity than the Playwright protocol connection via [browser_type.connect()](/api/class-browsertype.mdx#browser-type-connect). If you are experiencing issues or attempting to use advanced functionality, you probably want to use [browser_type.connect()](/api/class-browsertype.mdx#browser-type-connect). +::: + **Usage** Added in: v1.49locator.aria_snapshot -Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) for the corresponding assertion. +Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) for the corresponding assertion. **Usage** diff --git a/python/versioned_docs/version-stable/api/class-locatorassertions.mdx b/python/versioned_docs/version-stable/api/class-locatorassertions.mdx index c8cdb2ebb23..581d7389a77 100644 --- a/python/versioned_docs/version-stable/api/class-locatorassertions.mdx +++ b/python/versioned_docs/version-stable/api/class-locatorassertions.mdx @@ -344,6 +344,35 @@ expect(locator).not_to_have_accessible_description(name, **kwargs) --- +### not_to_have_accessible_error_message {#locator-assertions-not-to-have-accessible-error-message} + +Added in: v1.50locatorAssertions.not_to_have_accessible_error_message + +The opposite of [expect(locator).to_have_accessible_error_message()](/api/class-locatorassertions.mdx#locator-assertions-to-have-accessible-error-message). + +**Usage** + +```python +expect(locator).not_to_have_accessible_error_message(error_message) +expect(locator).not_to_have_accessible_error_message(error_message, **kwargs) +``` + +**Arguments** +- `error_message` [str] | [Pattern]# + + Expected accessible error message. +- `ignore_case` [bool] *(optional)*# + + Whether to perform case-insensitive match. [ignore_case](/api/class-locatorassertions.mdx#locator-assertions-not-to-have-accessible-error-message-option-ignore-case) option takes precedence over the corresponding regular expression flag if specified. +- `timeout` [float] *(optional)*# + + Time to retry the assertion for in milliseconds. Defaults to `5000`. + +**Returns** +- [NoneType]# + +--- + ### not_to_have_accessible_name {#locator-assertions-not-to-have-accessible-name} Added in: v1.44locatorAssertions.not_to_have_accessible_name @@ -655,7 +684,7 @@ expect(locator).not_to_have_values(values, **kwargs) Added in: v1.49locatorAssertions.not_to_match_aria_snapshot -The opposite of [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1). +The opposite of [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot). **Usage** @@ -2124,7 +2153,7 @@ await expect(locator).to_have_values([re.compile(r"R"), re.compile(r"G")]) --- -### to_match_aria_snapshot {#locator-assertions-to-match-aria-snapshot-1} +### to_match_aria_snapshot {#locator-assertions-to-match-aria-snapshot} Added in: v1.49locatorAssertions.to_match_aria_snapshot @@ -2165,13 +2194,13 @@ await expect(page.locator('body')).to_match_aria_snapshot(''' **Arguments** -- `expected` [str]# -- `timeout` [float] *(optional)*# +- `expected` [str]# +- `timeout` [float] *(optional)*# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [NoneType]# +- [NoneType]# [Accessibility]: /api/class-accessibility.mdx "Accessibility" diff --git a/python/versioned_docs/version-stable/aria-snapshots.mdx b/python/versioned_docs/version-stable/aria-snapshots.mdx index b8f73d0293b..f619d02883f 100644 --- a/python/versioned_docs/version-stable/aria-snapshots.mdx +++ b/python/versioned_docs/version-stable/aria-snapshots.mdx @@ -115,7 +115,7 @@ These values are derived from ARIA attributes or calculated based on HTML semant ## Snapshot matching -The [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. +The [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) assertion method in Playwright compares the accessible structure of the locator scope with a predefined aria snapshot template, helping validate the page's state against testing requirements. For the following DOM: diff --git a/python/versioned_docs/version-stable/release-notes.mdx b/python/versioned_docs/version-stable/release-notes.mdx index bb13197cc37..67a2d953de8 100644 --- a/python/versioned_docs/version-stable/release-notes.mdx +++ b/python/versioned_docs/version-stable/release-notes.mdx @@ -11,7 +11,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; ### Aria snapshots -New assertion [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) verifies page structure by comparing to an expected accessibility tree, represented as YAML. +New assertion [expect(locator).to_match_aria_snapshot()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) verifies page structure by comparing to an expected accessibility tree, represented as YAML. ```python page.goto("https://playwright.dev") diff --git a/python/versioned_docs/version-stable/test-runners.mdx b/python/versioned_docs/version-stable/test-runners.mdx index c76130cdc6e..dfbe5818436 100644 --- a/python/versioned_docs/version-stable/test-runners.mdx +++ b/python/versioned_docs/version-stable/test-runners.mdx @@ -257,7 +257,7 @@ See the [guides for CI providers](./ci.mdx) to deploy your tests to CI/CD. ## Async Fixtures -If you want to use async fixtures, you can use the [`pytest-playwright-asyncio`](https://pypi.org/project/pytest-playwright-asyncio/) plugin. Make sure to use `pytest-asyncio>=0.24.0` and make your tests use of [`loop_scope=sesion`](https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/run_session_tests_in_same_loop.html). +If you want to use async fixtures, you can use the [`pytest-playwright-asyncio`](https://pypi.org/project/pytest-playwright-asyncio/) plugin. Make sure to use `pytest-asyncio>=0.24.0` and make your tests use of [`loop_scope=session`](https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/run_session_tests_in_same_loop.html). ```python import pytest