A library that compares between screenshots and their baselines and outputs their diff. Operates on entire directory
The test reads each image in the baselines directory and finds the correlating one in screenshots.
So if you have a new screenshot without baseline, it will be ignored.
If you have a baseline without a screenshot, it will fail.
Note: supports only png files.
imagedir-diff --screenshots tests/images/screenshots --baselines tests/images/baselines --diffs tests/images/diffsWill print all passed images and all failed images. For example:
{
"passed": [
"download.png",
"logo.png",
"hello.png"
],
"failed": []
}Will exit with code 0 if all passed. Otherwise with exit code 1
var imagedirDiff = require('imagedir-diff');
imagedirDiff( {
diffs: 'tests/images/diffs',
screenshots: 'tests/images/screenshots',
baselines: 'tests/images/baselines'
} )- screenshots - Directory for new screenshots taken. default:
tests/images/screenshots - baselines - Directory for baseline images. default:
tests/images/baselines - diffs - Directory to output diffs. default:
tests/images/diffs