E2E visual regression tests for consumerfinance.gov using cypress-image-diff. This tool takes full-page screenshots of the most popular cf.gov pages to spot unintentional visual changes caused by cascading stylesheet changes.
yarn
to install dependencies.- Ensure consumerfinance.gov is running at localhost:8000.
yarn test
to generate baseline screenshots.- Make some CSS changes to your local cf.gov repo. Don't forget to rebuild front-end assets with
./frontend.sh
. yarn test
to generate new screenshots and compare them to the baselines.yarn test:report
to open a report showing changes, if any. Or just view the diff'ed screenshots inoutput/images/diff/
The list of webpages and viewport sizes can be changed in cypress-image-diff.config.cjs
. Generated screenshots are stored in the output/
dir. Each screenshot takes about 10 seconds to generate.