Skip to content

Add notes about Backstop.JS #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v10.2.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions particle/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,23 @@ const options = {

## Visual Regression Testing

Particle does not include VRT out of the box, but there are plenty of great options out there depending on your needs. Here are some of our favorites, in alphabetical order:

- [BackstopJS](https://github.com/garris/BackstopJS)
- [PhantomJS](https://github.com/ariya/phantomjs)
- [Puppeteer](https://github.com/GoogleChrome/puppeteer)
- [SlimerJS](https://github.com/laurentj/slimerjs)
- [WebdriverIO](http://webdriver.io/)
Particle includes basic BackstopJS configuration and tests for visual regression testing. Backstop, like many VRT packages, works by allowing engineers to capture "reference" screenshots of a website prior to making or deploying changes, then, after the changes are made, taking "test" screenshots, and comparing the two sets.
* [BackstopJS](https://github.com/garris/BackstopJS)
To run [BackstopJS](https://garris.github.io/BackstopJS/) visual regression testing in Particle, first you'll need to install the BackstopJS npm package:
* [PhantomJS](https://github.com/ariya/phantomjs)
```bash
* [Puppeteer](https://github.com/GoogleChrome/puppeteer)
npm install backstopjs --save-dev
* [SlimerJS](https://github.com/laurentj/slimerjs)
```
* [WebdriverIO](http://webdriver.io/)
Backstop configuration is located in `./tools/tests/vrt/backstop.json`. See the full docs on [npmjs.com](https://www.npmjs.com/package/backstopjs) for help on configuring your tests; we provide two default Pattern Lab pages, but any URL can be entered for tests, including local URLs.
Prior to making changes (such as when developing a new feature) or prior to deploying a new version of software, run references in a bash session:
```bash
npm run test:backstop:ref
```
Then, after changes are made, run the tests in a bash session:
```bash
npm run test:backstop:test
```
Your default browser should automatically open with the test results.