This repository makes it easy to use BackstopJS to run a comparison between two environments of the same website to see what has visually changed between them.
For example, when upgrading dependencies, it allows you to compare production with your test environment to check that the upgrade has not introduced any defects.
- ensure you have NodeJS installed
npm installin this directory.- Edit
config.jsto specify your BackstopJS configuration - Edit
paths.jsto define the relevant scenarios for your website - see the BackstopJS documentation for details - Edit
viewports.jsto specify the viewports you want to test - Edit
.envto define your domains and other options
npm test
Node will check that all the URLs respond with 200 OK.
If they do, Backstop will take screenshots of equivalent pages on each environment across different breakpoints, compare them, and report where they do not match.
The report will be saved to backstop_data/html_report, and a web browser will automatically open it.
If you find that your requests are being blocked, adjust the options in .env to reduce the number of requests.
If your test environment is behind basic auth, edit .env to set BASIC_AUTH_USER and BASIC_AUTH_PASSWORD