Storybook React Tutorial

Getting Started with Applitools

Want to learn more about the Applitools platform and how it works? First get started with one of the following:

Running Tests with Applitools

Prerequisites
  1. A free Applitools account and Applitools API KEY

Tip: Unsure how to set up your API key?

Learn how to get started at Setting Up

  1. Node.js https://nodejs.orgโ€‹

  2. Git https://git-scm.comโ€‹

Note: Installing `git` is optional

Installing git is used to clone the demo project from the Github repository. Instead of installing git, you can simply download the Zip file from the repository. Further, if you are Mac, you already have git.

Running the Example Project

  1. Clone or download the repository and navigate to that folder
git clone https://github.com/applitools/tutorial-storybook-react.git
cd tutorial-storybook-react
1
2

Note: you can alternatively download the project as a Zip file and extract it

  1. Install the dependencies
npm install
1
  1. Run the example test
APPLITOOLS_API_KEY="[Your API Key]" npm test
1

This will first set your APPLITOOLS_API_KEY into the node process then run npm test.

Notes:

You can alternatively run npx eyes-storybook.

npx comes as part of Node.js installation. It automatically runs the eyes-storybook executable.

Adding Applitools Eyes to an Existing Node.js Storybook Project

Install Applitools Eyes dependencies:

npm install --save-dev @applitools/eyes-storybook
1

Applitools Eyes Storybook SDK

How it works

The Applitools Eyes Storybook SDK does not require you to change any code! You simply need to add Applitools SDK as a dependency and run the CLI command!

Our SDK simply opens up different stories from your project and upload the DOM to our Visual grid servers. It uploads multiple DOMs concurrently. The visual grid receives these DOMs and renders them in parallel using real browsers. Then it take pictures of each stories. And finally, these pictures are then sent to our AI servers to check for differences.

The picture below shows how it works

storybook-marketecture.png

More information

The @applitools/eyes-storybook npm package page contain more information about advanced configuration, best practices and troubleshooting. Visit eyes-storybook SDK repo to find out more about what's possible with Applitools' Storybook SDK.

Resources




Terms & Conditions Privacy Policy GDPRยฉ 2021 Applitools. All rights reserved.

Last Updated: 6/24/2021, 10:09:59 AM