Skip to content

Version Packages #918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions .changeset/neat-regions-smell.md

This file was deleted.

86 changes: 86 additions & 0 deletions packages/visual-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,91 @@
# @wdio/visual-service

## 8.0.0

### Major Changes

- bfe6aca: ## πŸ’₯ BREAKING CHANGES

### πŸ§ͺ Web Screenshot Strategy Now Uses BiDi by Default

#### What was the problem?

Screenshots taken via WebDriver's traditional protocol often lacked precision:

- Emulated devices didn't reflect true resolutions
- Device Pixel Ratio (DPR) was often lost
- Images were cropped or downscaled

#### What changed?

All screenshot-related methods now use the **WebDriver BiDi protocol** by default (if supported by the browser), enabling:

βœ… Native support for emulated and high-DPR devices
βœ… Better fidelity in screenshot size and clarity
βœ… Faster, browser-native screenshots via [`browsingContext.captureScreenshot`](https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot)

The following methods now use BiDi:

- `saveScreen` / `checkScreen`
- `saveElement` / `checkElement`
- `saveFullPageScreen` / `checkFullPageScreen`

#### What’s the impact?

⚠️ **Existing baselines may no longer match.**
Because BiDi screenshots are **sharper** and **match device settings more accurately**, even a small difference in resolution or DPR can cause mismatches.

> If you rely on existing baseline images, you'll need to regenerate them to avoid false positives.

#### Want to keep using the legacy method?

You can disable BiDi screenshots globally or per test using the `enableLegacyScreenshotMethod` flag:

**Globally in `wdio.conf.ts`:**

```ts
import { join } from "node:path";

export const config = {
services: [
[
"visual",
{
baselineFolder: join(process.cwd(), "./localBaseline/"),
debug: true,
formatImageName: "{tag}-{logName}-{width}x{height}",
screenshotPath: join(process.cwd(), ".tmp/"),
enableLegacyScreenshotMethod: true, // πŸ‘ˆ fallback to W3C-based screenshots
},
],
],
};
```

**Or per test:**

```ts
it("should compare an element successfully using legacy screenshots", async function () {
await expect($(".hero__title-logo")).toMatchElementSnapshot(
"legacyScreenshotLogo",
{ enableLegacyScreenshotMethod: true } // πŸ‘ˆ fallback to W3C-based screenshots
);
});
```

## πŸ› Bug Fixes

- βœ… [#916](https://github.com/webdriverio/visual-testing/issues/916): Visual Testing Screenshot Behavior Changed in Emulated Devices

## Committers: 1

- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))

### Patch Changes

- Updated dependencies [bfe6aca]
- webdriver-image-comparison@9.0.0

## 7.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/visual-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@wdio/visual-service",
"author": "Wim Selles - wswebcreation",
"description": "Image comparison / visual regression testing for WebdriverIO",
"version": "7.0.0",
"version": "8.0.0",
"license": "MIT",
"homepage": "https://webdriver.io/docs/visual-testing",
"repository": {
Expand Down
81 changes: 81 additions & 0 deletions packages/webdriver-image-comparison/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,86 @@
# webdriver-image-comparison

## 9.0.0

### Major Changes

- bfe6aca: ## πŸ’₯ BREAKING CHANGES

### πŸ§ͺ Web Screenshot Strategy Now Uses BiDi by Default

#### What was the problem?

Screenshots taken via WebDriver's traditional protocol often lacked precision:

- Emulated devices didn't reflect true resolutions
- Device Pixel Ratio (DPR) was often lost
- Images were cropped or downscaled

#### What changed?

All screenshot-related methods now use the **WebDriver BiDi protocol** by default (if supported by the browser), enabling:

βœ… Native support for emulated and high-DPR devices
βœ… Better fidelity in screenshot size and clarity
βœ… Faster, browser-native screenshots via [`browsingContext.captureScreenshot`](https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot)

The following methods now use BiDi:

- `saveScreen` / `checkScreen`
- `saveElement` / `checkElement`
- `saveFullPageScreen` / `checkFullPageScreen`

#### What’s the impact?

⚠️ **Existing baselines may no longer match.**
Because BiDi screenshots are **sharper** and **match device settings more accurately**, even a small difference in resolution or DPR can cause mismatches.

> If you rely on existing baseline images, you'll need to regenerate them to avoid false positives.

#### Want to keep using the legacy method?

You can disable BiDi screenshots globally or per test using the `enableLegacyScreenshotMethod` flag:

**Globally in `wdio.conf.ts`:**

```ts
import { join } from "node:path";

export const config = {
services: [
[
"visual",
{
baselineFolder: join(process.cwd(), "./localBaseline/"),
debug: true,
formatImageName: "{tag}-{logName}-{width}x{height}",
screenshotPath: join(process.cwd(), ".tmp/"),
enableLegacyScreenshotMethod: true, // πŸ‘ˆ fallback to W3C-based screenshots
},
],
],
};
```

**Or per test:**

```ts
it("should compare an element successfully using legacy screenshots", async function () {
await expect($(".hero__title-logo")).toMatchElementSnapshot(
"legacyScreenshotLogo",
{ enableLegacyScreenshotMethod: true } // πŸ‘ˆ fallback to W3C-based screenshots
);
});
```

## πŸ› Bug Fixes

- βœ… [#916](https://github.com/webdriverio/visual-testing/issues/916): Visual Testing Screenshot Behavior Changed in Emulated Devices

## Committers: 1

- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))

## 8.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/webdriver-image-comparison/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webdriver-image-comparison",
"version": "8.0.0",
"version": "9.0.0",
"author": "Wim Selles - wswebcreation",
"description": "An image compare module that can be used for different NodeJS Test automation frameworks that support the webdriver protocol",
"keywords": [],
Expand Down