= Gatling Gatling Comparison allows one to build an Rspec / Capybara custom matcher comparing a :css or :xpath element to a referenced screenshot. ------------------------------------- Usage: Identify an element to match, for example: @element = page.find(:css, #button) Use Gatling's custom matcher and specify the reference image: @element.should look_like('button_ref.png') Gatling will take care of cropping the element and try and make a targeted match without the noise of the whole page. If the matcher fails, the test will fail, an exception will be raised and both a diff image and a new candidate image will be created. If no reference image exits, the test will fail, an exception will be raised and a candidate will be created which can be used as a reference. ------------------------------------- Usage, training mode: Gatling can be run in training mode which will create all the initial reference images. CAUTION: Trainer mode will pass all the test which rely on the Gatling custom matcher. Please make sure you are saving 'clean' references. To set trainer mode, prefix rspec with $GATLING_TRAINER = true Example: $GATLING_TRAINER = true rspec spec/my_spec.rb ------------------------------------- Non-gem dependencies: Imagemagick must be installed: $sudo apt-get install imagemagick ------------------------------------- == Contributing to gatling * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it * Fork the project * Start a feature/bugfix branch * Commit and push until you are happy with your contribution * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. == Copyright Copyright (c) 2011 Gabriel Rotbart, Amanda Koh. See LICENSE.txt for further details.