Requirements

It's up to you to decide which browser engine you want to run it against. PhantomJS and SlimerJS are the browsers that capture the screenshots, CasperJS is a layer on top of these to aid in target selectors for capturing a particular component.

PhantomJS is built on top of Webkit and JavascriptCore (like Safari). SlimerJS is built on top of Gecko and SpiderMonkey (like Firefox).

PLEASE NOTE - Wraith doesn't support SlimerJS out of the box. To use it, you'll need to specify your own snap file, and implement your own support for `before_capture` hooks, etc. If you'd like to see Wraith provide dedicated support for SlimerJS, please +1 the open issue on GitHub.


Install on OSX

On Mac OS X, the best way to install dependencies is if you have Homebrew. It is the quickest way to install PhantomJS & ImageMagick.

          
brew install imagemagick
brew install phantomjs # or `brew install casperjs` or `brew install slimerjs`
          
          

Install on Windows

On Windows it's important to install ImageMagick from the Windows binary.

This will ensure that ImageMagick is listed first in your PATH. To check your path after installing, open a command line window and type:

          
path
          
          

This will return a list of executables in you PATH separated by semi-colons ;

          
C:\Program Files\ImageMagick-6.8.7-Q16;C:\Windows\system32;C:\Windows...
          
          

If ImageMagick is not in your PATH (but you have it installed), you will need to add it in. Follow these instructions to add in the path to where you have ImageMagick installed.

Warning: if your Windows machine uses Nvidia's Optimus drivers, PhantomJS will hang. The Optimus driver fails to automatically determine which video card should be used for the program. You will need to force the graphics driver to use one of your video cards.


Install on Ubuntu

On Ubuntu 12.04, you will need to apt-get the following packages:

          
libicu-dev
imagemagick
rake
          
          

...and then download the PhantomJS binary package from http://phantomjs.org/ (or install with NPM).

Run with Docker

If you don't want to physically install Wraith, or if you want to run automated Wraith tests on CI, we strongly recommend you run Wraith inside Docker to guarantee consistency of available system fonts, etc.
Once Docker is installed, you should be able to run Wraith commands through your Docker image as follows:

          
alias docker-wraith="docker run -P -v /path/to/your/project/wraith:/wraithy -w='/wraithy' bbcnews/wraith"
docker-wraith capture config.yaml
          
          

Copyright

Copyright © BBC