Tool for testing the UI by comparison screenshots.
Based on JavaScript and HTML5 Canvas.
Current version: 1.0.4
For a live demo, go to http://dev.andreychizh.com/screentest/
var test = new ScreenTest(srcImg, testImg, etalonImg, bounds);
@param {String} srcImg Local path to the images folder.
Attention! There should be a single host for html test page, folder with images
and this ScreenTest library (Constraint of HTML5 security)
@param {String} testImg Name of test screenshot image
@param {String} etalonImg Name of etalon screenshot image
@param {Array|Null} bounds Array of coordinates top-left and right-bottom boundary points of comparison:
[0] - x-axis of left-top point, px
[1] - y-axis of left-top point, px
[2] - x-axis of right-bottom point, px
[3] - y-axis of right-bottom point, px
If no set - compare screenshots with no boundaries.
var test = new ScreenTest('img/test/', 'firefox_test.png', 'firefox_standart.png', [10,10,1430,890]);
The result is displayed in a div element with id="result" in the percentage difference images.
<div id="result">12.46</div>
test.tearDown();
Copyright © Andrey Chizh, 2012