From 8d869ec61404f3b1a0c9e6e8c4f6cc0e66bd3812 Mon Sep 17 00:00:00 2001 From: Debbie O'Brien Date: Mon, 27 Jan 2025 22:19:09 +0100 Subject: [PATCH] docs: update usage examples for toMatchAriaSnapshot in locator assertions --- docs/src/api/class-locatorassertions.md | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index 8f8233fae4..dfd65cdf76 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -2249,23 +2249,6 @@ Asserts that the target element matches the given [accessibility snapshot](../ar ```js await expect(page.locator('body')).toMatchAriaSnapshot(); -await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'snapshot' }); -``` - -```python async -await expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml') -``` - -```python sync -expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml') -``` - -```csharp -await Expect(page.Locator("body")).ToMatchAriaSnapshotAsync(new { Path = "/path/to/snapshot.yml" }); -``` - -```java -assertThat(page.locator("body")).matchesAriaSnapshot(new LocatorAssertions.MatchesAriaSnapshotOptions().setPath("/path/to/snapshot.yml")); ``` ### option: LocatorAssertions.toMatchAriaSnapshot#2.name @@ -2276,6 +2259,12 @@ assertThat(page.locator("body")).matchesAriaSnapshot(new LocatorAssertions.Match Name of the snapshot to store in the snapshot (screenshot) folder corresponding to this test. Generates sequential names if not specified. +**Usage** + +```js +await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'snapshot.yml' }); +``` + ### option: LocatorAssertions.toMatchAriaSnapshot#2.timeout = %%-js-assertions-timeout-%% * since: v1.50