Reading Time: 10 minutes

What is Wraith?

Wraith is a visual regression testing tool which uses screenshot comparisons to assess visual differences in a website over time. It is currently hosted on GitHub and available under an Apache 2.0 open-source license.

Who Benefits From Using Wraith?

Wraith is often used to ensure that new changes do not adversely affect the design of a production website. You can run Wraith to compare the output of each page on a website.

Prerequisites

Wraith uses various third-party programs to work correctly. In this tutorial, we will be installing Wraith on Ubuntu 18.04. To install it, we first need to install the dependencies below.

  • Ruby
  • ImageMagick
  • At least one of the following browsers:
    • PhantomJS
    • CasperJS
    • SlimerJS

Step 1. Install Ruby

Ruby is an open-source dynamic programming language. We will use a simple installation during this install process. If you want a full, advanced ruby installation, you can follow this link to the article on how to install Ruby on Rails.

[root@host ~]# apt-get install ruby-full
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  fonts-lato javascript-common libgmp-dev libgmpxx4ldbl libjs-jquery libruby2.5 rake ri ruby ruby-dev ruby-did-you-mean
  ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.5 ruby2.5-dev ruby2.5-doc rubygems-integration unzip zip
Suggested packages:
  apache2 | lighttpd | httpd gmp-doc libgmp10-doc libmpfr-dev bundler
The following NEW packages will be installed:
  fonts-lato javascript-common libgmp-dev libgmpxx4ldbl libjs-jquery libruby2.5 rake ri ruby ruby-dev ruby-did-you-mean
  ruby-full ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.5 ruby2.5-dev ruby2.5-doc rubygems-integration
  unzip zip
