Skip to content

Instantly share code, notes, and snippets.

@pgwillia
Last active June 6, 2019 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgwillia/0769c420da87888e4c8a17ebbe64cc4a to your computer and use it in GitHub Desktop.
Save pgwillia/0769c420da87888e4c8a17ebbe64cc4a to your computer and use it in GitHub Desktop.
wraith for visual comparison
cd discovery
git checkout master
bundle exec rails s &
wraith history discovery.yml
fg
git checkout upgrade_bootstrap
bundle exec rails s &
wraith latest discovery.yml
##############################################################
##############################################################
# This particular config is intended to demonstrate how
# to use Wraith in 'history' mode, which is best suited to
# making sure your site's appearance remains consistent over
# time.
#
# `wraith history history.yaml` # generate base screenshots
# `wraith latest history.yaml` # take new shots and compare
#
##############################################################
##############################################################
# (required) The engine to run Wraith with. Examples: 'phantomjs', 'casperjs', 'slimerjs'
browser: "phantomjs"
# (required) The domain to take screenshots of.
domains:
discovery: "http://localhost:3000"
# (required) Screen widths (and optional height) to resize the browser to before taking the screenshot.
screen_widths:
- 375x667
- 768x1024
- 360x640
- 414x736
- 375x812
- 320x568
- 360x740
- 414x896
- 412x846
- 834x1112
- 1280x950
- 1440x900
- 1920x1080
paths:
home: /
advanced: /advanced
catalog: /?q=shakespeare
bookmarks: /bookmarks
finding_aid: /catalog/4072071
email: /catalog/email?id=4072071
citation: /catalog/citation?id=4072071
journal: /catalog/954921332003
# (required for history mode, otherwise optional) The directory that your base screenshots will be stored in.
history_dir: 'shots_base'
# (required) The directory that your latest screenshots will be stored in
directory: 'shots'
# (required) Amount of fuzz ImageMagick will use when comparing images. A higher fuzz makes the comparison less strict.
fuzz: '20%'
threshold: 5
mode: diffs_first
# (optional) Choose to run Wraith in verbose mode, for easier debugging. Default: false
verbose: true
source 'https://rubygems.org'
gem 'wraith'
sudo apt-get install phantomjs
bundle install
wraith setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment