Web App Testing
Test local web applications with Playwright automation for frontend verification, UI debugging, and screenshot capture.
You push a UI change and manually click through 20 pages to check nothing broke — every single time. This playbook uses Playwright to automate web application testing with frontend verification, visual regression detection, UI debugging, and screenshot capture across browsers.
Who it's for: frontend developers adding automated browser tests to their web applications, QA engineers building Playwright test suites for regression testing, full-stack developers verifying UI changes don't break existing functionality, solo developers who can't manually test every page after each deploy, teams transitioning from manual QA to automated browser testing
Example
"Set up automated testing for our React web app's critical flows" → Web testing pipeline: Playwright test scaffolding for login, checkout, and dashboard flows, element interaction testing (forms, buttons, navigation), visual screenshot comparison detecting UI regressions, cross-browser testing across Chrome, Firefox, and Safari, and CI integration running tests automatically on every pull request
CLAUDE.md Template
New here? 3-minute setup guide → | Already set up? Copy the template below.
npx ccplaybooks add webapp-testing# Web App Testing
Test local web applications through Playwright automation scripts for frontend verification, UI debugging, screenshot capture, and browser log inspection.
## Core Capabilities
- Frontend functionality verification
- UI debugging and inspection
- Screenshot capture at any point
- Browser console log access
- Automated user flow testing
Get new playbooks like this one
One email a week with new Claude Code workflows. Free, like everything here.
No spam. Unsubscribe anytime.
What This Does
Test local web applications using Playwright automation scripts. Verify frontend functionality, debug UI issues, capture screenshots, and inspect browser logs with a reconnaissance-then-action approach.
Quick Start
Step 1: Create a Testing Project
mkdir -p ~/Projects/webapp-testing
Step 2: Download the Template
Click Download above, then:
mv ~/Downloads/CLAUDE.md ~/Projects/webapp-testing/
Step 3: Start Testing
cd ~/Projects/webapp-testing
claude
Then say: "Test my web app running at localhost:3000"
Testing Approaches
| Scenario | Approach |
|---|---|
| Static HTML | Read file, extract selectors, automate |
| Dynamic (server not running) | Use helper script to manage server |
| Dynamic (server running) | Reconnaissance first, then actions |
Reconnaissance-Then-Action Pattern
Step 1: Navigate
await page.goto('http://localhost:3000');
Step 2: Wait for Load
await page.wait_for_load_state('networkidle');
Step 3: Capture State
- Take screenshots
- Inspect DOM structure
- Discover selectors
Step 4: Execute Actions
- Click, type, submit
- Verify results
- Capture final state
Key Capabilities
- Frontend Verification: Test UI components work correctly
- Visual Debugging: Screenshot capture at any point
- Log Inspection: Access browser console logs
- Automation: Script complex user flows
- Server Management: Handle server lifecycle
Example Prompts
- "Take a screenshot of my app at localhost:3000"
- "Test the login flow on my local server"
- "Verify the form submission works correctly"
- "Check for JavaScript errors in the console"
- "Automate clicking through the onboarding"
Helper Script
# Manage server lifecycle for testing
python scripts/with_server.py
Run with --help first to see usage options.
Common Testing Tasks
| Task | Action |
|---|---|
| Screenshot | Capture current state |
| Click | Interact with elements |
| Type | Fill form fields |
| Submit | Send forms |
| Assert | Verify content |
| Wait | Handle async operations |
Critical Tips
- Wait for networkidle: Dynamic apps need JavaScript to execute
- Check --help first: Don't read script source until you try running
- Discover selectors: Inspect rendered state, not source HTML
- Handle async: Web apps often have delayed content
Tips
- Always wait for network idle on dynamic sites
- Screenshot before and after actions
- Check console for JavaScript errors
- Use stable selectors (data-testid, roles)