From 17f92f67dea9279d8f885b6d44ca10e98d45e209 Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 10:09:13 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (27-06-25) --- nodejs/docs/test-snapshots.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodejs/docs/test-snapshots.mdx b/nodejs/docs/test-snapshots.mdx index 8ae67f7bd44..1fbe962cc2c 100644 --- a/nodejs/docs/test-snapshots.mdx +++ b/nodejs/docs/test-snapshots.mdx @@ -53,6 +53,9 @@ The snapshot name `example-test-1-chromium-darwin.png` consists of a few parts: The snapshot name and path can be configured with [testConfig.snapshotPathTemplate](/api/class-testconfig.mdx#test-config-snapshot-path-template) 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. @@ -61,9 +64,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