GithubHelp home page GithubHelp logo

imclab / wraith Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bbc/wraith

0.0 1.0 0.0 1.57 MB

Wraith — A responsive screenshot comparison tool

Home Page: http://responsivenews.co.uk

License: Apache License 2.0

wraith's Introduction

Wraith

Build Status Code Climate

Wraith is a screenshot comparison tool, created by developers at BBC News.

What is it?

Wraith uses either PhantomJS or SlimerJS to create screen-shots of different environments and then creates a diff of the two images, the affected areas are highlighted in blue

Photo of BBC News with a diff

Requirements

To read our detailed instructions for setup and install, as well as example configs, visit wraith docs

Installation

Open terminal and run

gem install wraith

You can then run the following to create a template snap.js and config file:

wraith setup

Alternatively you can clone the repo.

git clone https://github.com/BBC-News/wraith
cd wraith
bundle install

Using Wraith

You can type wraith into terminal to bring up the list of commands, but the one to start Wraith is

wraith capture config_name

This assumes that your snap.js and config.yaml are in the folders that were created on setup. There are other commands also available, these all expect a config_name to be passed as an option. Wraith will look for the config file at configs/[config_name].yaml.

  wraith capture config_name             # A full Wraith job
  wraith compare_images config_name      # compares images to generate diffs
  wraith crop_images config_name         # crops images to the same height
  wraith setup_folders config_name       # create folders for images
  wraith generate_gallery config_name    # create page for viewing images
  wraith generate_thumbnails config_name # create thumbnails for gallery
  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

Output

After each screenshot is captured, the compare task will run, this will output a diff.png and a data.txt. The data.txt for each file will show the number of pixels that have changed. There is a main data.txt which is in the root of the output folder that will combine all of these values to easier view all the pixel changes.

Gallery

A gallery is available to view each of the images and the respective diff images located in the shots folder once all the images have been compared.

Contributing

If you want to add functionality to this project, pull requests are welcome.

  • Create a branch based off master and do all of your changes with in it.
  • If you have to pause to add a 'and' anywhere in the title, it should be two pull requests.
  • Make commits of logical units and describe them properly
  • Check for unnecessary whitespace with git diff --check before committing.
  • If possible, submit tests to your patch / new feature so it can be tested easily.
  • Assure nothing is broken by running all the test
  • Please ensure that it complies with coding standards.

Please raise any issues with this project as a GitHub issue.

Changelog - updated 2014-02-09

We have released Wraith as a Ruby Gem!! There is a new CLI to better interact with Wraith and it's commands.

License

Wraith is available to everyone under the terms of the Apache 2.0 open source license. Take a look at the LICENSE file in the code.

Credits

wraith's People

Contributors

boldfacedesign avatar dblooman avatar doryphores avatar i-like-robots avatar jamesryanbell avatar jaredly avatar jasonkarns avatar jcleveley avatar kami avatar kenoir avatar lewisnyman avatar malengrin avatar nikai3d avatar plukevdh avatar reggieb avatar rory-geoghegan-ecometrica avatar rupl avatar sbelyea avatar teameh avatar thingsinjars avatar timabell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.