Web Application Testing
This toolkit enables testing of local web applications through native Python Playwright scripts, supporting frontend verification, UI debugging, screenshot capture, and browser log inspection.
Trigger
- When user requests testing of web applications
- Frontend verification and UI debugging needed
- Screenshot capture or visual validation required
- Browser console log inspection needed
Capabilities
Available Helper Scripts:
scripts/with_server.py- Manages server lifecycle for single or multiple servers
Core Workflow
Decision Tree
- Static HTML? → Read the file directly and identify CSS selectors
- Dynamic webapp with no running server? → Use
with_server.pyhelper - Server already running? → Apply reconnaissance-then-action pattern
Reconnaissance-Then-Action Pattern
Recommended sequence:
- Navigate to the application and wait for
networkidlestate - Capture screenshots or inspect the DOM
- Discover selectors from the rendered page
- Execute automation actions using those selectors
Critical Best Practices
- Always run scripts with
--helpfirst before reading source code - Wait for
page.wait_for_load_state('networkidle')before inspection - Use
sync_playwright()for synchronous automation - Employ descriptive selectors (text=, role=, CSS, IDs)
- Always close browsers when finished
Use When
- Verifying web application functionality
- Testing form interactions
- Capturing screenshots for documentation
- Debugging layout issues
- Automating user workflows
- Running E2E test scenarios