Closed vitalics closed 6 years ago
environment:
visual-regression service settings :
require('babel-register'); const path = require('path'); const VisualRegressionCompare = require('wdio-visual-regression-service/compare'); function getScreenshotName(basePath) { return function(context) { console.dir(context); const type = context.type; const testName = context.step.name; // cucumber step name const browserVersion = parseInt(context.browser.version, 10); const browserName = context.browser.name; const browserWidth = context.meta.width || context.meta.viewport.width; return path.join(basePath, `${testName}_${type}_${browserName}_v${browserVersion}_${browserWidth}.png`); }; } exports.config = { // settings visualRegression: { compare: new VisualRegressionCompare.LocalCompare({ referenceName: getScreenshotName(path.join(process.cwd(), 'screenshots/reference')), screenshotName: getScreenshotName(path.join(process.cwd(), 'screenshots/screen')), diffName: getScreenshotName(path.join(process.cwd(), 'screenshots/diff')), misMatchTolerance: 0.01, }), }, }
project structure before (no screenshot folder):
screenshot folder structure after test execution:
The folder isn't created when there are no diffs ;)
environment:
visual-regression service settings :
project structure before (no screenshot folder):
screenshot folder structure after test execution: