Giter Site home page Giter Site logo

mugshot's Introduction

logo

Framework independent visual testing library

Build status codecov npm type definitions License

View Docs


Introduction

Mugshot is a node library for doing visual regression testing. The way screenshots are taken, processed, compared and stored is entirely customizable. You can use it to write visual regression tests for websites, mobile apps, native apps etc. Moreover, Mugshot doesn't impose any preferences on how you write or execute the tests, it just gives you an assertion that you can call however and whenever you want.

Features

  • Framework independent so you can choose your favorite tools or plug it into your existing testing suite.
  • Produces diff images if a test fails.
  • Throws on missing baselines (can be toggled through options).
  • Everything is pluggable (screenshotter, differ, storage etc.).

Installation

npm install --save-dev mugshot

Or with yarn

yarn add -D mugshot

Depending on how you want to take screenshots, you'll need a Screenshotter implementation. Mugshot bundles a WebdriverScreenshotter that you can use with Webdriver compatible clients e.g. Selenium or Appium. Each client might need an adapter that translates its API to the interface that Mugshot expects. The following adapters are available:

Package Version
@mugshot/webdriverio npm
@mugshot/puppeteer npm
@mugshot/playwright npm

Motivation

Manually checking one component for unexpected visual changes is hard. Doing it across your entire UI is harder. Doing it in multiple browsers/devices is even harder. Making sure everyone on your team does it is the hardest.

Mugshot aims to automate that process. It offers a simple API that lets you compare an existing baseline screenshot with a fresh screenshot and make sure they're identical. If they're not you'll get a diff image highlighting the differences. You can then commit it as the new baseline if the changes are expected, or fix the code and rerun the tests.

Expected Actual Diff
expected actual diff

Docs

View Docs

License

MIT

mugshot's People

Contributors

adela-istrate-hs avatar andrei-picus-hs avatar dependabot[bot] avatar flavius-tirnacop-hs avatar flore77 avatar nighttrax avatar ovidiu-bute-hs avatar ovidiu-chereches-hs avatar renovate-bot avatar tricoder42 avatar valentin-radulescu-hs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.