# Visual Testing — Storybook

Source: https://www.geekswithgeeks.com/hi/storybook/sb-visual-testing

> Screenshot-based regression testing के लिए Storybook को visual testing tools के साथ use करें।

## Visual regression testing

Percy या Chromatic जैसे visual testing tools Storybook के साथ integrate होते हैं और automatically component screenshots capture करते हैं और unexpected visual changes के बारे में alert करते हैं।

## Storybook के लिए Chromatic

Chromatic Storybook visual testing के लिए official cloud service है। यह visual tests चलाता है, changes को track करता है, और हर build के लिए एक review dashboard प्रदान करता है।

## Chromatic को setup करना

अपने Storybook को Chromatic से simple authentication के साथ connect करें।

```bash
# Install Chromatic CLI
npm install --save-dev chromatic

# Run visual tests
npx chromatic --project-token=YOUR_TOKEN
```

## Percy integration

Percy एक अन्य visual testing tool है जो Storybook के साथ integrate होता है। यह full-page screenshots capture करता है और visual differences को highlight करता है।
