Home
cd ../playbooks
Developer ToolsIntermediate

Web App Testing

Test local web applications with Playwright automation for frontend verification, UI debugging, and screenshot capture.

15 minutes
By ComposioSource
#testing#playwright#automation#frontend#ui#debugging

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.

Or install from your terminal:
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.

README.md

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)

$Related Playbooks

Developer Tools

Writing for AI Agents: A Craft Reference

A theory of writing any document an agent consumes — skills, CLAUDE.md, reference docs — built on context pointers, an information hierarchy of steps versus disclosed reference, completion criteria, and leading words that anchor behavior in the fewest tokens.

10 minutes
Advanced
Developer Tools

Skill Creator

Create modular skills that extend Claude's capabilities with specialized knowledge, workflows, and tool integrations.

20 minutes
Advanced
Developer Tools

Skill Share

Create new Claude skills with proper structure and automatically distribute them to team Slack channels via Rube integration.

15 minutes
Intermediate
Developer Tools

Tech Debt Analyzer

Identify, analyze, document, and track technical debt in JavaScript/TypeScript codebases with automated detection and prioritized remediation plans.

10 minutes
Intermediate
Developer Tools

Test Specialist

Comprehensive JavaScript/TypeScript testing guidance with test writing, bug analysis, coverage analysis, and proactive issue detection.

10 minutes
Intermediate
Developer Tools

Accessibility Engineering for Components

Build accessible UI components at the code level, not just the audit level — 14 concrete engineering principles (focus-visible over bare :focus, roving tabindex for composite widgets, inert-based modal focus trapping, WCAG 2.5.8 hit-area minimums), a common-mistakes table with fixes, and a severity-rated review format ending in a hard Block/Needs-changes/Approve verdict.

5 minutes
Intermediate
Developer Tools

Adversary Emulation: MuddyWater

An intelligence-grounded, authorized purple-team emulation profile for MuddyWater (MITRE ATT&CK G0069), Iran's MOIS-linked cyber-espionage group — attribution, targeting, representative TTPs by ATT&CK tactic, emulation guidance mapped to generic red-team tooling, and paired detection/defense recommendations for every offensive technique, all under an explicit authorized-use caveat.

15 minutes
Advanced
Developer Tools

Adversary Emulation: Turla

An intelligence-grounded, authorized purple-team emulation profile for Turla (MITRE ATT&CK G0010), Russia's FSB-linked espionage group — attribution, distinctive TTPs (satellite C2 hijacking, steganographic email backdoors, parasitizing rival APT infrastructure), emulation guidance mapped to generic red-team tooling, and paired detection recommendations, under an explicit authorized-use and lab-only caveat for rootkit techniques.

15 minutes
Advanced
Developer Tools

AI Agent Red Team Methodology

A first-principles methodology for authorized red-team exercises against AI products, agents, MCP servers, skills, and repositories — capability and trust-boundary modeling, AI-specific attack hypothesis families (prompt injection, tool misuse, data leakage, SSRF), harmless-proof testing with canaries, one-variable-at-a-time adaptive iteration, and business-language evidence-based reporting.

10 minutes
Advanced
Developer Tools

Better Web Typography

Web typography engineering as a review discipline, not a style guide — CSS properties over raw variable-font tags, a semantic type scale with descending heading sizes, deliberate text-wrap usage (balance vs. pretty), tabular numbers for changing values, mobile input zoom fixes, and a severity-rated review report format with a concrete common-mistakes table.

5 minutes
Intermediate
Developer Tools

Agent DX CLI Scale

A 7-axis, 0-21 scoring scale for evaluating how well a CLI is designed for AI agents rather than humans — machine-readable output, raw payload input, schema introspection, context-window discipline, input hardening, safety rails, and agent knowledge packaging.

5 minutes
Intermediate
Developer Tools

Agent Design Philosophy

A mental model for designing AI agents in any domain — the model already knows how to be an agent, so design is about capabilities, knowledge, and context, added only as far as a Progressive Complexity ladder (basic → planning → subagents → skills) that real usage actually demands.

10 minutes
Intermediate

Browse all Developer Tools playbooks →