docs: move note (#36432)

This commit is contained in:
Patrik Csak 2025-06-26 09:31:31 -07:00 committed by GitHub
parent 216e6be464
commit 56ccccddb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,6 +50,9 @@ The snapshot name `example-test-1-chromium-darwin.png` consists of a few parts:
The snapshot name and path can be configured with [`property: TestConfig.snapshotPathTemplate`] in the playwright config.
> Note that `toHaveScreenshot()` also accepts an array of path segments to the snapshot file such as `expect().toHaveScreenshot(['relative', 'path', 'to', 'snapshot.png'])`.
> However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`), otherwise it will throw.
## Updating screenshots
Sometimes you need to update the reference screenshot, for example when the page has changed. Do this with the `--update-snapshots` flag.
@ -58,9 +61,6 @@ Sometimes you need to update the reference screenshot, for example when the page
npx playwright test --update-snapshots
```
> Note that `snapshotName` also accepts an array of path segments to the snapshot file such as `expect().toHaveScreenshot(['relative', 'path', 'to', 'snapshot.png'])`.
> However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`), otherwise it will throw.
## Options
### maxDiffPixels