AntiGem Browser QA
Overview
Unified, token-lean browser testing skill for AntiGem's native browser_mcp (17 tools). Covers 8 testing aspects via progressive disclosure: exploratory flows, forms/security, layout/a11y/visual, PWA/offline/i18n, and in-page audit snippets. Mandatory protocol: tab reuse → lock → ref-first discovery → React-safe inputs → batch actions → runtime gate (console + network).
When to Use
- E2E test authoring or execution on web/PWA apps
- Exploratory bug hunting (first-time user flows, adversarial sequences)
- Form boundary fuzzing, XSS payloads, file uploads, drag-drop, canvas/WebGL
- WCAG 2.1 AA/AAA audits, 200% zoom reflow, CLS, touch targets (≥48px/≥60dp)
- Visual regression baseline-vs-build diffing, responsive breakpoints
- Service Worker lifecycle, IndexedDB/Dexie offline sync, Indic glyph/matra clipping
- Runtime console error / network failure zero-tolerance gates
Mandatory Execution Protocol
- Tab Reuse:
browser_list_tabs → reuse existing or browser_open_url
- Touch/Zoom Lock:
browser_lock(locked=true) before multi-step chains
- Ref-First Discovery:
browser_find(query="...") (preferred) or browser_read_page(filter="interactive") for ARIA tree with stable ref_N IDs
- React-Safe Inputs:
browser_form_input(ref, value) for <input>, <textarea>, <select>, checkboxes/switches, radios, contenteditable
- Trusted Actuation:
browser_computer (left_click, hover, left_click_drag, key, scroll_to, screenshot, zoom [x0,y0,x1,y1], wait); browser_upload_file for file inputs; browser_handle_dialog for alerts
- Round-Trip Batching:
browser_batch for deterministic multi-step chains
- Runtime Gate (Zero Tolerance):
browser_get_console_logs(pattern="error|warn") + browser_read_network (reload first if tab predated MCP attach) after every screen
- Unlock:
browser_lock(locked=false) on exit
8-Aspect Unified Checklist
| # | Aspect | Pass/Fail Gates |
|---|
| 1 | Exploratory & Flows | First-time user simulation; multi-route nav; browser.goBack() modal priority; focus traps; defect report format |
| 2 | Forms & Components | Boundary fuzzing; numeric clamping; inline blur validation; scroll-to-first-error; double-submit debounce; XSS sanitization; file upload; drag-drop; canvas/SVG verify |
| 3 | Security Testing | CSP headers; XSS payload injection; permission denial fallbacks; secure cookie flags |
| 4 | Layout, A11y, Visual | WCAG AA ≥4.5:1 / Sunlight AAA ≥7.0:1 / Scotopic Red #000000; 200% zoom reflow; CLS ≤0.1; prefers-reduced-motion; touch targets ≥48px (std) / ≥64px (rural); visual diff baseline-vs-build |
| 5 | PWA, Offline, i18n | Manifest & SW lifecycle; IndexedDB/Dexie ACID + useLiveQuery; offline simulation + sync queue; Indic conjuncts/matra clipping; document.documentElement.lang; Lakhs/Crores + tabular-nums |
| 6 | Web APIs & Permissions | navigator.vibrate?.(), camera/geo permission denials; hardware API fallbacks |
| 7 | Runtime Diagnostics | Console error fail-fast; network 4xx/5xx fail-fast; LCP/memory audits via browser_eval_js |
| 8 | Mobile & Viewport | browser_set_view_mode mobile/desktop matrix; browser_computer(action="zoom") micro-inspection |
Progressive Reference Router Table
| Task Focus | Load Reference |
|---|
| Exploratory bug-hunt, first-time flows, modal focus, navigation | references/01-exploratory-and-flows.md |
| Form validation, boundary fuzzing, file upload, drag-drop, canvas, XSS | references/02-forms-components-security.md |
| WCAG audit, contrast, zoom reflow, CLS, touch targets, visual diff | references/03-layout-a11y-visual.md |
| SW lifecycle, IndexedDB, offline sync, Indic typography, permissions | references/04-pwa-offline-i18n-apis.md |
| In-page audit snippets (orphaned labels, bounding boxes, contrast, SW, IndexedDB) | references/05-eval-js-audit-snippets.md |
Quick Reference: browser_mcp Tool Mapping
| Upstream Primitive | AntiGem Tool |
|---|
page.fill() / selectOption() / check() | browser_form_input(ref, value) |
page.click() / keyboard.press() / hover() / dragAndDrop() | browser_computer(left_click, hover, left_click_drag, key, scroll_to, ...) |
page.setInputFiles() | browser_upload_file |
page.on('dialog') | browser_handle_dialog(accept=true/false) |
page.evaluate() | browser_eval_js (top-level await, returns JSON) |
page.on('console') / page.on('pageerror') | browser_get_console_logs(pattern="...") |
page.on('response') / HAR | browser_read_network |
| Multi-step chains | browser_batch + browser_lock |
| Viewport / screenshot / zoom | `browser_set_view_mode + browser_computer(screenshot |
Common Mistakes
- Skipping
browser_lock → accidental touch/zoom corrupts ref IDs
- Using coordinates instead of refs → brittle, breaks on reflow
- Not running runtime gate → misses console errors / failed requests
- Loading all references at once → token bloat; load on demand per router table
- Forgetting
browser_lock(false) → leaves tab locked for user
Real-World Impact
- 90% token reduction vs full DOM snapshots via
browser_find/browser_read_page(filter="interactive")
- Single
browser_eval_js call runs full screen audit (a11y + geometry + contrast + SW + IndexedDB)
- Zero-tolerance runtime gate catches regressions before they reach users