Skip to content
Back to skills

Webapp Testing

ASecurity

Toolkit for interacting with and testing local web applications using Playwright. Verify frontend functionality, debug UI behavior, capture screenshots, and view browser logs.

  • 7 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 6, 2026
toolspythongobashtestingapifrontendbackend

Works with

  • api

Security analysis

A100/100

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

Scanned June 6, 2026

npx -y skills add mediar-ai/skillhubz --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/mediar-ai-webapp-testing/badge)](https://www.skillsdirectory.com/skills/mediar-ai-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
# Web Application Testing

Toolkit for interacting with and testing local web applications using Playwright. Verify frontend functionality, debug UI behavior, capture screenshots, and view browser logs.

## Prerequisites

- Python with Playwright installed
- Local web application to test
- Understanding of web selectors

## Instructions

### Decision Tree

```
Is it static HTML?
├─ Yes → Read HTML file directly for selectors
│        → Write Playwright script
└─ No (dynamic webapp)
   ├─ Server not running → Use with_server.py helper
   └─ Server running → Reconnaissance-then-action pattern
```

### Using with_server.py

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

### Playwright Script Template

```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 for dynamic apps
    # ... automation logic
    browser.close()
```

### Reconnaissance-Then-Action

1. **Inspect rendered DOM:**
   ```python
   page.screenshot(path='/tmp/inspect.png', full_page=True)
   content = page.content()
   page.locator('button').all()
   ```

2. **Identify selectors** from inspection

3. **Execute actions** using discovered selectors

### Best Practices

- Always wait for `networkidle` before DOM inspection
- Use sync_playwright() for synchronous scripts
- Always close browser when done
- Use descriptive selectors: `text=`, `role=`, CSS, IDs

## Error Handling

- Don't inspect DOM before waiting for networkidle
- Add waits: `page.wait_for_selector()` or `page.wait_for_timeout()`
- Use bundled scripts as black boxes - run `--help` first

## Notes

- Helper scripts handle common workflows reliably
- Examples: element_discovery.py, static_html_automation.py
- Capture console logs with console_logging.py

Source: anthropics/skills

Files in this skill

  • manifest.json345 B
  • skill.md2.2 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…