OCR Testing Service
@wdio/ocr-service is a 3rd party package, for more information please see GitHub | npm
For documentation on visual testing with WebdriverIO, please refer to the docs. This project contains all relevant modules for running visual tests with WebdriverIO. Within the ./packages directory you will find:
@wdio/visual-service: the WebdriverIO service for integrating visual testing@wdio/image-comparison-core: the core image comparison engine used by the service@wdio/ocr-service: the WebdriverIO service for OCR-based testing@wdio/visual-reporter: the HTML report generator for visual testing results
Versions & Support
| Version | npm tag | Status | Supported until |
|---|---|---|---|
v10 — @wdio/visual-service@10 / @wdio/image-comparison-core@2 | latest | ✅ Active development | — |
v9 — @wdio/visual-service@9 / @wdio/image-comparison-core@1 | legacy | 🛠️ Maintenance (critical fixes only) | 12 months after the v10 release |
[!IMPORTANT] v10 replaces the image comparison engine (resemble.js → pixelmatch). The public API is unchanged, but mismatch percentages differ slightly, so you need to re-accept your baselines once after upgrading.
Staying on v9
v9 receives critical bug and security fixes only for 12 months after the v10 release. Pin it with a semver range, which always resolves to the v9 line regardless of npm tags:
npm install @wdio/visual-service@^9
Once v9 maintenance releases are published, they are also available under the legacy tag:
npm install @wdio/visual-service@legacy
Installing without a version (npm install @wdio/visual-service) always gives you the latest v10.
Upgrading from v9 to v10
- Install the latest:
npm install @wdio/visual-service@latest. - Re-run your suite once and re-accept the baselines so they are regenerated with the new engine.
- No code changes are required —
checkScreen,checkElement,checkFullPageScreenand the matchers keep the same signatures andignoreoptions.
When v9 reaches end of life it will be marked deprecated on npm.
Storybook Runner (BETA)
Click to find out more documentation about the Storybook Runner BETA
Storybook Runner is still in BETA, the docs will later move to the WebdriverIO documentation pages.
This module now supports Storybook with a new Visual Runner. This runner automatically scans for a local/remote storybook instance and will create element screenshots of each component. This can be done by adding
export const config: WebdriverIO.Config = {
// ...
services: ["visual"],
// ....
};
to your services and running npx wdio tests/configs/wdio.local.desktop.storybook.conf.ts --storybook through the command line.
It will use Chrome in headless mode as the default browser.
[!NOTE]
- Most of the Visual Testing options will also work for the Storybook Runner, see the WebdriverIO documentation.
- The Storybook Runner will overwrite all your capabilities and can only run on the browsers that it supports, see
--browsers.- The Storybook Runner does not support an existing config that uses Multiremote capabilities and will throw an error.
- The Storybook Runner only supports Desktop Web, not Mobile Web.