CasperJS / PhantomCSS compatible visual regression tests are used to test your applications layouts, modules, units, and pages.
See the Pen by Jason Bellamy (@jasonbellamy) on CodePen.
How does it work?
Visual regression tests are run against your layouts, modules, units, and pages by loading a fixture, taking a screenshot and comparing it against a saved baseline screenshot.
How do I write them?
A test file similar to the one above is automatically created for you in the tests/
directory when using the generator-plum scaffolding tool.
Notes
- You have full access inside of your tests to all of the methods CasperJS & PhantomCSS provide.
How do I run them?
Tests can be run by using one of the following tools:
- plum-test - Build and run visual regression tests against plum stylesheets.
- grunt-plum-test - Grunt plugin wrapper for plum-test.
How do I structure their files & folders?
Tests, baselines, and fixtures should be placed inside of the tests/
directory located at the root of each specific layout, module, unit and page folder.
units
└── unit
├── index.scss
└── tests
├── baselines
│ └── unit.png
├── fixtures
│ └── unit.hbs
└── unit.js