QA Browser Automation
The agent drives Chrome MCP for live browser testing and uses four Python tools for deterministic health scoring, accessibility auditing, visual regression tracking, and report generation.
Clarify First
Before the QA sweep, confirm these inputs. If any is unknown or vague, ASK — do not assume:
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
Quick Start
# Score QA findings (0-100 weighted across 10 categories)
python scripts/qa_health_scorer.py findings.json --threshold 85 --baseline .qa-baselines/latest.json --save-baseline --json
# Audit HTML for WCAG 2.1 violations
python scripts/accessibility_auditor.py page.html --level AA --json
# Track visual regressions
python scripts/visual_regression_tracker.py --init --baseline-dir ./baselines
python scripts/visual_regression_tracker.py --register ./baselines
python scripts/visual_regression_tracker.py --baseline ./baselines --current ./screenshots --threshold 5
# Generate full QA report
python scripts/test_report_generator.py session_data.json --format markdown -o report.md
Tools Overview
| Tool |
Input |
Output |
qa_health_scorer.py |
Findings JSON |
Score 0-100, grade A-F, category breakdown, trend data |
accessibility_auditor.py |
HTML file (or stdin) |
WCAG violations by level with remediation guidance |
visual_regression_tracker.py |
Baseline + current screenshot dirs |
Pass/fail per page, change percentages |
test_report_generator.py |
Session data JSON |
Markdown or JSON report with recommendations |
All tools support --json for machine output. Health scorer and regression tracker return exit code 1 on failure (CI-friendly).
Workflow 1: Full Application QA Sweep (11 Phases)
Phase 1-2: Pre-flight and authentication.
- Verify
git status is clean. Abort if dirty.
- Create session directory:
.qa-sessions/{timestamp}/
- Authenticate via Chrome MCP if needed.
Phase 3-4: Orient and explore.
- Use
mcp__claude-in-chrome__read_page to build sitemap/page map.
- Navigate each route. Check
read_console_messages for errors, read_network_requests for 4xx/5xx.
- Test all forms with valid data, empty submissions, and boundary values.
Phase 5: State testing.
- Verify loading states (skeleton screens, not blank), empty states (guides to first action), error states, success states, partial states.
- Four shadow paths per interaction: happy path, nil input, empty input, error upstream.
Phase 6: Cross-device and security.
- Resize to 320px, 768px, 1024px, 1440px, 1920px.
- Check touch targets (44x44px min), layout shifts.
- Verify security headers (CSP, HSTS, X-Frame-Options), cookie flags.
Phase 7-8: Document and score.
- Record every finding with screenshot evidence. No finding without evidence.
- Classify by severity (P0-P4) and category (10 categories).
- Run:
python scripts/qa_health_scorer.py findings.json --baseline .qa-baselines/latest.json
Phase 9: Triage and fix loop.
- P3/P4: AUTO-FIX, commit atomically, verify.
- P0/P1/P2: ASK, present evidence, propose fix, wait for approval.
- After each fix: re-run check. If fail:
git revert.
- Hard stop at 50 fixes.
Phase 10-11: Regression check and report.
- Re-visit fixed pages. Verify no new errors.
- Generate report:
python scripts/test_report_generator.py session.json --save-baseline
Validation checkpoint: Health score >= 85. Zero P0 findings. WCAG AA >= 95%.
Workflow 2: Visual Regression Testing
# Set up baseline
python scripts/visual_regression_tracker.py --init --baseline-dir ./baselines
# Capture and register screenshots
python scripts/visual_regression_tracker.py --register ./baselines
# After changes, compare
python scripts/visual_regression_tracker.py --baseline ./baselines --current ./screenshots --threshold 5 --json
# Accept intentional changes
python scripts/visual_regression_tracker.py --update-baseline --baseline ./baselines --current ./screenshots
Pages exceeding the threshold (default 5%) are flagged as regressions. Uses SHA-256 hashing and byte-level comparison.
Workflow 3: Accessibility Audit
python scripts/accessibility_auditor.py page.html --level AA --json
curl -s https://example.com | python scripts/accessibility_auditor.py - --level AAA
What gets checked by level:
- A (Must Fix): Alt text, page language, form labels, headings, duplicate IDs, autoplay media
- AA (Should Fix): Color contrast (4.5:1 text, 3:1 large), heading hierarchy, focus visible, error identification
- AAA (Nice to Have): Enhanced contrast (7:1), extended audio, reading level
Each violation includes: WCAG criterion, severity, element selector, and remediation guidance.
Testing Tiers
| Tier |
Duration |
Scope |
| Quick |
30s |
Console errors, broken links, basic a11y, mobile resize |
| Standard |
2-5 min |
+ Top 10 routes, forms, contrast, Core Web Vitals |
| Deep |
10-20 min |
+ Full sitemap, state testing, WCAG AA, performance, visual regression, security headers |
| Exhaustive |
30+ min |
+ Every element, WCAG AAA, all pages performance, 5 breakpoints, auth edge cases, memory leaks |
Health Scoring System
10 weighted categories, score 0-100:
| Category |
Weight |
Measures |
| Functional |
18% |
Forms, CRUD, navigation flows |
| Accessibility |
13% |
WCAG compliance, keyboard nav |
| Console Errors |
12% |
JS errors, unhandled rejections |
| UX Flow |
12% |
Logical navigation, clear feedback |
| Performance |
12% |
Core Web Vitals within thresholds |
| Visual Consistency |
10% |
Layout shifts, alignment, z-index |
| Broken Links |
8% |
HTTP 4xx/5xx, dead anchors |
| Content Quality |
5% |
Spelling, placeholder text, truncation |
| Security Headers |
5% |
CSP, HSTS, cookie flags |
| Mobile Responsive |
5% |
Breakpoints, touch targets, no h-scroll |
Severity deductions: P0: -30, P1: -18, P2: -10, P3: -4, P4: -1.
Grades: A (90-100), B (80-89), C (70-79), D (60-69), F (0-59).
Safety Controls
- Clean working tree required -- abort if
git status dirty.
- Max 50 fixes per session -- hard stop.
- Risk accumulator -- component (+5), style (+2), config (+8), revert (+15). Stop at 25% of budget.
- WTF heuristic -- 3 consecutive fix verification failures = stop entirely.
- Atomic commits -- one fix = one commit:
fix(qa): [P{severity}] {description}
Troubleshooting
| Problem |
Cause |
Solution |
| Scorer exits code 1 with no errors |
Score below --threshold (default 70) |
Check score in output; raise threshold or fix findings |
Auditor reports parse-error |
Malformed HTML |
Verify file is complete; check curl is not returning redirect |
| Regression tracker 100% change on all pages |
Baseline manifest empty |
Run --init then --register before comparing |
| Findings default to P3/functional |
Missing severity or category keys |
Include both keys in each finding dict |
| Chrome MCP returns stale content after SPA nav |
DOM updated without full page load |
Wait for transition, call read_page again |
References
| Guide |
Path |
| Browser Testing Methodology |
references/browser_testing_methodology.md |
| WCAG Compliance Guide |
references/wcag_compliance_guide.md |
| Performance Benchmarks |
references/performance_benchmarks.md |
Integration Points
| Skill |
Integration |
code-reviewer |
Health score and findings in PR review context |
senior-frontend |
Visual regression baselines align with component library |
senior-devops |
Health score gates CI/CD via exit code |
senior-secops |
Security header findings escalate to security review |
incident-commander |
P0 findings trigger incident response |
Last Updated: April 2026
Version: 2.1.0
1---2name: qa-browser-automation3description: Browser-based QA combining Chrome MCP control with Python analysis tools. Use when performing browser QA testing, visual regression tracking, WCAG accessibility auditing, performance profiling, or health-scoring web applications.4license: MIT + Commons Clause5---6# QA Browser Automation
7
8The agent drives Chrome MCP for live browser testing and uses four Python tools for deterministic health scoring, accessibility auditing, visual regression tracking, and report generation.
9
10---
11
12## Clarify First
13
14Before the QA sweep, confirm these inputs. If any is unknown or vague, ASK — do not assume:
15
16- [ ] **Target URL/app + auth** — what to test and how to log in (the subject of the entire sweep)
17- [ ] **Testing tier** — Quick / Standard / Deep / Exhaustive (sets scope, breakpoints, and duration)
18- [ ] **Fix autonomy** — auto-fix P3/P4 and commit, vs report-only / ask before any code change (changes whether the working tree is modified)
19- [ ] **WCAG target level** — A / AA / AAA (sets the accessibility pass bar)
20
21Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
22
23## Quick Start
24
25```bash
26# Score QA findings (0-100 weighted across 10 categories)
27python scripts/qa_health_scorer.py findings.json --threshold 85 --baseline .qa-baselines/latest.json --save-baseline --json
28
29# Audit HTML for WCAG 2.1 violations
30python scripts/accessibility_auditor.py page.html --level AA --json
31
32# Track visual regressions
33python scripts/visual_regression_tracker.py --init --baseline-dir ./baselines
34python scripts/visual_regression_tracker.py --register ./baselines
35python scripts/visual_regression_tracker.py --baseline ./baselines --current ./screenshots --threshold 5
36
37# Generate full QA report
38python scripts/test_report_generator.py session_data.json --format markdown -o report.md
39```
40
41## Tools Overview
42
43| Tool | Input | Output |
44|------|-------|--------|
45| `qa_health_scorer.py` | Findings JSON | Score 0-100, grade A-F, category breakdown, trend data |
46| `accessibility_auditor.py` | HTML file (or stdin) | WCAG violations by level with remediation guidance |
47| `visual_regression_tracker.py` | Baseline + current screenshot dirs | Pass/fail per page, change percentages |
48| `test_report_generator.py` | Session data JSON | Markdown or JSON report with recommendations |
49
50All tools support `--json` for machine output. Health scorer and regression tracker return exit code 1 on failure (CI-friendly).
51
52---
53
54## Workflow 1: Full Application QA Sweep (11 Phases)
55
56**Phase 1-2: Pre-flight and authentication.**
57- Verify `git status` is clean. Abort if dirty.
58- Create session directory: `.qa-sessions/{timestamp}/`
59- Authenticate via Chrome MCP if needed.
60
61**Phase 3-4: Orient and explore.**
62- Use `mcp__claude-in-chrome__read_page` to build sitemap/page map.
63- Navigate each route. Check `read_console_messages` for errors, `read_network_requests` for 4xx/5xx.
64- Test all forms with valid data, empty submissions, and boundary values.
65
66**Phase 5: State testing.**
67- Verify loading states (skeleton screens, not blank), empty states (guides to first action), error states, success states, partial states.
68- **Four shadow paths per interaction:** happy path, nil input, empty input, error upstream.
69
70**Phase 6: Cross-device and security.**
71- Resize to 320px, 768px, 1024px, 1440px, 1920px.
72- Check touch targets (44x44px min), layout shifts.
73- Verify security headers (CSP, HSTS, X-Frame-Options), cookie flags.
74
75**Phase 7-8: Document and score.**
76- Record every finding with screenshot evidence. No finding without evidence.
77- Classify by severity (P0-P4) and category (10 categories).
78- Run: `python scripts/qa_health_scorer.py findings.json --baseline .qa-baselines/latest.json`
79
80**Phase 9: Triage and fix loop.**
81- P3/P4: AUTO-FIX, commit atomically, verify.
82- P0/P1/P2: ASK, present evidence, propose fix, wait for approval.
83- After each fix: re-run check. If fail: `git revert`.
84- Hard stop at 50 fixes.
85
86**Phase 10-11: Regression check and report.**
87- Re-visit fixed pages. Verify no new errors.
88- Generate report: `python scripts/test_report_generator.py session.json --save-baseline`
89
90**Validation checkpoint:** Health score >= 85. Zero P0 findings. WCAG AA >= 95%.
91
92---
93
94## Workflow 2: Visual Regression Testing
95
96```bash
97# Set up baseline
98python scripts/visual_regression_tracker.py --init --baseline-dir ./baselines
99# Capture and register screenshots
100python scripts/visual_regression_tracker.py --register ./baselines
101# After changes, compare
102python scripts/visual_regression_tracker.py --baseline ./baselines --current ./screenshots --threshold 5 --json
103# Accept intentional changes
104python scripts/visual_regression_tracker.py --update-baseline --baseline ./baselines --current ./screenshots
105```
106
107Pages exceeding the threshold (default 5%) are flagged as regressions. Uses SHA-256 hashing and byte-level comparison.
108
109---
110
111## Workflow 3: Accessibility Audit
112
113```bash
114python scripts/accessibility_auditor.py page.html --level AA --json
115curl -s https://example.com | python scripts/accessibility_auditor.py - --level AAA
116```
117
118**What gets checked by level:**
119- **A (Must Fix):** Alt text, page language, form labels, headings, duplicate IDs, autoplay media
120- **AA (Should Fix):** Color contrast (4.5:1 text, 3:1 large), heading hierarchy, focus visible, error identification
121- **AAA (Nice to Have):** Enhanced contrast (7:1), extended audio, reading level
122
123Each violation includes: WCAG criterion, severity, element selector, and remediation guidance.
124
125---
126
127## Testing Tiers
128
129| Tier | Duration | Scope |
130|------|----------|-------|
131| **Quick** | 30s | Console errors, broken links, basic a11y, mobile resize |
132| **Standard** | 2-5 min | + Top 10 routes, forms, contrast, Core Web Vitals |
133| **Deep** | 10-20 min | + Full sitemap, state testing, WCAG AA, performance, visual regression, security headers |
134| **Exhaustive** | 30+ min | + Every element, WCAG AAA, all pages performance, 5 breakpoints, auth edge cases, memory leaks |
135
136---
137
138## Health Scoring System
139
14010 weighted categories, score 0-100:
141
142| Category | Weight | Measures |
143|----------|--------|----------|
144| Functional | 18% | Forms, CRUD, navigation flows |
145| Accessibility | 13% | WCAG compliance, keyboard nav |
146| Console Errors | 12% | JS errors, unhandled rejections |
147| UX Flow | 12% | Logical navigation, clear feedback |
148| Performance | 12% | Core Web Vitals within thresholds |
149| Visual Consistency | 10% | Layout shifts, alignment, z-index |
150| Broken Links | 8% | HTTP 4xx/5xx, dead anchors |
151| Content Quality | 5% | Spelling, placeholder text, truncation |
152| Security Headers | 5% | CSP, HSTS, cookie flags |
153| Mobile Responsive | 5% | Breakpoints, touch targets, no h-scroll |
154
155**Severity deductions:** P0: -30, P1: -18, P2: -10, P3: -4, P4: -1.
156
157**Grades:** A (90-100), B (80-89), C (70-79), D (60-69), F (0-59).
158
159---
160
161## Safety Controls
162
163- **Clean working tree required** -- abort if `git status` dirty.
164- **Max 50 fixes per session** -- hard stop.
165- **Risk accumulator** -- component (+5), style (+2), config (+8), revert (+15). Stop at 25% of budget.
166- **WTF heuristic** -- 3 consecutive fix verification failures = stop entirely.
167- **Atomic commits** -- one fix = one commit: `fix(qa): [P{severity}] {description}`
168
169---
170
171## Troubleshooting
172
173| Problem | Cause | Solution |
174|---------|-------|----------|
175| Scorer exits code 1 with no errors | Score below `--threshold` (default 70) | Check score in output; raise threshold or fix findings |
176| Auditor reports `parse-error` | Malformed HTML | Verify file is complete; check curl is not returning redirect |
177| Regression tracker 100% change on all pages | Baseline manifest empty | Run `--init` then `--register` before comparing |
178| Findings default to P3/functional | Missing `severity` or `category` keys | Include both keys in each finding dict |
179| Chrome MCP returns stale content after SPA nav | DOM updated without full page load | Wait for transition, call `read_page` again |
180
181---
182
183## References
184
185| Guide | Path |
186|-------|------|
187| Browser Testing Methodology | `references/browser_testing_methodology.md` |
188| WCAG Compliance Guide | `references/wcag_compliance_guide.md` |
189| Performance Benchmarks | `references/performance_benchmarks.md` |
190
191---
192
193## Integration Points
194
195| Skill | Integration |
196|-------|-------------|
197| `code-reviewer` | Health score and findings in PR review context |
198| `senior-frontend` | Visual regression baselines align with component library |
199| `senior-devops` | Health score gates CI/CD via exit code |
200| `senior-secops` | Security header findings escalate to security review |
201| `incident-commander` | P0 findings trigger incident response |
202
203---
204
205**Last Updated:** April 2026
206**Version:** 2.1.0