|
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 |
|
0 commit comments