webapp-testing 是什么?
Anthropic 的 webapp-testing 用 Python Playwright 操作和检查本地网页,包括按钮交互、页面截图与浏览器日志。它附带服务器生命周期脚本,适合把一个具体的界面问题变成可复现的浏览器操作。
中文说明由本站依据来源整理;英文原文保留在页面下方。
适合用在
- 本地开发中的网站,需要验证表单、按钮或跳转并保存截图。
这些情况不适合
- 只看 HTML 源码就判断动态页面的实际状态;页面脚本尚未运行时,DOM可能不完整。
同名项目,请核对仓库和目录
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
webapp-testing,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 webapp-testing
请在 Codex 的当前工作环境中安装并检查 webapp-testing 这个 Skill。
项目身份:anthropics/skills / webapp-testing
来源:https://github.com/anthropics/skills/blob/e4bb5d960d87126ff3b3a8af1a104b7db67560ba/skills/webapp-testing/SKILL.md
已定位的源文件:skills/webapp-testing/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 webapp-testing
请在 Claude Code 的当前工作环境中安装并检查 webapp-testing 这个 Skill。
项目身份:anthropics/skills / webapp-testing
来源:https://github.com/anthropics/skills/blob/e4bb5d960d87126ff3b3a8af1a104b7db67560ba/skills/webapp-testing/SKILL.md
已定位的源文件:skills/webapp-testing/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 webapp-testing
请在 Cursor Agent 的当前工作环境中安装并检查 webapp-testing 这个 Skill。
项目身份:anthropics/skills / webapp-testing
来源:https://github.com/anthropics/skills/blob/e4bb5d960d87126ff3b3a8af1a104b7db67560ba/skills/webapp-testing/SKILL.md
已定位的源文件:skills/webapp-testing/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 webapp-testing
请在 当前 Agent 的当前工作环境中安装并检查 webapp-testing 这个 Skill。
项目身份:anthropics/skills / webapp-testing
来源:https://github.com/anthropics/skills/blob/e4bb5d960d87126ff3b3a8af1a104b7db67560ba/skills/webapp-testing/SKILL.md
已定位的源文件:skills/webapp-testing/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 准备 Python Playwright 可运行环境、应用目录和启动命令,说明访问端口与要验证的具体操作。需要 helper 时保留
scripts/with_server.py。
会得到什么
- 对应任务的浏览器操作脚本、截图和观察结果;说明实际访问地址、操作步骤及未验证的分支。
实际使用顺序
- 先区分静态 HTML 与动态应用。静态页可先读 HTML 找选择器;动态页确认服务器是否已经运行。
- 没有服务器时先执行 Skill 目录中
scripts/with_server.py --help,再按真实启动命令与端口管理服务器;不要把安装目录当应用目录。 - 用 Python 的
sync_playwright()启动无头 Chromium,打开地址并等待页面加载;动态页按来源要求等待networkidle后再检查渲染 DOM。 - 先截图或检查元素,按实际发现的选择器执行用户要求的动作,记录页面变化与日志,完成后关闭浏览器。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
使用 webapp-testing 检查我已启动在 http://localhost:5173 的任务清单。先观察真实页面,找到新增任务输入框与按钮;输入“检查部署流程”并提交,确认列表是否出现这条任务,保存提交前后截图和控制台错误。不要猜选择器,也不要新增服务进程;若页面不符合描述,报告实际看到的内容。预期得到真实DOM对应的操作与截图,并明确任务是否出现;浏览器打不开、等待超时或没有对应控件都应报告实际现象。本站未运行本例。
使用条件与边界
- 服务启动脚本与 Playwright 安装是运行前提,接入 Skill 不代表这些工具或应用已经可用。
- 一次操作成功只覆盖给定页面与流程,不能外推为整站或所有浏览器都通过。
常见问题
页面已经启动,还需要 with_server.py 吗?
不需要为已有服务重复启动。直接连接真实地址,先观察渲染结果,再执行动作。
点击时找不到元素怎么办?
先确认页面已完成脚本执行,再检查实际DOM或截图。用真实的文本、role、CSS或ID定位,不沿用猜测或过期选择器。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-17T10:48:38.865Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
skills/webapp-testing/SKILL.md · 抓取时间 2026-11-17T10:48:38.865Z
以下保留源文件的 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.
查看源文件章节 / Source sections
- 原文:Web Application Testing
- 原文:Decision Tree: Choosing Your Approach
- 原文:Example: Using with_server.py
- 原文:Reconnaissance-Then-Action Pattern
- 原文:Common Pitfall
- 原文:Best Practices
- 原文:Reference Files
原文:Web Application Testing
To test local web applications, write native Python Playwright scripts. **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()`
文件 SHA256:51b7349e77ec63b7744a6f63647e7566a0b4d2e301121cc10e8c2113af6556a2
仓库许可证记录:未提供;skill-declaration-captured-not-interpreted,查看来源。
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。
历史收录数据
| Skill标识 | webapp-testing |
|---|---|
| 来源仓库 | anthropics/skills |
| 榜单快照 | 2026-07-28 |
| 榜单口径 | Skills.sh累计安装量 |
| 快照名次 | 198 |
| 快照累计安装量 | 122801 |
历史资料说明
- 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
- 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。
此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。
