/puppeteer-resemble-testing

Visual regression testing with Puppeteer and Resemble.js

Primary LanguageJavaScriptMIT LicenseMIT

puppeteer-resemble-testing

Repository for my intro blog posts to visual regression testing with Puppeteer and Resemble.js

Run

  1. Clone this repository
  2. npm install
  3. node app.js

How it works

During the first run original screenshots get created with puppeteer. When reruning the script another round of screenshots get created and are compared with Resemble.js.

You can pass your own URL(s) like so node app.js http://example.com https://www.gnu.org/

Run with Docker

This script can also be run in a containerized environment. This gives the guarantee that screenshots are created in consistent way with a stable Chrome Browser:

  • docker pull movd/puppeteer-resemble-testing:latest
  • docker run --rm -v "${PWD}/screenshots:/app/screenshots" movd/puppeteer-resemble-testing:latest http://example.com

Thanks to zenato for providing the docker-puppeteer Base environment image.