Created
March 22, 2016 09:27
-
-
Save JiggyPete/4b1d2c29dc5ceb7c13a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisit: ImageMagick installed | |
def file_exists?(filename) | |
`[ -f #{filename} ] && echo "Found" || echo "Not found"` == "Not found\n" | |
end | |
['landing'].each do |screengrab_file_name| | |
before = screengrab_file_name + '_before.png' | |
after = screengrab_file_name + '_after.png' | |
difference = screengrab_file_name + '_difference.png' | |
if( file_exists?(before) ) | |
puts before + " not found" | |
elsif( file_exists?(after) ) | |
puts after + " not found" | |
else | |
puts `compare -highlight-color yellow -fuzz 3% #{before} #{after} results/#{difference}` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment