cypress-image-diff-js
Version:
Visual regression testing tool with cypress
45 lines (30 loc) • 2.21 kB
Markdown
<p align="center">
<a href="https://cypress.visual-image-diff.dev/"><img src="./cypress-image-diff-logo.png" width="150" /></a>
</p>
<h1 align="center">cypress-image-diff</h1>
Visual regression test with cypress
This tool was created to make visual regression as simple as possible, by exposing basic functions that allow you to view the difference between images.
The wrapper uses [pixelmatch](https://github.com/mapbox/pixelmatch) which is simple and powerful and relies on [cypress](https://github.com/cypress-io) to take screenshots.
[![NPM Downloads][npm-downloads-image]][npm-url] [![Version][version-image]][version-url] [![Build Status][circleci-image]][circleci-url] [](https://www.browserstack.com/) [](https://www.gitbook.com/)
[ ]: https://badgen.net/npm/dm/cypress-image-diff-js
[ ]: https://www.npmjs.com/package/cypress-image-diff-js
[ ]: https://circleci.com/gh/uktrade/cypress-image-diff/tree/main
[ ]: https://circleci.com/gh/haim-io/cypress-image-diff/tree/main.svg?style=svg
[ ]: https://img.shields.io/npm/v/cypress-image-diff-js.svg
[ ]: https://www.npmjs.com/package/cypress-image-diff-js
```js
describe('Visuals', () => {
it('should compare screenshot of the entire page', () => {
cy.visit('www.google.com')
cy.compareSnapshot('home-page')
})
})
```
<img src="https://raw.githubusercontent.com/kien-ht/cypress-image-diff-html-report/main/assets/showcase-update-baseline.gif" alt="showcase-update-baseline"/>
<img src="https://raw.githubusercontent.com/kien-ht/cypress-image-diff-html-report/main/assets/showcase-screenshot-inspectors.gif" alt="showcase-screenshot-inspectors"/>
Above you will find comprehensive documentation on how to setup this plugin within a cypress test suite