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-testing
: the WebdriverIO service for integrating visual testingwebdriver-image-comparison
: An image compare module that can be used for different NodeJS Test automation frameworks that support the WebDriver protocol
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.
Storybook Runner Service Options
Service options can be provided like this
export const config: WebdriverIO.Config = {
// ...
services: [
[
'visual',
{
// Some default options
baselineFolder: join(process.cwd(), './__snapshots__/'),
debug: true,
// The storybook options, see cli options for the description
storybook: {
clip: false,
clipSelector: ''#some-id,
numShards: 4,
// `skipStories` can be a string ('example-button--secondary'),
// an array (['example-button--secondary', 'example-button--small'])
// or a regex which needs to be provided as as string ("/.*button.*/gm")
skipStories: ['example-button--secondary', 'example-button--small'],
url: 'https://www.bbc.co.uk/iplayer/storybook/',
version: 6,
},
},
],
],
// ....
}