0.11.0 • Published 5 years ago

javascript-visual-regression v0.11.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-visual-regression

Visual regression tool for react components

On the output image, the image on the left is the base image, the image in the middle is the comparison image and the image on the right is the test image

config ( jvr.config.js )

Config must return a function, which in turn returns the config as an object.

module.exports = () => ({
  saveImageLocation: '/images/', //if you want to save the images relative to the location running. JVR will add a hashed folder
  comparisonTolerance: 0.05, //percentage difference of 5%
  noSandbox: false, //by default puppeteer will run with a sandbox. Use this with caution.
  delay: 0, //Incase of a slow build box, a delay can be added which will delay the screenshot being taken. This allows for extra time for page painting.
  tests: [
    {
      title: 'should screenshot a live page',
      testType: 'website',
      url: 'https://www.google.com',
      hideElements: ['.cookie-banner', '.carousel'],
    }
  ],
  screenWidths: [
    {title: 'mobile', width: 320},
    {title: 'tablet', width: 720},
    {title: 'desktop', width: 1200},
  ],
});

Usage

from the command line ( recommended )

To generate the base imageSaveLocation

  jvr --generateBase

To run the tests

  jvr

CI

Use a docker image that has chrome installed

0.11.0

5 years ago

0.10.0

5 years ago

0.9.0

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago