Spaces:
Sleeping
Sleeping
File size: 5,785 Bytes
6f38c76 | 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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | # Quick Start Guide - POC Execution
## π Get Started in 5 Minutes
### Step 1: Extract and Setup (2 minutes)
```bash
# Extract the project
unzip langgraph_ui_regression.zip
cd langgraph_ui_regression
# Run setup script
chmod +x setup.sh
./setup.sh
# Or manually install dependencies
pip install -r requirements.txt
playwright install chromium
```
### Step 2: Configure Credentials (1 minute)
```bash
# Copy and edit environment file
cp .env.example .env
nano .env
```
**Add your credentials:**
```env
FIGMA_FILE_KEY=your_figma_file_key
FIGMA_ACCESS_TOKEN=your_figma_access_token
WEBSITE_URL=https://v0-replicate-checkout-design.vercel.app/
```
### Step 3: Run the System (2 minutes)
```bash
# Execute the workflow
python main.py
# Or with custom output directory
python main.py --output-dir ./my_reports --debug
```
### Step 4: Check Results
Reports are generated in `./reports/` directory:
- `report_YYYYMMDD_HHMMSS.json` - Machine-readable report
- `report_YYYYMMDD_HHMMSS.md` - Human-readable report
---
## π What Happens During Execution
```
1. Agent 0: Creates test plan
β
2. Agent 1: Extracts design specs from Figma
β
3. Agent 2: Extracts CSS specs from website
β
4. Agent 3: Compares and generates findings
β
5. Reports: JSON + Markdown output
```
---
## π― Expected Output
### Console Output
```
======================================================================
π UI REGRESSION TESTING SYSTEM
======================================================================
π Configuration:
Figma File Key: abc123def456...
Website URL: https://v0-replicate-checkout-design.vercel.app/
Output Directory: ./reports
Debug Mode: False
======================================================================
π€ Agent 0: Super Agent - Generating Test Plan...
β Configured 2 viewports
β Configured 7 test categories
β Test plan generated with 140 total tests
π¨ Agent 1: Design Inspector - Extracting Design Specs...
β Loaded Figma file: Checkout Design
β Extracted 156 design specifications
- colors: 12 specs
- typography: 24 specs
- spacing: 18 specs
- layout: 22 specs
- borders: 15 specs
- effects: 8 specs
π Agent 2: Website Inspector - Extracting Website Specs...
π± Processing desktop viewport (1440px)...
β Loaded https://v0-replicate-checkout-design.vercel.app/
β Extracted specs for desktop
π± Processing mobile viewport (375px)...
β Extracted specs for mobile
π Agent 3: Difference Analyzer - Comparing Specs...
π Analyzing colors...
β Found 5 differences
π Analyzing typography...
β Found 3 differences
π Analyzing spacing...
β Found 2 differences
...
β Total findings: 15
- High: 3
- Medium: 7
- Low: 5
π Generating Reports...
======================================================================
β
EXECUTION COMPLETED SUCCESSFULLY
======================================================================
π Reports:
JSON: ./reports/report_20240103_120000.json
Markdown: ./reports/report_20240103_120000.md
π Summary:
Total Findings: 15
High Severity: 3
Medium Severity: 7
Low Severity: 5
Overall Score: 75/100
======================================================================
```
### Report Output
**Markdown Report Preview:**
```markdown
# UI Regression Testing Report
**Generated**: 2024-01-03 12:00:00
## Summary
- **Total Findings**: 15
- **π΄ High Severity**: 3
- **π‘ Medium Severity**: 7
- **π’ Low Severity**: 5
- **Overall Score**: 75/100
## High Severity Issues
#### submit_button - backgroundColor
**Category**: colors
**Design Value**: `#FF0000`
**Website Value**: `#FF0001`
**Analysis**: Significant color mismatch affecting brand consistency...
```
---
## π§ Troubleshooting
### Problem: "ModuleNotFoundError: No module named 'langgraph'"
**Solution:**
```bash
pip install -r requirements.txt
```
### Problem: "Figma API authentication failed"
**Solution:**
1. Verify your Figma access token is correct
2. Ensure the token has access to the file
3. Check token hasn't expired
### Problem: "Website not loading"
**Solution:**
```bash
# Test the URL directly
curl https://v0-replicate-checkout-design.vercel.app/
# If it works, try running with debug mode
python main.py --debug
```
### Problem: "Playwright browser not found"
**Solution:**
```bash
playwright install chromium
```
---
## π Understanding the Reports
### JSON Report Structure
```json
{
"metadata": { ... },
"summary": {
"total_findings": 15,
"high_severity": 3,
"medium_severity": 7,
"low_severity": 5,
"overall_score": 75
},
"findings": [
{
"component": "button",
"category": "colors",
"property": "backgroundColor",
"severity": "high",
"design_value": "#FF0000",
"website_value": "#FF0001",
"hf_analysis": "..."
}
]
}
```
### Severity Levels
- π΄ **High**: Critical issues affecting functionality or brand consistency
- π‘ **Medium**: Visual inconsistencies that should be addressed
- π’ **Low**: Minor differences that are visually acceptable
---
## π― Next Steps After POC
1. **Review Findings**: Check the generated reports
2. **Fix Issues**: Address high and medium severity findings
3. **Re-run Tests**: Execute again to verify fixes
4. **Add Gradio Dashboard**: For visual comparison (Phase 7)
5. **CI/CD Integration**: Automate testing in your pipeline
---
## π Need Help?
1. Check the main **README.md** for detailed documentation
2. Enable debug mode: `python main.py --debug`
3. Review the generated reports for specific issues
4. Check the troubleshooting section above
---
**Ready to test? Run: `python main.py`** π
|