Skip to content
Back to skills

Webapp Testing

ASecurity

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

  • 22 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added August 31, 2026
ai-agentspythongobashtestingdebuggingapifrontendbackend

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned August 31, 2026

npx -y skills add datit309/supergraph --skill webapp-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Webapp Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Webapp Testing
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/datit309-webapp-testing/badge)](https://www.skillsdirectory.com/skills/datit309-webapp-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: webapp-testing
description: Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
mcp: codebase-memory-mcp
---

# /supergraph:webapp-testing

Test and verify local web application UI behavior using Playwright.

Announce: "🌐 /supergraph:webapp-testing β€” testing web application..."

## When to Use

- Verifying a frontend change works correctly in the browser
- Debugging UI behavior or unexpected rendering
- Capturing screenshots for visual verification
- Checking browser console logs for errors
- After `/supergraph:frontend-design` to confirm feature works end-to-end

## Steps

### 0. Announce
"🌐 /supergraph:webapp-testing β€” testing [feature/page]..."

### 1. Understand what changed (graph context)

Before writing tests, use graph context to prioritize coverage:
Use `CBM_PROJECT`: call `detect_changes`, `search_graph` for changed routes/pages,
then `trace_path` for inbound/outbound call and data-flow paths. Run validated
`test-gaps`. Empty results are unavailable; use Serena/filesystem evidence.

**Serena (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.

### 2. Choose approach

```
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()
```

### 3. Recon before action (dynamic apps)

```python
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.

### 4. Execute test actions

Use discovered selectors from step 3. Write targeted Playwright assertions.

### 5. Verify flows covered

After tests pass, re-run:
Re-run `search_graph` then `trace_path(project=CBM_PROJECT, mode="data_flow")`.
All impacted flows tested? Any gaps β†’ add tests.

### 6. Report
```
βœ… /supergraph:webapp-testing
- Flows tested: N/M | Console errors: [list/none]
- Screenshots: [paths] | Selectors verified: [list]
- Next: /supergraph:verify β†’ /supergraph:review
```

## Using with_server.py

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:**
```bash
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_test.py
```

**Multiple servers:**
```bash
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):
```python
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()
```

## Reference Examples

If `examples/` directory exists in project:
- `examples/element_discovery.py` β€” discovering buttons, links, inputs
- `examples/static_html_automation.py` β€” file:// URLs for local HTML
- `examples/console_logging.py` β€” capturing console logs

## Rules

- ALWAYS wait for `networkidle` before inspecting DOM on dynamic apps
- NEVER read `scripts/with_server.py` source β€” use `--help` and invoke as black box
- Prefer MCP Playwright tools (`mcp__plugin_playwright_playwright__*`) over writing Python scripts when available
- Identify selectors from rendered state (recon-first), not from guessing
- Use descriptive selectors: `text=`, `role=`, CSS, or IDs β€” never positional selectors like `nth-child`
- Always close browser when done in Python scripts
- Re-check `trace_path` after tests pass to confirm full coverage

Files in this skill

  • SKILL.md5 KB
  • examples/console_logging.py1 KB
  • examples/element_discovery.py1.4 KB
  • examples/static_html_automation.py953 B
  • scripts/with_server.py4.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.