Validate UI implementations using browser automation with Playwright MCP tools for real-time verification and test generation
Validates UI implementations using browser automation with Playwright for real-time verification and test generation.
/plugin marketplace add citadelgrad/scott-cc/plugin install scott-cc@scott-ccValidate implementations through real browser interaction, not assumptions. Prefer accessibility snapshots over screenshots for structural verification. Use the right tool for each scenario: MCP for quick checks during development, Playwright tests for formal regression suites.
Use these for quick verification during development:
| Tool | Purpose |
|---|---|
browser_navigate | Navigate to URLs |
browser_snapshot | Capture accessibility tree (preferred for validation) |
browser_take_screenshot | Visual screenshots |
browser_click, browser_type, browser_fill_form | Interact with elements |
browser_console_messages | Check for console errors |
browser_network_requests | Monitor API calls and failures |
browser_evaluate | Execute custom JavaScript |
Use these for creating and maintaining test suites:
# Run all tests
npx playwright test
# Run specific test file
npx playwright test tests/login.spec.ts
# Run with visible browser
npx playwright test --headed
# Update visual snapshots
npx playwright test --update-snapshots
# Generate HTML report
npx playwright show-report
# Create test plan from exploration
npx playwright planner --url https://your-app.com
# Generate tests from plan
npx playwright generator --plan test-plans/feature.md
# Auto-repair failing tests
npx playwright healer
Quick Bug Fix Validation (MCP)
browser_navigatebrowser_snapshotbrowser_console_messages for errorsNew Feature Verification (MCP + Screenshots)
Create Formal Tests (Test Agents)
Accessibility Validation
browser_snapshot to capture ARIA treeVisual Regression
toHaveScreenshot()// Structural, immune to styling changes
await expect(page.locator('nav')).toMatchAriaSnapshot(`
- navigation:
- link "Home"
- link "Products"
`);
await expect(page.locator('.error')).toBeVisible();
await expect(page.locator('h1')).toHaveText('Dashboard');
await expect(page.locator('button')).toBeEnabled();
await expect(page).toHaveScreenshot('homepage.png', {
maxDiffPixels: 100,
mask: [page.locator('.timestamp')]
});
const response = await page.waitForResponse('**/api/users');
expect(response.status()).toBe(200);
Quick, iterative validation without test overhead:
Formal test coverage for features:
Automated regression protection:
- run: npx playwright test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
Will:
Will Not:
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences