From supergraph
Tests and verifies local web application UI behavior using Playwright. Supports screenshots, console log inspection, and DOM interaction for frontend debugging.
How this skill is triggered — by the user, by Claude, or both
Slash command
/supergraph:webapp-testingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Test and verify local web application UI behavior using Playwright.
Test and verify local web application UI behavior using Playwright.
Announce: "🌐 /supergraph:webapp-testing — testing web application..."
/supergraph:frontend-design to confirm feature works end-to-end"🌐 /supergraph:webapp-testing — testing [feature/page]..."
Before writing tests, use graph context to prioritize coverage:
mcp__code-review-graph__get_affected_flows_tool(files=[changed_frontend_pages])
mcp__code-review-graph__get_impact_radius_tool(files=[changed_fe], depth=2)
mcp__code-review-graph__get_knowledge_gaps_tool()
get_affected_flows_tool — find all user flows that need testing when a page/component changesget_impact_radius_tool — which other pages, components, or API routes are affectedget_knowledge_gaps_tool — find untested frontend files; prioritize high-impact onesSerena (optional): For changed component symbols:
mcp__serena__find_referencing_symbols(symbol=<changed_component>)
If a Playwright test fails on a renamed component/route, find_referencing_symbols surfaces all import sites. Skip if Serena unavailable.
Is it static HTML?
├─ Yes → Read HTML file directly to identify selectors
│ Then write Playwright script using those selectors
│
└─ No (dynamic webapp) → Is server already running?
├─ No → Run: python scripts/with_server.py --help
│ Then start server + write Playwright script
│
└─ Yes → Reconnaissance-then-action:
1. Navigate and wait for networkidle
2. Screenshot or inspect DOM
3. Identify selectors from rendered state
4. Execute actions with discovered selectors
MCP Playwright option: If mcp__plugin_playwright_playwright__* tools are available, prefer them over writing Python scripts — no script file needed:
mcp__plugin_playwright_playwright__browser_navigate(url="http://localhost:3000")
mcp__plugin_playwright_playwright__browser_snapshot()
mcp__plugin_playwright_playwright__browser_click(selector="...")
mcp__plugin_playwright_playwright__browser_take_screenshot()
mcp__plugin_playwright_playwright__browser_console_messages()
page.wait_for_load_state('networkidle') # CRITICAL: wait before inspecting
page.screenshot(path='/tmp/inspect.png', full_page=True)
content = page.content()
page.locator('button').all()
Never inspect DOM before networkidle on dynamic apps — selectors may not exist yet.
Use discovered selectors from step 3. Write targeted Playwright assertions.
After tests pass, re-run:
mcp__code-review-graph__get_affected_flows_tool(files=[changed_files])
All impacted flows tested? Any gaps → add tests.
✅ /supergraph:webapp-testing
- Flows tested: N/M | Console errors: [list/none]
- Screenshots: [paths] | Selectors verified: [list]
- Next: /supergraph:verify → /supergraph:review
Helper script scripts/with_server.py manages server lifecycle. Always run --help first — do NOT read the source unless absolutely necessary (large file, pollutes context window).
Single server:
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_test.py
Multiple servers:
python scripts/with_server.py \
--server "cd backend && python server.py" --port 3000 \
--server "cd frontend && npm run dev" --port 5173 \
-- python your_test.py
Automation script template (server managed externally by with_server.py):
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto('http://localhost:5173')
page.wait_for_load_state('networkidle') # CRITICAL
# ... test logic
browser.close()
If examples/ directory exists in project:
examples/element_discovery.py — discovering buttons, links, inputsexamples/static_html_automation.py — file:// URLs for local HTMLexamples/console_logging.py — capturing console logsnetworkidle before inspecting DOM on dynamic appsscripts/with_server.py source — use --help and invoke as black boxmcp__plugin_playwright_playwright__*) over writing Python scripts when availabletext=, role=, CSS, or IDs — never positional selectors like nth-childget_affected_flows_tool after tests pass to confirm full coveragenpx claudepluginhub datit309/supergraph --plugin supergraphTests local web applications using Playwright: launches servers, takes screenshots, inspects DOM, and runs automation scripts.
Tests local web apps with Python Playwright: manages server lifecycles via helpers, captures screenshots, inspects DOM, automates UI interactions for frontend verification.
Tests local web applications using Python Playwright scripts. Manages dev servers, captures screenshots, inspects DOM, views browser logs, and verifies UI functionality.