File size: 2,609 Bytes
62c4e57
6f38c76
 
 
 
ba1b9e0
e7253e8
6f38c76
62c4e57
 
 
6f38c76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7253e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
title: UI Regression Testing
emoji: πŸš€
colorFrom: blue
colorTo: indigo
sdk: docker
sdk_version: 6.2.0
app_file: app.py
pinned: false
---

# UI Regression Testing System - Hugging Face Spaces

A powerful automated system for detecting visual regressions by comparing Figma designs with live website screenshots.

## 🎯 Features

- βœ… **Automated Figma Screenshot Capture** - Extracts design frames at correct dimensions
- βœ… **Website Screenshot Capture** - Captures desktop and mobile views
- βœ… **Visual Difference Detection** - AI-powered comparison using vision models
- βœ… **Annotated Comparisons** - Red/orange/green circles marking differences
- βœ… **Severity Classification** - High/Medium/Low severity ratings
- βœ… **Detailed Reports** - Comprehensive regression analysis
- βœ… **Similarity Scoring** - 0-100 score indicating design-to-website match

## πŸš€ Quick Start

### 1. Get Your Credentials

**Figma API Key:**
- Go to https://www.figma.com/developers/api#access-tokens
- Create a new personal access token
- Copy the token (starts with `figd_`)

**Figma File ID:**
- Open your Figma file
- The URL looks like: `https://www.figma.com/file/{FILE_ID}/...`
- Copy the FILE_ID part

**Website URL:**
- The full URL of your website (e.g., https://example.com)
- Must be publicly accessible

**Hugging Face Token (Optional):**
- Go to https://huggingface.co/settings/tokens
- Create a new token with read access

### 2. Run the Test

1. Fill in your credentials in the UI
2. Click "Start Regression Test"
3. Wait for the test to complete (1-3 minutes)
4. Review results, comparison images, and detailed report

## πŸ” How It Works

This project uses an advanced multi-agent workflow powered by **LangGraph**.

### Agent 0: Super Agent
- Generates comprehensive test plan

### Agent 1: Design Inspector
- Captures Figma frames at correct dimensions

### Agent 2: Website Inspector
- Screenshots website at multiple viewports

### Agent 3: Integrated Analyzer
- Compares screenshots using both pixel analysis and HF Vision models.

### Human-in-the-loop
- The workflow pauses before the final analysis, allowing you to review the captured screenshots and approve continuing.

## πŸ› οΈ Technical Details

### Key Technologies

- **LangGraph**: Multi-agent orchestration
- **Gradio**: Web UI
- **Playwright**: Browser automation
- **Pillow**: Image processing
- **Hugging Face Transformers**: Vision models

## πŸ“š Documentation

For more information on the advanced LangGraph features, please see **`README_LANGGRAPH.md`**.

---

**Built with ❀️ for better UI quality assurance**