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
累計下載
1833
星標
3
全站排名
#4,553
全站前 90% · 「開發程式設計」前 94%
平台累計安裝累計下載星標評論
ClawHub ↗431595--
SkillHub ↗12918333—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該工具包用於測試本地靜態或動態 Web 應用,可檢查頁面、除錯 UI、擷取瀏覽器畫面並檢視瀏覽器日誌。它要求先用幫助引數瞭解輔助指令碼用法。測試伺服器命令可能執行專案上下文中的本地命令,截圖和日誌也可能包含敏感頁面內容;僅對可信專案操作,並將這些產物作為敏感資料保護。

資料釋出於 2026-10-29

可以用來做什麼

  • 驗證本地 Web 應用的頁面和互動
  • 除錯前端行為並檢查瀏覽器日誌
  • 為測試結果採集頁面截圖

什麼時候用

  • 需要透過 Playwright 測試本地 Web 應用時
  • 可以先檢查輔助指令碼的引數和伺服器命令時
  • 能夠保護截圖和日誌中的頁面資訊時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

請用 Playwright 檢查這個本地 Web 頁面的主要互動,先檢視輔助指令碼用法;不要連線外部站點,並避免把含敏感資訊的截圖或日誌輸出到共享位置。

月度資料趨勢

累計下載1833
250110019502026-03 · 累計下載 3672026-05 · 累計下載 9582026-07 · 累計下載 13512026-08 · 累計下載 15522026-09 · 累計下載 183326-0326-09
星標3
0232026-03 · 星標 -2026-05 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-091833—3
2026-081552+14.9%3
2026-071351—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),按月更新。口徑說明見資料方法。