mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: move note (#36432)
This commit is contained in:
parent
216e6be464
commit
56ccccddb8
@ -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.
|
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
|
## Updating screenshots
|
||||||
|
|
||||||
Sometimes you need to update the reference screenshot, for example when the page has changed. Do this with the `--update-snapshots` flag.
|
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
|
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
|
## Options
|
||||||
|
|
||||||
### maxDiffPixels
|
### maxDiffPixels
|
||||||
|
Loading…
x
Reference in New Issue
Block a user