wdio-syngrisi-cucumber-service
v3.19.1
Published
WDIO Service for Syngrisi visual tests using Cucumber
Maintainers
Readme
WDIO Syngrisi Cucumber Service
The service helps integrate WebdriverIO test framework and Syngrisi visual testing platform.
Installation
npm i wdio-syngrisi-cucumber-serviceConfiguration
In order to use the service with WebdriverIO test runner add these settings to services array:
// wdio.conf.js
exports.config = {
// ...
services: [
['syngrisi-cucumber',
{
// syngrisi server endpoint
endpoint: `http://localhost:3000/`,
// syngrisi API key
apikey: process.env['SYNGRISI_API_KEY'] || '',
// project name
project: 'My Project',
// the tested branch
branch: 'master',
// run name (will be auto generated if not present)
runname: process.env['RUN_NAME'],
// run name (will be auto generated if not present)
runident: process.env['RUN_IDENT'],
// tag for visual regression scenarios
// for all scenarios with this tag the service will create session on syngrisi
// if tag is empty the visual session will be created for all scenarios
// tag: '@visual',
// the scenarios with `excludeTag` tag will be skipped
// excludeTag: '@novisual'
}
],
],
// ...
};Usage
After all the preparations, the service adds the following commands to browser:
browser.syngrisiCheck(checkName, imageBuffer, opts, domDump)
checkName- the name of the check in SyngrisiimageBuffer- the screenshot image bufferopts- optional check params (e.g.viewport,browserName,os,app,branch,autoAccept,toleranceThreshold)domDump- optional DOM dump for Root Cause Analysis
Tip: if the page uses webfonts (
font-display: swap), wait for them before taking the screenshot to avoid flaky "shifted text" diffs:await browser.waitUntil(() => browser.execute(() => document.fonts.status === 'loaded'))
browser.getLastBaseline(opts)
Returns the most recent baseline matching opts (e.g. { name, app, branch }), or null if none found.
browser.getSnapshot(opts)
Returns the first snapshot matching opts, or null if none found.
