Cucumber-snapshot is a project mainly written in Ruby, it's free.
take screenshots of browser and compare them to check nothing changed
The purpose of this tool is to make the design of the website doesn't change even after a tiny change in HTML / CSS / Javascript. Cucumber is great to test the Website behave in defined way. Great but not enough ! What if an unclose div completely breaks the layout of your homepage? Do you think it is well tested ? I don't.
gem install cucumber-snapshot
OR in your Gemfile (if using Bundler):
gem 'cucumber-snapshot', :git=>'https://github.com/NNA/cucumber-snapshot'
require 'cucumber-snapshot/cucumber_hooks'
bundle exec cucumber -t @snapshot
cucumber-snapshot comes with some cucumber steps that you can use to take snapshots of your pages (see examples):
Given I am logged with email "[email protected]"
When I go to the home page
And I take a snapshot #Will take a snapshot of current page
or you can use the @snap_capture tag
@snap_capture #Will take a snapshot at the When page
Given I am logged with email "[email protected]"
When I go to the home page
snapshots are :
@snap_capture @snap_compare #Will take a snapshot of When page and compare. Will fail if differences are > 5%
Given I am logged with email "[email protected]"
When I go to the home page
And I take a snapshot at (x,y) and (x,y) # Will take a snapshot of current page of the square calculated with 2 points
@snap_capture @snap_compare_5 #Will take a snapshot at the When page. Will fail if differences are > 5%
Given I am logged with email "[email protected]"
When I go to the home page