ember-cli-backstop
v0.1.4
Published
BackstopJS CSS regression testing for ember-cli
Downloads
7
Readme
Ember-cli-backstop
BackstopJS based CSS regression testing for ember-cli applications.
Installation
Install the addon:
ember install ember-cli-backstop
# if ember-cli <= 0.2.2
ember install:addon ember-cli-backstop
Dependencies
BackstopJS requires a global install of CasperJS and PhantomJS
$ npm install -g phantomjs
// test for a correct install (most problems come from a missing global dependency)
$ phantomjs -v
> 1.9.8
$ npm install -g casperjs
// test for a correct install (most problems come from a missing global dependency)
$ casperjs --version
> 1.1.0-beta3
Configuration
The ember-cli-backstop generator creates a tests/backstop
directory containing a backstop.json configuration file and an empty reference images directory. For information on configuring the backstop.json file to collect reference images for testing refer to the BackstopJS Github
Usage
Creating Reference Files
ember backstop reference
will create snapshot reference images in tests/backstop/references
based on the configuration specified in the backstop.json file. References images can be committed to version control to view changes during pull requests/code inspections.
Run the reference command whenever you want to update the reference snapshots for your project.
Executing Backstop Test
ember backstop test
generates a set of test snapshots based on the current application and compares these snapshots against the reference snapshots. A report highlighting the differences will be available at BackstopJS Report (e.g. localhost:3001/compare).
Troubleshooting
Stdout overflow
Logs from the target application may overflow stdout, causing the backstop commands to terminate (issue #4 has been raised against this). As a workaround backstop commands can be run with strict
to suppress output.
e.g. ember backstop reference strict
or ember backstop test strict
License
MIT