Awesome Open Source
Awesome Open Source

Visual Regression Testing for Storybook

GitHub license Tests npm version npm downloads



There are a few visual regression tools for the web, but most either cannot be run headless or use phantomjs which is deprecated and a browser nobody is actually using. They usually also require you to maintain fixtures. With react-native it's now possible to target multiple platforms with a single code base, but there's no single tool to test all to my knowledge.

Loki aims to have easy setup, no to low maintenance cost, reproducible tests independent of which OS they are run on, runnable on CI and support all platforms storybook does.

Supported platforms

  • Chrome in docker (recommended)
  • Chrome in AWS Lambda
  • Local Chrome application
  • iOS simulator
  • Android emulator


Optional dependencies

  • GraphicsMagick for gm diffing engine, brew install graphicsmagick
  • Docker for the chrome.docker target.
  • Chrome 59+ for the target, brew cask install google-chrome-canary.


yarn add loki --dev
yarn loki init


Loki will not start any servers for you, so ensure storybook and any simulator/emulator is up and running before running tests.

  1. Start storybook server yarn storybook
  2. Add first set of reference files yarn loki update
  3. Do some changes to your components
  4. Test against references yarn loki test
  5. Review changes in diff folder
  6. Approve changes and update references yarn loki approve




# Install dependencies
# Start example storybook
yarn workspace @loki/example-react run storybook
# Run example visual tests
yarn workspace @loki/example-react run test
# Run unit tests
yarn test
# Run cli integration tests
cd test/cli && yarn test


Joel Arvidsson


Tomas Echeverri Valencia



MIT License. Joel Arvidsson 2017-present

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,537,249
Reactjs (75,823
Android (41,705
Ios (19,619
React Native (11,828
Web (7,814
Testing (6,554
Storybook (1,224
Visual Testing (85
Visual Regression (47
React Storybook (18
Related Projects