chromediff
v1.0.2
Published
A node.js visual regression test library, compare images by using headless Chrome and resemble.js
Downloads
2
Readme
ChromeDiff
A node.js visual regression test library, compare images by using headless Chrome and resemble.js
Install
npm install chromediff
Usages
Please see tests
Example
let chromeDiff = new ChromeDiff()
let result = await chromeDiff.compare({baseFilePath, newFilePath})
var bitmap = fs.readFileSync(__dirname + '/fixtures/diff.png');
let base64 = new Buffer(bitmap).toString('base64');
assert.equal(false, result.data.isSameDimensions)
assert.equal(13.515779092702171, result.data.rawMisMatchPercentage)
assert.equal(13.52, result.data.misMatchPercentage)
assert.deepEqual({"width": 1, "height": 1}, result.data.dimensionDifference)
assert.deepEqual({"top":0,"left":0,"bottom":259,"right":389}, result.data.diffBounds)
assert(result.data.analysisTime)
assert(!result.diffImgFilePath)
assert.equal(base64, result.imgurl.replace('data:image/png;base64,', ''))
License
MIT