Update docs/src/aria-snapshots.md

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
Signed-off-by: Simon Knott <info@simonknott.de>
This commit is contained in:
Simon Knott 2025-02-26 14:30:34 +01:00 committed by GitHub
parent 8e631b2c4d
commit 9f80c3c3e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -342,7 +342,7 @@ npx playwright test --update-snapshots --update-source-mode=3way
To store your snapshots in a separate file, use the `toMatchAriaSnapshot` method with the `name` option, specifying a `.snapshot.yml` file extension.
```js
await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main-snapshot.snapshot.yml' });
await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.snapshot.yml' });
```
By default, snapshots from a test file `example.spec.ts` are placed in the `example.spec.ts-snapshots` directory. As snapshots should be the same across browsers, only one snapshot is saved even if testing with multiple browsers. Should you wish, you can customize the [snapshot path template](./api/class-testconfig#test-config-snapshot-path-template) using the following configuration: