You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box.
@@ -473,7 +476,7 @@ Note that screenshot assertions only work with Playwright test runner.
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`.
479
+
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`. This option is used by "pixelmatch" image comparator.
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box.
@@ -526,7 +532,7 @@ Note that screenshot assertions only work with Playwright test runner.
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`.
535
+
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`. This option is used by "pixelmatch" image comparator.
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`.
96
+
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`. This option is used by "pixelmatch" image comparator.
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`.
169
+
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`. This option is used by "pixelmatch" image comparator.
An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default.
@@ -60,7 +63,7 @@ Note that matching snapshots only work with Playwright test runner.
60
63
An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default.
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`.
66
+
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`. This option is used by "pixelmatch" image comparator.
64
67
65
68
---
66
69
@@ -94,6 +97,9 @@ Note that matching snapshots only work with Playwright test runner.
An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default.
@@ -105,7 +111,7 @@ Note that matching snapshots only work with Playwright test runner.
105
111
Snapshot name. If not passed, the test name and ordinals are used when called multiple times.
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`.
114
+
An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`. Defaults to `0.2`. This option is used by "pixelmatch" image comparator.
Default timeout for async expect matchers in milliseconds, defaults to 5000ms.
120
120
-`toHaveScreenshot`[Object]*(optional)*
121
+
-`comparator`[string]*(optional)*
122
+
123
+
a comparator function to use, either `"pixelmatch"` or `"ssim-cie94"`. Defaults to `"pixelmatch"`.
121
124
-`threshold`[number]*(optional)*
122
125
123
-
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
126
+
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`. This option is used by `pixelmatch` image comparator.
124
127
-`maxDiffPixels`[number]*(optional)*
125
128
126
129
an acceptable amount of pixels that could be different, unset by default.
Configuration for the [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1) method.
141
144
-`toMatchSnapshot`[Object]*(optional)*
145
+
-`comparator`[string]*(optional)*
146
+
147
+
a comparator function to use, either `"pixelmatch"` or `"ssim-cie94"`. Defaults to `"pixelmatch"`.
142
148
-`threshold`[number]*(optional)*
143
149
144
-
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
150
+
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`. This option is used by `pixelmatch` image comparator.
145
151
-`maxDiffPixels`[number]*(optional)*
146
152
147
153
an acceptable amount of pixels that could be different, unset by default.
Copy file name to clipboardExpand all lines: nodejs/docs/api/class-testproject.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,9 +181,12 @@ testProject.expect
181
181
182
182
Default timeout for async expect matchers in milliseconds, defaults to 5000ms.
183
183
-`toHaveScreenshot`[Object]*(optional)*
184
+
-`comparator`[string]*(optional)*
185
+
186
+
a comparator function to use, either `"pixelmatch"` or `"ssim-cie94"`. Defaults to `"pixelmatch"`.
184
187
-`threshold`[number]*(optional)*
185
188
186
-
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
189
+
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`. This option is used by `pixelmatch` image comparator.
187
190
-`maxDiffPixels`[number]*(optional)*
188
191
189
192
an acceptable amount of pixels that could be different, unset by default.
@@ -202,9 +205,12 @@ testProject.expect
202
205
203
206
Configuration for the [expect(page).toHaveScreenshot()](/api/class-pageassertions.mdx#page-assertions-to-have-screenshot-1) method.
204
207
-`toMatchSnapshot`[Object]*(optional)*
208
+
-`comparator`[string]*(optional)*
209
+
210
+
a comparator function to use, either `"pixelmatch"` or `"ssim-cie94"`. Defaults to `"pixelmatch"`.
205
211
-`threshold`[number]*(optional)*
206
212
207
-
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
213
+
an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`. This option is used by `pixelmatch` image comparator.
208
214
-`maxDiffPixels`[number]*(optional)*
209
215
210
216
an acceptable amount of pixels that could be different, unset by default.
Copy file name to clipboardExpand all lines: nodejs/docs/test-reporters.mdx
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -457,7 +457,53 @@ Or if there is a custom folder name:
457
457
npx playwright show-report my-report
458
458
```
459
459
460
-
> The `html` reporter currently does not support merging reports generated across multiple [`--shards`](./test-parallel.mdx#shard-tests-between-multiple-machines) into a single report. See [this](https://github.com/microsoft/playwright/issues/10437) issue for available third party solutions.
460
+
#### Sharded report
461
+
462
+
When running tests on [multiple shards](./test-parallel.mdx#shard-tests-between-multiple-machines), the `html` reporter can automatically show test results from all shards in one page when configured with `sharded: true`.
You can use sharded html report combined with a file hosting that allows serving html files.
501
+
502
+
In your CI recipe, after running tests in each shard, upload all files from `playwright-report` directory to the **same location**. After that you can open `index.html` from the uploaded location directly in the browser.
503
+
504
+
:::note
505
+
The `html` report for each shard consists of `index.html` and a data file named like `report-003-of-100.zip`. It's ok to overwrite `index.html` with one another when copying sharded reports to a single directory.
0 commit comments