0 upgraded, 22 newly installed, 0 to remove and 76 not upgraded.
Need to get 8701 kB of archives.
After this operation, 49.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
...
...
Setting up ruby-full (1:2.5.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for fontconfig (2.12.6-0ubuntu2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
root@host:~#

After Ruby is installed, we can check the version using the following command.

root@host:~# ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
root@host:~# 

Step 2. Verify If ImageMagick is Installed

ImageMagick is a set of programs for reading and editing files in graphic format. It may come preinstalled with your version of Ubuntu, but we will still verify to ensure it is installed. The output should be similar to the following if ImageMagick is not installed.

root@host:~# convert --version
Command 'convert' not found, but can be installed with:

apt install imagemagick-6.q16                
apt install graphicsmagick-imagemagick-compat
apt install imagemagick-6.q16hdri            
root@host:~#

Let's go ahead and install the prerequisites for ImageMagick and then ImageMagick itself.

root@host:~# apt-get install php php-common gcc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gcc is already the newest version (4:7.4.0-1ubuntu2.3).
gcc set to manually installed.
The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap liblua5.2-0 libsodium23 php7.2 php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline
Suggested packages:
  www-browser apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap liblua5.2-0 libsodium23 php php-common php7.2 php7.2-cli php7.2-common php7.2-json php7.2-opcache
  php7.2-readline
0 upgraded, 19 newly installed, 0 to remove and 76 not upgraded.
Need to get 5724 kB of archives.
After this operation, 24.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
...
...
Setting up php7.2-cli (7.2.24-0ubuntu0.18.04.3) ...
update-alternatives: using /usr/bin/php7.2 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.2 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.2 to provide /usr/bin/phar.phar (phar.phar) in auto mode

Creating config file /etc/php/7.2/cli/php.ini with new version
Setting up libapache2-mod-php7.2 (7.2.24-0ubuntu0.18.04.3) ...

Creating config file /etc/php/7.2/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.2
Setting up php7.2 (7.2.24-0ubuntu0.18.04.3) ...
Setting up php (1:7.2+60ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.33) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
root@host:~# 

The command to install ImageMagick is as follows.

root@host:~# apt-get install php-imagick imagemagick-6.q16
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  fonts-droid-fallback fonts-noto-mono ghostscript gsfonts imagemagick-6-common libcupsfilters1 libcupsimage2 libfftw3-double3
  libgs9 libgs9-common libijs-0.35 libjbig2dec0 liblqr-1-0 libltdl7 libmagickcore-6.q16-3 libmagickwand-6.q16-3 libpaper-utils
  libpaper1 ttf-dejavu-core
Suggested packages:
  fonts-noto ghostscript-x libfftw3-bin libfftw3-dev libmagickcore-6.q16-3-extra
The following NEW packages will be installed:
  fonts-droid-fallback fonts-noto-mono ghostscript gsfonts imagemagick-6-common libcupsfilters1 libcupsimage2 libfftw3-double3
  libgs9 libgs9-common libijs-0.35 libjbig2dec0 liblqr-1-0 libltdl7 libmagickcore-6.q16-3 libmagickwand-6.q16-3 libpaper-utils
  libpaper1 php-imagick ttf-dejavu-core
0 upgraded, 20 newly installed, 0 to remove and 76 not upgraded.
Need to get 15.5 MB of archives.
After this operation, 49.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
...
...
Setting up libgs9-common (9.26~dfsg+0-0ubuntu0.18.04.12) ...
Setting up libpaper1:amd64 (1.1.24+nmu5ubuntu1) ...

Creating config file /etc/papersize with new version
Setting up imagemagick-6-common (8:6.9.7.4+dfsg-16ubuntu6.8) ...
Setting up fonts-droid-fallback (1:6.0.1r16-1.1) ...
Setting up libpaper-utils (1.1.24+nmu5ubuntu1) ...
Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.4) ...
Setting up ttf-dejavu-core (2.37-1) ...
Setting up libfftw3-double3:amd64 (3.3.7-1) ...
Setting up fonts-noto-mono (20171026-2) ...
Setting up libcupsfilters1:amd64 (1.20.2-0ubuntu3.1) ...
Setting up libcupsimage2:amd64 (2.2.7-1ubuntu2.7) ...
Setting up liblqr-1-0:amd64 (0.4.2-2.1) ...
Setting up libjbig2dec0:amd64 (0.13-6) ...
Setting up libltdl7:amd64 (2.4.6-2) ...
Setting up libijs-0.35:amd64 (0.35-13) ...
Setting up libgs9:amd64 (9.26~dfsg+0-0ubuntu0.18.04.12) ...
Setting up libmagickcore-6.q16-3:amd64 (8:6.9.7.4+dfsg-16ubuntu6.8) ...
Setting up ghostscript (9.26~dfsg+0-0ubuntu0.18.04.12) ...
Setting up libmagickwand-6.q16-3:amd64 (8:6.9.7.4+dfsg-16ubuntu6.8) ...
Setting up php-imagick (3.4.3~rc2-2ubuntu4) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for fontconfig (2.12.6-0ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
root@host:~# 

Once again, we can check to see whether ImageMagick is installed by running the following command.

root@host:~# convert --version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
root@host:~#

Step 3. Install One of the Following Browsers

Next, we need to install one of the three needed browser types.

  • PhantomJS
  • CasperJS
  • SlimerJS
  • Chrome (Currently using Selenium WebDriver + Chromedriver for Chrome; Can target specific selectors)

For the purpose of this tutorial, we will be installing PhantomJS. PhantomJS is a well-known browser used for automatic page interactions. It is an effective tool for offline website testing, screen capture, page automation, and network monitoring. It also provides support for various web standards including DOM processing, CSS, JSON, Canvas, and SVG selector.

 Next, we will again update our package list.

root@host:~# apt-get update

Then, we need to install a few additional libraries needed for PhantomJS.

root@host:~# apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev -y
...
...
...
Setting up chrpath (0.16-2) ...
Setting up libpthread-stubs0-dev:amd64 (0.3-4) ...
Setting up libpng-tools (1.6.34-1ubuntu0.18.04.2) ...
Setting up libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.5) ...
Setting up xorg-sgml-doctools (1:1.11-1) ...
Setting up x11proto-dev (2018.4-4) ...
Setting up pkg-config (0.29.1-0ubuntu2) ...
Setting up xtrans-dev (1.3.5-1) ...
Setting up libxdmcp-dev:amd64 (1:1.1.2-3) ...
Setting up libx11-doc (2:1.6.4-3ubuntu0.2) ...
Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-0ubuntu2) ...
Setting up x11proto-core-dev (2018.4-4) ...
Setting up libxau-dev:amd64 (1:1.0.8-1) ...
Setting up libxcb1-dev:amd64 (1.13-2~ubuntu18.04) ...
Setting up libx11-dev:amd64 (2:1.6.4-3ubuntu0.2) ...
Setting up libpng-dev:amd64 (1.6.34-1ubuntu0.18.04.2) ...
Setting up libxrender-dev:amd64 (1:0.9.10-1) ...
Setting up libfreetype6-dev:amd64 (2.8.1-2ubuntu2) ...
Setting up libfontconfig1-dev:amd64 (2.12.6-0ubuntu2) ...
Setting up libxft-dev (2.3.2-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
root@host:~# 

Next, let's export the file.

root@host:~# export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
root@host:~#

Now, we can download the PhantomJS tar.bz2 installer file.

root@host:~# wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
--2020-03-05 14:39:03--  https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
Resolving github.com (github.com)... 140.82.114.3
Connecting to github.com (github.com)|140.82.114.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/5755891/d55faeca-f27c-11e5-84be-6e92fb868e05?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200305%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200305T193904Z&X-Amz-Expires=300&X-Amz-Signature=b21855bce8c44c339abf932fb845e78554cd7fc56e854f997d353aeda57aa24f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dphantomjs-2.1.1-linux-x86_64.tar.bz2&response-content-type=application%2Foctet-stream [following]
--2020-03-05 14:39:04--  https://github-production-release-asset-2e65be.s3.amazonaws.com/5755891/d55faeca-f27c-11e5-84be-6e92fb868e05?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200305%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200305T193904Z&X-Amz-Expires=300&X-Amz-Signature=b21855bce8c44c339abf932fb845e78554cd7fc56e854f997d353aeda57aa24f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dphantomjs-2.1.1-linux-x86_64.tar.bz2&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.46.108
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.46.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23415665 (22M) [application/octet-stream]
Saving to: ‘phantomjs-2.1.1-linux-x86_64.tar.bz2’

phantomjs-2.1.1-linux-x86_64.tar 100%[=======================================================>]  22.33M  61.0MB/s    in 0.4s    

2020-03-05 14:39:04 (61.0 MB/s) - ‘phantomjs-2.1.1-linux-x86_64.tar.bz2’ saved [23415665/23415665]

root@host:~# 

Next, let's extract the file.

tar xvjf $PHANTOM_JS.tar.bz2

Moving forward, we'll move the phantomjs-2.1.1-linux-x86_64/ folder to /usr/local/share.

root@host:~# mv $PHANTOM_JS /usr/local/share

Now, we can link the phantomjs binary to bin.

root@host:/usr/local/share# ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
root@host:/usr/local/share#

Finally, let's check the installation to see if the version we need is installed.

root@host:/usr/local/share# phantomjs --version
2.1.1
root@host:/usr/local/share#

Step 4. Install Wraith

Let's proceed with the Wraith install.

root@host:~# gem install wraith
root@host:/usr/local/share# gem install wraith
Fetching: image_size-2.0.2.gem (100%)
Successfully installed image_size-2.0.2
Fetching: mini_magick-4.10.1.gem (100%)
Successfully installed mini_magick-4.10.1
Fetching: robotex-1.0.0.gem (100%)
Successfully installed robotex-1.0.0
Fetching: mini_portile2-2.4.0.gem (100%)
Successfully installed mini_portile2-2.4.0
Fetching: nokogiri-1.10.9.gem (100%)
Building native extensions. This could take a while...
...
...
...
Parsing documentation for wraith-4.2.4
Installing ri documentation for wraith-4.2.4
Done installing documentation for image_size, mini_magick, robotex, mini_portile2, nokogiri, anemone, log4r, thor, parallel, childprocess, rubyzip, selenium-webdriver, io-like, archive-zip, chromedriver-helper, wraith after 5 seconds
16 gems installed
root@host:/usr/local/share#

Again, let's verify the version of Wraith installed.

root@host:~# wraith --version
4.2.4
root@host:~#

Configure Wraith

First, we need to create a project folder.

mkdir -p /home/user/wraith

Now, let's change directories into our project folder.

root@host:~# cd /home/user/wraith

Next, we can use the wraith command to set up the folders and files required in our project folder.

root@host:/home/user/wraith# wraith setup
      create  configs
      create  configs/capture.yaml
      create  configs/history.yaml
      create  configs/spider.yaml
      create  javascript
      create  javascript/cookies_and_headers--casper.js
      create  javascript/cookies_and_headers--phantom.js
      create  javascript/disable_javascript--casper.js
      create  javascript/disable_javascript--phantom.js
      create  javascript/interact--casper.js
      create  javascript/interact--chrome.js
      create  javascript/interact--phantom.js
      create  javascript/wait--casper.js
      create  javascript/wait--chrome.js
      create  javascript/wait--phantom.js
root@host:/home/user/wraith# 
root@host:/home/user/wraith# ll
total 16
drwxr-xr-x 4 root root 4096 Mar  5 15:32 ./
drwxr-xr-x 3 root root 4096 Mar  5 15:27 ../
drwxr-xr-x 2 root root 4096 Mar  5 15:32 configs/
drwxr-xr-x 2 root root 4096 Mar  5 15:32 javascript/
root@host:/home/user/wraith#

The wraith command creates the necessary configuration, templates, and settings folders for our wraith files. Next, we will make a copy of the file called “config.yaml” located within the configs folder and give it a new filename called “my_project_name.yaml”. Then, we can use vim to add the settings we want to employ to compare our sites.

root@host:/home/user/wraith# cp configs/capture.yaml configs/my_project_name.yaml

root@host:/home/user/wraith# vim configs/capture.yaml

Below is a complete view of the file.

# (required) The engine to run Wraith with. Examples: 'phantomjs', 'casperjs', 'slimerjs'
browser: “phantomjs”

# (required) The domains to take screenshots of.
domains:
  current:  “http://www.example.com”
  new:      “http://develop.example.com”

# (required) The paths to capture. All paths should exist for both of the domains specified above.
paths:
  home:     /
  about:    /about
  contact:  /get-in-touch

# (required) Screen widths (and optional height) to resize the browser to before taking the screenshot.
screen_widths:
  - 320
  - 600x768
  - 768
  - 1024
  - 1280

# (required) The directory that your screenshots will be stored in
directory: 'shots'

In order to configure the “my_project_name.yaml” file, there are six required parameters we need to adjust (as you can see above).

  • browser
  • domains
    • current
    • new
  • paths:
    • home: /
    • about: /about
    • contact: /get-in-touch
  • screen_widths
  • directory
  • fuzz
This is box title
The yaml file format is space sensitive so the settings like the “Domain” and “Path” entries in the file should be spaced out as depicted within your editor.

There are also several other optional settings we can modify to meet our specific needs.

# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil
before_capture: 'javascript/disable_javascript--phantom.js'

# (optional) The maximum acceptable level of difference (in %) between two images before Wraith reports a failure. Default: 0
threshold: 5

# (optional) Specify the template (and generated thumbnail sizes) for the gallery output.
gallery:
  template: 'slideshow_template' # Examples: 'basic_template' (default), 'slideshow_template'
  thumb_width:  200
  thumb_height: 200

# (optional) Choose which results are displayed in the gallery, and in what order. Default: alphanumeric
# Options:

#   alphanumeric - all paths (with or without a difference) are shown, sorted by path

#   diffs_first - all paths (with or without a difference) are shown, sorted by difference size (largest first)

#   diffs_only - only paths with a difference are shown, sorted by difference size (largest first)

# Note: different screen widths are always grouped together.
mode: diffs_first

# (optional) Set the number of threads to use when saving images. Raising this value can improve performance, but very high
# values can lead to server connection issues. Set to around 1.5 the available CPU cores for best performance. Default: 8
threads: 8

Once you add your specific settings, type :wq in vim to save the file.

How is Wraith Used?

Wraith has two main modes to choose from:

  • «capture»
  • «history»

The Capture mode is useful for comparing versions of a dev site and live site. To utilize this, we can specify two domains within our yaml file, the number of paths, as well as screen widths, and then we can run “wraith capture.”

root@host:~# wraith capture configs/capture.yaml
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
Loading http://www.example.com/ at dimensions: 320×1500
Loading http://develop.example.com/ at dimensions: 320×1500
Loading http://www.example.com/ at dimensions: 768×1500
Loading http://develop.example.com/ at dimensions: 600×768
Loading http://www.example.com/ at dimensions: 600x768
Loading http://develop.example.com/ at dimensions: 1024×1500
Loading http://www.example.com/ at dimensions: 1024×1500
Loading http://develop.example.com/ at dimensions: 768×1500
...
...
...
Snapping http://www.example.com/ at: 320×1500
Snapping http://www.example.com/ at: 768×1500
Snapping http://www.example.com/ at: 600×768
Snapping http://www.example.com/ at: 1024×1500

Traceback (most recent call last):
	6: from /var/lib/gems/2.5.0/gems/parallel-1.19.1/lib/parallel.rb:209:in `block (3 levels) in in_threads'
	5: from /var/lib/gems/2.5.0/gems/parallel-1.19.1/lib/parallel.rb:359:in `block in work_in_threads'
	4: from /var/lib/gems/2.5.0/gems/parallel-1.19.1/lib/parallel.rb:518:in `with_instrumentation'
	3: from /var/lib/gems/2.5.0/gems/parallel-1.19.1/lib/parallel.rb:360:in `block (2 levels) in work_in_threads'
	2: from /var/lib/gems/2.5.0/gems/parallel-1.19.1/lib/parallel.rb:509:in `call_with_index'
	1: from /var/lib/gems/2.5.0/gems/wraith-4.2.4/lib/wraith/save_images.rb:80:in `block in parallel_task'
/var/lib/gems/2.5.0/gems/wraith-4.2.4/lib/wraith/save_images.rb:89:in `rescue in block in parallel_task'
root@host:~# 

The other format is History mode. Using this option, we can compare the same domain over time. It is used for checking whether your site looks the same over time or if something has changed. Helpful when your site uses third-party components.

In this mode, you can specify one domain, any number of paths, and screen widths. You do need to make sure you set the history_dir property and then run the creation story to generate basic screenshots. We can then add new screenshots to compare them with the old ones.

No matter which mode you use, there are certain configuration options which remain applicable to both modes.

After capturing each screenshot, Wraith will verify, then display the necessary information in a diff.png and data.txt. The data.txt will show the number of pixels for each file that has changed. The gallery is available for viewing each image, after comparing all the pictures.

Spider Functionality

In this modality, Wraith will crawl a page or site. You can choose your path in one of two ways.

  1. You can specify the paths manually or,
  2. Have Wraith crawl your website to determine the paths for you.

In order for Wraith to crawl a site for us, we simply have to remove the 'paths' property in the .yaml file, and then specify the 'imports' property in the .yaml file.

imports: "spider_paths.yml"​

Then, we can have Wraith crawl the domain.

wraith spider my_config.yaml

This creates a file called a spider_paths.yml within the same directory as our my_project_name.yaml. Now, we can run our Wraith commands as if we have specified the paths manually.

root@host:~# wraith capture my_config.yml

Wraith Commands

Here is a full listing of the available Wraith commands.

root@host:/# wraith
Commands:
  wraith capture [config_name] # Capture paths against two domains, compare them, generate gallery
  wraith compare_images [config_name] # compares images to generate diffs
  wraith copy_base_images [config_name] # copies the required base images over for comparison with latest images
  wraith crop_images [config_name] # crops images to the same height
  wraith generate_gallery [config_name] # create page for viewing images
  wraith generate_thumbnails [config_name] # create thumbnails for gallery
  wraith help [COMMAND]  Describe available commands or one specific command
  wraith history [config_name] # Setup a baseline set of shots
  wraith info # Show various info about your system
  wraith latest [config_name] # Capture new shots to compare with baseline
  wraith multi_capture [filelist] # A Batch of Wraith Jobs
  wraith reset_shots [config_name] # removes all the files in the shots folder
  wraith save_images [config_name] # captures screenshots
  wraith setup # creates config folder and default config
  wraith setup_folders [config_name] # create folders for images
  wraith spider [config_name] # crawls a site for paths and stores them to YML file
  wraith validate [config_name] # checks your configuration and validates that all required properties exist
  wraith version # Show the version of Wraith

root@host:/# 

To see a quick overview of your system, we can run the following command.

root@host:/# wraith info
DEBUG: #################################################
DEBUG:   Command run:        info
DEBUG:   Wraith version:     4.2.4
DEBUG:   Ruby version:       ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
DEBUG:   ImageMagick:        Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
DEBUG:   PhantomJS version:  2.1.1
DEBUG:   chromedriver version:  ChromeDriver 81.0.4044.20 (f006328e39a9769596eb506c8841c3004b24e747-refs/branch-heads/4044@{#244})
DEBUG:   CasperJS version:   CasperJS not installed
DEBUG: #################################################
root@host:/# 

Conclusion

Wraith is an excellent tool which allows us to not only automate the comparison process via the creation of screenshots, but also compares those screenshots and creates differences for later analysis and examination.

Still have questions about Wraith and how this tool can be more useful in your testing? Give us a call at 800.580.4985, or open a chat or ticket with us to speak with one of our knowledgeable Solutions Team or an experienced Hosting Advisors today!

Avatar for Ellen Sletton

About the Author: Ellen Sletton

I'm 23 years old Linux Tech who always takes NO as Next Opportunity. Every day I'm trying to learn something new and share my knowledge with others. My free time I spend with my dog Emil or doing some UI/UX design or simply making an inspiring photo for my blog :) Sharing knowledge helps me generate new ideas and stay motivated.

Latest Articles

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article