Skip to content

Commit b74b398

Browse files
chore: release [skip ci] (#918)
Co-authored-by: WebdriverIO Release Bot <bot@webdriver.io>
1 parent bfe6aca commit b74b398

File tree

5 files changed

+169
-84
lines changed

5 files changed

+169
-84
lines changed

.changeset/neat-regions-smell.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

packages/visual-service/CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
11
# @wdio/visual-service
22

3+
## 8.0.0
4+
5+
### Major Changes
6+
7+
- bfe6aca: ## 💥 BREAKING CHANGES
8+
9+
### 🧪 Web Screenshot Strategy Now Uses BiDi by Default
10+
11+
#### What was the problem?
12+
13+
Screenshots taken via WebDriver's traditional protocol often lacked precision:
14+
15+
- Emulated devices didn't reflect true resolutions
16+
- Device Pixel Ratio (DPR) was often lost
17+
- Images were cropped or downscaled
18+
19+
#### What changed?
20+
21+
All screenshot-related methods now use the **WebDriver BiDi protocol** by default (if supported by the browser), enabling:
22+
23+
✅ Native support for emulated and high-DPR devices
24+
✅ Better fidelity in screenshot size and clarity
25+
✅ Faster, browser-native screenshots via [`browsingContext.captureScreenshot`](https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot)
26+
27+
The following methods now use BiDi:
28+
29+
- `saveScreen` / `checkScreen`
30+
- `saveElement` / `checkElement`
31+
- `saveFullPageScreen` / `checkFullPageScreen`
32+
33+
#### What’s the impact?
34+
35+
⚠️ **Existing baselines may no longer match.**
36+
Because BiDi screenshots are **sharper** and **match device settings more accurately**, even a small difference in resolution or DPR can cause mismatches.
37+
38+
> If you rely on existing baseline images, you'll need to regenerate them to avoid false positives.
39+
40+
#### Want to keep using the legacy method?
41+
42+
You can disable BiDi screenshots globally or per test using the `enableLegacyScreenshotMethod` flag:
43+
44+
**Globally in `wdio.conf.ts`:**
45+
46+
```ts
47+
import { join } from "node:path";
48+
49+
export const config = {
50+
services: [
51+
[
52+
"visual",
53+
{
54+
baselineFolder: join(process.cwd(), "./localBaseline/"),
55+
debug: true,
56+
formatImageName: "{tag}-{logName}-{width}x{height}",
57+
screenshotPath: join(process.cwd(), ".tmp/"),
58+
enableLegacyScreenshotMethod: true, // 👈 fallback to W3C-based screenshots
59+
},
60+
],
61+
],
62+
};
63+
```
64+
65+
**Or per test:**
66+
67+
```ts
68+
it("should compare an element successfully using legacy screenshots", async function () {
69+
await expect($(".hero__title-logo")).toMatchElementSnapshot(
70+
"legacyScreenshotLogo",
71+
{ enableLegacyScreenshotMethod: true } // 👈 fallback to W3C-based screenshots
72+
);
73+
});
74+
```
75+
76+
## 🐛 Bug Fixes
77+
78+
-[#916](https://github.com/webdriverio/visual-testing/issues/916): Visual Testing Screenshot Behavior Changed in Emulated Devices
79+
80+
## Committers: 1
81+
82+
- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
83+
84+
### Patch Changes
85+
86+
- Updated dependencies [bfe6aca]
87+
- webdriver-image-comparison@9.0.0
88+
389
## 7.0.0
490

591
### Major Changes

packages/visual-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@wdio/visual-service",
33
"author": "Wim Selles - wswebcreation",
44
"description": "Image comparison / visual regression testing for WebdriverIO",
5-
"version": "7.0.0",
5+
"version": "8.0.0",
66
"license": "MIT",
77
"homepage": "https://webdriver.io/docs/visual-testing",
88
"repository": {

packages/webdriver-image-comparison/CHANGELOG.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,86 @@
11
# webdriver-image-comparison
22

3+
## 9.0.0
4+
5+
### Major Changes
6+
7+
- bfe6aca: ## 💥 BREAKING CHANGES
8+
9+
### 🧪 Web Screenshot Strategy Now Uses BiDi by Default
10+
11+
#### What was the problem?
12+
13+
Screenshots taken via WebDriver's traditional protocol often lacked precision:
14+
15+
- Emulated devices didn't reflect true resolutions
16+
- Device Pixel Ratio (DPR) was often lost
17+
- Images were cropped or downscaled
18+
19+
#### What changed?
20+
21+
All screenshot-related methods now use the **WebDriver BiDi protocol** by default (if supported by the browser), enabling:
22+
23+
✅ Native support for emulated and high-DPR devices
24+
✅ Better fidelity in screenshot size and clarity
25+
✅ Faster, browser-native screenshots via [`browsingContext.captureScreenshot`](https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot)
26+
27+
The following methods now use BiDi:
28+
29+
- `saveScreen` / `checkScreen`
30+
- `saveElement` / `checkElement`
31+
- `saveFullPageScreen` / `checkFullPageScreen`
32+
33+
#### What’s the impact?
34+
35+
⚠️ **Existing baselines may no longer match.**
36+
Because BiDi screenshots are **sharper** and **match device settings more accurately**, even a small difference in resolution or DPR can cause mismatches.
37+
38+
> If you rely on existing baseline images, you'll need to regenerate them to avoid false positives.
39+
40+
#### Want to keep using the legacy method?
41+
42+
You can disable BiDi screenshots globally or per test using the `enableLegacyScreenshotMethod` flag:
43+
44+
**Globally in `wdio.conf.ts`:**
45+
46+
```ts
47+
import { join } from "node:path";
48+
49+
export const config = {
50+
services: [
51+
[
52+
"visual",
53+
{
54+
baselineFolder: join(process.cwd(), "./localBaseline/"),
55+
debug: true,
56+
formatImageName: "{tag}-{logName}-{width}x{height}",
57+
screenshotPath: join(process.cwd(), ".tmp/"),
58+
enableLegacyScreenshotMethod: true, // 👈 fallback to W3C-based screenshots
59+
},
60+
],
61+
],
62+
};
63+
```
64+
65+
**Or per test:**
66+
67+
```ts
68+
it("should compare an element successfully using legacy screenshots", async function () {
69+
await expect($(".hero__title-logo")).toMatchElementSnapshot(
70+
"legacyScreenshotLogo",
71+
{ enableLegacyScreenshotMethod: true } // 👈 fallback to W3C-based screenshots
72+
);
73+
});
74+
```
75+
76+
## 🐛 Bug Fixes
77+
78+
-[#916](https://github.com/webdriverio/visual-testing/issues/916): Visual Testing Screenshot Behavior Changed in Emulated Devices
79+
80+
## Committers: 1
81+
82+
- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
83+
384
## 8.0.0
485

586
### Major Changes

packages/webdriver-image-comparison/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webdriver-image-comparison",
3-
"version": "8.0.0",
3+
"version": "9.0.0",
44
"author": "Wim Selles - wswebcreation",
55
"description": "An image compare module that can be used for different NodeJS Test automation frameworks that support the webdriver protocol",
66
"keywords": [],

0 commit comments

Comments
 (0)