O'Reilly logo

PhantomJS Cookbook by Rob Friesel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Detecting visual regressions using PhantomCSS

This recipe introduces the PhantomCSS library for CasperJS and illustrates how to test for visual regressions in web pages.

Getting ready

To run this recipe, the CasperJS binary must be installed and on our PATH; we will also need a script that expects to use the CasperJS API to navigate to and inspect a web page.

We will need the PhantomCSS library, and we will need to make it available to our CasperJS script.

Note

PhantomCSS is a module for CasperJS that can automate visual regression testing. It is an open source (MIT licensed) project and is available at the following GitHub repository at https://github.com/Huddle/PhantomCSS.

Tip

The PhantomCSS script is available in the downloadable code repository as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required