pupuking723

Webapp Testing Anthropic

开发编程v1.0.0
作者:pupuking723更新于 2026-05-17webapp-testing-anthropic@clawhub_pupuking723/webapp-testing-anthropic
Bug 修复测试生成#Playwright#Debugging#Browser

据 AlphaMoat 统计,截至 2026-09,Webapp Testing Anthropic 累计下载 1,833 次、获 3 个星标,在全部 5,078 个 AI 技能中排名第 4,553 位,在「开发编程」分类(577 个)中排名第 542 位。

累计安装
129
累计下载
1,833
星标
3
全站排名
#4,553
全站前 90% · 「开发编程」前 94%
平台累计安装累计下载星标评论
ClawHub ↗431,595--
SkillHub ↗1291,8333—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

该工具包用于测试本地静态或动态 Web 应用,可检查页面、调试 UI、截取浏览器画面并查看浏览器日志。它要求先用帮助参数了解辅助脚本用法。测试服务器命令可能执行项目上下文中的本地命令,截图和日志也可能包含敏感页面内容;仅对可信项目操作,并将这些产物作为敏感数据保护。

资料发布于 2026-10-29

可以用来做什么

  • 验证本地 Web 应用的页面和交互
  • 调试前端行为并检查浏览器日志
  • 为测试结果采集页面截图

什么时候用

  • 需要通过 Playwright 测试本地 Web 应用时
  • 可以先检查辅助脚本的参数和服务器命令时
  • 能够保护截图和日志中的页面信息时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

请用 Playwright 检查这个本地 Web 页面的主要交互,先查看辅助脚本用法;不要连接外部站点,并避免把含敏感信息的截图或日志输出到共享位置。

月度数据趋势

累计下载1,833
2501,1001,9502026-03 · 累计下载 3672026-05 · 累计下载 9582026-07 · 累计下载 1,3512026-08 · 累计下载 1,5522026-09 · 累计下载 1,83326-0326-09
星标3
0232026-03 · 星标 -2026-05 · 星标 32026-07 · 星标 32026-08 · 星标 32026-09 · 星标 326-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-091,833—3
2026-081,552+14.9%3
2026-071,351—3
2026-05958—3
2026-03367—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.8 KB · ClawHub v1.0.0
---
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.
license: Complete terms in LICENSE.txt
---

# Web Application Testing

To test local web applications, write native Python Playwright scripts.
展开全部(共 96 行)
**Helper Scripts Available**:
- `scripts/with_server.py` - Manages server lifecycle (supports multiple servers)

**Always run scripts with `--help` first** to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.

## Decision Tree: Choosing Your Approach

```
User task → Is it static HTML?
    ├─ Yes → Read HTML file directly to identify selectors
    │         ├─ Success → Write Playwright script using selectors
    │         └─ Fails/Incomplete → Treat as dynamic (below)
    │
    └─ No (dynamic webapp) → Is the server already running?
        ├─ No → Run: python scripts/with_server.py --help
        │        Then use the helper + write simplified Playwright script
        │
        └─ Yes → Reconnaissance-then-action:
            1. Navigate and wait for networkidle
            2. Take screenshot or inspect DOM
            3. Identify selectors from rendered state
            4. Execute actions with discovered selectors
```

## Example: Using with_server.py

To start a server, run `--help` first, then use the helper:

**Single server:**
```bash
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py
```

**Multiple servers (e.g., backend + frontend):**
```bash
python scripts/with_server.py \
  --server "cd backend && python server.py" --port 3000 \
  --server "cd frontend && npm run dev" --port 5173 \
  -- python your_automation.py
```

To create an automation script, include only Playwright logic (servers are managed automatically):
```python
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
    page = browser.new_page()
    page.goto('http://localhost:5173') # Server already running and ready
    page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
    # ... your automation logic
    browser.close()
```

## Reconnaissance-Then-Action Pattern

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 results

3. **Execute actions** using discovered selectors

## Common Pitfall

❌ **Don't** inspect the DOM before waiting for `networkidle` on dynamic apps
✅ **Do** wait for `page.wait_for_load_state('networkidle')` before inspection

## Best Practices

- **Use bundled scripts as black boxes** - To accomplish a task, consider whether one of the scripts available in `scripts/` can help. These scripts handle common, complex workflows reliably without cluttering the context window. Use `--help` to see usage, then invoke directly. 
- Use `sync_playwright()` for synchronous scripts
- Always close the browser when done
- Use descriptive selectors: `text=`, `role=`, CSS selectors, or IDs
- Add appropriate waits: `page.wait_for_selector()` or `page.wait_for_timeout()`

## Reference Files

- **examples/** - Examples showing common patterns:
  - `element_discovery.py` - Discovering buttons, links, and inputs on a page
  - `static_html_automation.py` - Using file:// URLs for local HTML
  - `console_logging.py` - Capturing console logs during automation

「开发编程」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。