Step 7: UI tests in real browser - requires GATE 6 passed
Run comprehensive cross-browser UI tests with accessibility audits and visual regression for a feature. Use after unit tests pass to validate real browser behavior across viewports and devices.
/plugin marketplace add packlikez/claude-code-dev-plugin/plugin install dev@packlikez-dev-plugins<feature-name>□ GATE 6 PASSED (frontend unit tests complete)
□ All unit tests passing with ≥80% coverage
cat specs/{type}/{feature-name}.md # Spec
cat src/components/{feature}/*.tsx # Components
cat tests/unit/components/{feature}/*.test.tsx # Unit tests
cat skills/test-patterns-ui.md # UI test patterns
cat skills/ux-patterns.md # UX patterns (a11y, responsive, forms)
cat skills/gate-7-ui-test.md # Gate 7 criteria
From test-patterns-ui skill:
// ✅ PRIORITY 1: data-testid
await page.locator('[data-testid="email-input"]').fill('...');
// ✅ PRIORITY 2: id
await page.locator('#email-input').fill('...');
// ⚠️ PRIORITY 3: role + name
await page.getByRole('button', { name: 'Submit' }).click();
// ❌ AVOID: text, CSS, XPath
Use Task tool with test-writer agent:
Write UI tests for {feature-name}:
- Use data-testid for element selection
- All viewports (mobile 375px, tablet 768px, desktop 1280px)
- All browsers (Chrome, Firefox, Safari)
- Accessibility audit (axe)
- Keyboard navigation
- Visual regression baseline
- Follow test-patterns-ui skill
- Follow ux-patterns skill (accessibility, responsive, forms)
Per Component:
Cross-Browser:
Accessibility:
await expect(page).toHaveScreenshot('feature-desktop.png');
await expect(page).toHaveScreenshot('feature-mobile.png');
Use Task tool with gate-keeper agent:
Validate GATE 7 for {feature-name}
See gate-7-ui-test skill for all 20 criteria.
tests/ui/{feature}/tests/ui/visual/