BehatPerceptualDiffExtension
A perceptual diff extension for Behat to highlight visual regressions in web applications., (*1)
After each step a screenshot is taken and compared with the screenshot from a previous baseline test run.
Any differences will be highlighted and output in the HTML report for inspection., (*2)
For more on the benefits of perceptual diffs see @bslatkin's great video:, (*3)
http://www.youtube.com/watch?v=UMnZiTL0tUc, (*4)
Getting started
Running everything locally (Mac OS X specific)
Download Selenium2 standalone server package and run the JAR, (*5)
java -jar selenium-server-standalone-2.33.0.jar
Install ImageMagick with Homebrew, (*6)
brew install imagemagick
Install Composer dependencies, (*7)
composer install --dev
Run the example tests, (*8)
cd example && ../vendor/bin/behat --format=pretty,html --out=,report.html
Acknowledgements
-
Brett Slatkin for his brilliant presentation on how they use perceptual diffs at Google.
-
Pete Hunt for his Huxley tool that also inspired this project.
Credits