@wdio/visual-service 9.2.4 → 10.0.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 +52 -0
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @wdio/visual-service
2
2
 
3
+ ## 10.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - d2758ce: ### 💥 Breaking change: new image comparison engine
8
+
9
+ We replaced the engine that powers every visual comparison. This is a breaking change, so please read the migration note below before upgrading.
10
+
11
+ **The problem**
12
+
13
+ Visual tests were flaky. Tests failed on differences that are impossible to see by eye, like sub-pixel font rendering, 1px anti-aliasing on edges and small shadow shifts between runs. The old engine (resemble.js) compared raw RGB values, which does not match how human vision works, and on larger screenshots it quietly skipped about a third of the pixels. So you got failures that were not real, and in some cases real changes that could slip through.
14
+
15
+ On top of that, all the image handling (decode, crop, composite, rotate, resize) ran through [`jimp`](https://github.com/jimp-dev/jimp), a large dependency that we only used a small slice of and that is no longer actively maintained.
16
+
17
+ **The solution**
18
+
19
+ Two things changed under the hood:
20
+
21
+ 1. The comparison engine is now [pixelmatch](https://github.com/mapbox/pixelmatch). It compares images the way the eye perceives them (in the YIQ colour space) and detects anti-aliasing by checking both images at once. Invisible rendering noise now passes, and real regressions still fail.
22
+ 2. `jimp` has been removed completely. PNG decode and encode now go through the small [`fast-png`](https://github.com/image-js/fast-png) library, and the handful of image operations we still need (crop, composite, canvas, opacity, rotate, resize) live in a tiny internal helper. The bundled resemble file is gone too. The net effect is a much lighter dependency footprint with no loss in functionality.
23
+
24
+ **What you need to do**
25
+
26
+ - Your public API does not change. `checkScreen`, `checkElement`, `checkFullPageScreen` and the matchers all work exactly as before, and the same `ignore` options are supported.
27
+ - Because the new engine measures differences differently, mismatch percentages will not match the old numbers exactly. You should re-run your suite once and re-accept your baselines so they are generated with the new engine. After that your tests should be noticeably more stable.
28
+
29
+ **Also fixed in this release**
30
+
31
+ - **Top-row artifact on full page screenshots:** Jimp's `contain()` centred the image, shifting content by 1px and creating a false diff across the top row. Replaced with buffer-level padding that anchors content at (0,0).
32
+ - **Ignored region 1px under-coverage:** The device-pixel size of an ignored region used `Math.floor`, which could drop a pixel when `cssSize * DPR` had a fractional part. Width and height now use `Math.ceil` so the full element is always covered. Position still uses `Math.floor`.
33
+ - **Comparison sensitivity matches what you were used to:** Switching engines meant retuning how strict a comparison is. The pixelmatch threshold is now aligned with the old resemble tolerances, so a difference that used to fail still fails and one that used to pass still passes. The diff highlight also uses a single consistent colour instead of varying per run.
34
+ - **Different image sizes no longer crash the comparison:** When a baseline and the actual screenshot had slightly different dimensions, the old flow threw an error and you lost the result. Both images are now normalised to the same size before they are compared, so a size change is reported as a visual difference you can review instead of a hard failure.
35
+ - **More reliable ignore regions with WebDriver BiDi:** With BiDi the calculated element bounds can be off by a pixel or two, which sometimes left part of an ignored element just outside the ignored area and caused a false diff. The BiDi emulated flow now uses a larger `ignoreRegionPadding` so the whole element stays covered.
36
+
37
+ ### Committers: 1
38
+
39
+ - Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
40
+
41
+ ### Patch Changes
42
+
43
+ - 6cd5742: ### Dependency updates
44
+
45
+ Updated dependencies across all packages to their latest compatible versions. This includes the WebdriverIO toolchain (`webdriverio`, `@wdio/*`) to `9.29.1`, the TypeScript ESLint plugins to `8.62.0`, Vitest to `3.2.6`, and various other packages such as `sharp`, `@remix-run/*`, `fuse.js` and `expect-webdriverio`. There are no functional or API changes.
46
+
47
+ ### Committers: 1
48
+
49
+ - Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
50
+
51
+ - Updated dependencies [d2758ce]
52
+ - Updated dependencies [6cd5742]
53
+ - @wdio/image-comparison-core@2.0.0
54
+
3
55
  ## 9.2.4
4
56
 
5
57
  ### 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": "9.2.4",
5
+ "version": "10.0.0",
6
6
  "license": "MIT",
7
7
  "homepage": "https://webdriver.io/docs/visual-testing",
8
8
  "repository": {
@@ -20,11 +20,11 @@
20
20
  "type": "module",
21
21
  "types": "./dist/index.d.ts",
22
22
  "dependencies": {
23
- "@wdio/globals": "^9.27.0",
24
- "@wdio/logger": "^9.18.0",
25
- "@wdio/types": "^9.27.0",
26
- "expect-webdriverio": "^5.6.5",
27
- "@wdio/image-comparison-core": "1.2.4"
23
+ "@wdio/globals": "^9.29.1",
24
+ "@wdio/logger": "^9.29.1",
25
+ "@wdio/types": "^9.29.1",
26
+ "expect-webdriverio": "^5.6.9",
27
+ "@wdio/image-comparison-core": "2.0.0"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "run-s clean build:*",