@wdio/visual-service 10.0.1 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,110 @@
1
1
  # @wdio/visual-service
2
2
 
3
+ ## 10.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b194642: fix: ignore\* option parity with resemble (pixelmatch)
8
+
9
+ After v10 switched to pixelmatch, the public `ignore*` API did not fully match resemble.js preset behaviour. Combined modes such as `ignoreLess` with the default `ignoreAntialiasing: true` still inherited AA forgiveness, and `ignoreColors` used BT.601 grayscale instead of resemble brightness-only comparison.
10
+
11
+ This release also adds `compareOptions.pixelmatch` so you can pass pixelmatch settings directly instead of using `ignore*` presets.
12
+
13
+ **What changed**
14
+
15
+ - Multiple `ignore*` flags now follow resemble last-wins ordering (`ignoreAlpha` → `ignoreAntialiasing` → `ignoreColors` → `ignoreLess` → `ignoreNothing`) instead of composing independently
16
+ - `ignoreLess`, `ignoreAlpha`, `ignoreColors`, and `ignoreNothing` now apply their own threshold and AA rules when active; they no longer inherit default `ignoreAntialiasing: true` forgiveness
17
+ - `ignoreColors` now compares brightness only using resemble luma weights (`0.3/0.59/0.11`), matching resemble v9 behaviour
18
+ - WDIO logs a warning when multiple `ignore*` flags are enabled, naming which preset wins
19
+ - New `compareOptions.pixelmatch` object for direct pixelmatch control (`threshold`, `includeAA`, `diffColor`, `aaColor`, `diffColorAlt`, `alpha`, `diffMask`, `checkerboard`)
20
+
21
+ **Preset reference**
22
+
23
+ | Active preset | threshold | AA forgiven |
24
+ | ------------------------------ | --------- | -------------------- |
25
+ | `ignoreNothing` | 0 | no |
26
+ | `ignoreLess` | ~16/255 | no |
27
+ | `ignoreColors` | ~16/255 | no (brightness only) |
28
+ | `ignoreAlpha` | ~16/255 | no |
29
+ | `ignoreAntialiasing` (default) | ~32/255 | yes |
30
+
31
+ **Using `compareOptions.pixelmatch`**
32
+
33
+ Set it in your service config or on a single `check*` call. Do not put `ignore*` keys and `pixelmatch` on the same options object; that throws, even when an `ignore*` flag is `false`. Service config and method options are separate objects, so a method call can override the service compare mode for that check (a warning is logged when the mode switches).
34
+
35
+ Service config:
36
+
37
+ ```js
38
+ // wdio.conf.js
39
+ services: [
40
+ [
41
+ "visual",
42
+ {
43
+ compareOptions: {
44
+ pixelmatch: {
45
+ threshold: 0.063,
46
+ includeAA: true,
47
+ },
48
+ },
49
+ },
50
+ ],
51
+ ];
52
+ ```
53
+
54
+ Method override when the service uses `ignore*` presets:
55
+
56
+ ```js
57
+ await browser.checkScreen("homepage", {
58
+ pixelmatch: { threshold: 0.05 },
59
+ });
60
+ ```
61
+
62
+ Method override when the service uses `pixelmatch`:
63
+
64
+ ```js
65
+ await browser.checkScreen("homepage", {
66
+ ignoreLess: true,
67
+ });
68
+ ```
69
+
70
+ Invalid (throws):
71
+
72
+ ```js
73
+ compareOptions: {
74
+ ignoreLess: false,
75
+ pixelmatch: { threshold: 0.063 },
76
+ }
77
+ ```
78
+
79
+ See [pixelmatch](https://github.com/mapbox/pixelmatch) for option details.
80
+
81
+ **What you need to do**
82
+
83
+ - No change needed if you use a single `ignore*` flag or rely on defaults (`ignoreAntialiasing: true`)
84
+ - Set `ignoreAntialiasing: false` when anti-aliased pixels should count as differences
85
+ - If you combine multiple `ignore*` flags, review your tests; last-wins ordering now matches resemble v9
86
+ - If you use `ignoreColors`, results may differ slightly from early v10 but align with resemble v9
87
+ - To tune pixelmatch directly, add `compareOptions.pixelmatch` in your service config or pass `pixelmatch` on individual `check*` calls
88
+
89
+ ### Patch Changes
90
+
91
+ - b194642: chore: dependency updates
92
+
93
+ Updated dependencies to their latest compatible versions:
94
+
95
+ - `@wdio/visual-service`: `expect-webdriverio` to `^5.7.0`
96
+ - `@wdio/visual-reporter`: `sharp` to `^0.35.3`
97
+ - Dev tooling: `@typescript-eslint/*` to `^8.63.0`, `vitest` to `^3.2.7`, `eslint` to `^9.39.5`, plus minor bumps for `postcss`, `react-icons`, and `isbot` in the reporter package
98
+
99
+ No functional or API changes.
100
+
101
+ ### Committers: 1
102
+
103
+ - Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
104
+
105
+ - Updated dependencies [b194642]
106
+ - @wdio/image-comparison-core@2.1.0
107
+
3
108
  ## 10.0.1
4
109
 
5
110
  ### Patch Changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wdio/visual-service",
3
3
  "author": "Wim Selles - wswebcreation",
4
4
  "description": "Image comparison / visual regression testing for WebdriverIO",
5
- "version": "10.0.1",
5
+ "version": "10.1.0",
6
6
  "license": "MIT",
7
7
  "homepage": "https://webdriver.io/docs/visual-testing",
8
8
  "repository": {
@@ -23,8 +23,8 @@
23
23
  "@wdio/globals": "^9.29.1",
24
24
  "@wdio/logger": "^9.29.1",
25
25
  "@wdio/types": "^9.29.1",
26
- "expect-webdriverio": "^5.6.9",
27
- "@wdio/image-comparison-core": "2.0.1"
26
+ "expect-webdriverio": "^5.7.0",
27
+ "@wdio/image-comparison-core": "2.1.0"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "run-s clean build:*",