Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install monet
The basic gem requires a config file that is called in an app initializer or via the built-in rake task. This config primarily exists to give the gem a list of paths it needs to collect and either baseline or compare to previous baselines. This config might look something like this:
config = Monet.config do |config| config.driver = :poltergeist config.dimensions = [1440,900] config.map do |map| map.add 'home/index' map.add 'home/show' end # alternatively... config.map :spider end
You can also use a yaml file and load it later
:driver: :poltergeist :dimensions: - 1024 :base_url: "http://lance.com" :compare_type: Highlight :map: - "/" - "/aboutus" - "/littleleague"
You can then use the config to run the capture and comparison toolset:
There are also rake tasks for this
rake run ./config.yaml
Captures are saved into the following structure by default:
- /captures is where the current capture run images are stored, pre-comparison with baseline.
- /baselines is where all current baseline images are stored. persistent in-between capture runs.
You can set these params using the
During the capture process, any new captures that do not have a match found in baselines to compare with are considered new baselines. Any images that match baseline are discarded. Any images that flag differences, are flagged for review.
Review involves checking flagged images and marking as
- flag as issue
- accept as new baseline
- Parallelize PNG diffing
- Rails integration
- Sinatra/Rack integration
- Web UI
- Fork it
- Branch it (
git checkout -b my-new-feature)
- Commit it (
git commit -am 'Add some feature')
- Push it (
git push origin my-new-feature)
- Pull Request it!
Willing to consider commit bit priviledges to anyone who expresses extreme interest in the project.
Big shout to Jeff Kreeftmeijer for his blog post on ChunkyPNG. The Monet::Compare::CompareStrategy code is basically what he wrote in the post.
- https://github.com/intridea/green_onion : Mostly the same thing I did here, but I didn't know about it starting out. I like what they did, but I had a different take, so I decided to pursue my version to the end.
- https://github.com/BBC-News/wraith : Similar idea again, but more limited in features, also doesn't allow for baselining, more of a multi-site/URL compare.