agent-browser
它能做什么
这项技能使用 agent-browser 命令行工具打开网页、执行操作并检查显示的内容。适合需要确认网站能按用户实际体验运行的人。
适用场景
- ✓当你想在真实浏览器中检查网页或管理后台页面的行为是否正确的时候。
- ✓当你需要截图,作为某个操作之后页面外观的证据的时候。
- ✓当你想确认点击或提交表单之后,页面显示了预期结果的时候。
技能链接
https://github.com/emdash-cms/emdash/blob/main/skills/agent-browser/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在浏览器中打开我网站的登录页面,登录,并为仪表板截一张图?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在一个命名的浏览器会话中打开页面,读取页面结构,执行操作,然后检查新的状态以及任何控制台错误。过程中它可以截取屏幕截图。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Test interfaces with agent-browser
Use the installed agent-browser CLI for rendered, user-facing verification. Load its version-matched instructions before relying on command syntax:
agent-browser skills get core --full
Use a specialized bundled guide when the target requires one. agent-browser skills list shows the available guides.
Verification loop
- Start or identify the target application and record the exact URL and viewport.
- Open the page in a named session.
- Take an accessibility snapshot and identify controls by role, label, or snapshot reference.
- Perform the user action.
- Wait for the resulting state, then take a fresh snapshot. References can become stale after navigation or a substantial DOM update.
- Verify the observable result, console errors, and relevant network behavior.
- Capture screenshots when visual evidence helps establish the result.
For EmDash admin testing, authenticate through the development bypass rather than attempting to automate passkeys:
agent-browser open 'http://localhost:4321/_emdash/api/setup/dev-bypass?redirect=/_emdash/admin'
Use auth/dev-bypass instead when setup is already complete.
Interaction guidance
- Prefer role and label locators when they express the user-facing control clearly. Use snapshot references for efficient exploration.
- Re-snapshot after a dialog opens, a route changes, or content is replaced.
- Wait for a selector or visible state instead of adding a fixed delay unless timing itself is under test.
- Use a named session for flows that depend on cookies or storage. Close sessions that are no longer needed.
- Check
agent-browser consoleandagent-browser errorswhen the UI behaves unexpectedly. - Use
agent-browser network requestswhen the result depends on a request or response boundary.
Evidence
Record the path tested, inputs, viewport, expected result, actual result, and any console or request failures. For UI changes, capture before-and-after screenshots of every affected screen.
Save screenshots inside the task workspace with descriptive filenames. Inspect the saved image before reporting success; a completed screenshot command does not prove that the intended state was visible.
Browser exploration does not replace a regression test when stable automated coverage can protect the behavior. Convert a confirmed defect into the narrowest meaningful automated test when the task includes implementation.
常见问题
它能替代自动化测试吗?
不能。当需要可重复的回归测试时,确定性的测试套件是更好的选择。
它如何找到页面上的按钮?
它读取页面的无障碍信息,利用标签和角色来找到控件。
它能显示错误吗?
能。作为验证的一部分,它会检查控制台错误和相关的网络行为。
详情
作者的原始描述
Use the agent-browser CLI to exercise web interfaces, inspect rendered accessibility state, verify interactions, and capture screenshots. Use for browser-based UI testing and evidence collection. Do not use as a substitute for deterministic Playwright coverage when an automated regression test is the requested deliverable.
repo: emdash-cms/emdash
热度
- GitHub 星标
- 14k
- 排名
- #11245
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
adversarial-reviewer
14k帮你的智能体在代码变更中寻找隐藏的缺陷和不安全的假设;当你要求时,它会超越普通的审查。
building-emdash-site
14k帮你的智能体在 Astro 上构建 EmDash CMS 项目的网站部分,涵盖内容、结构、菜单、分类法和部署。
creating-plugins
14k帮你的智能体为 EmDash CMS 构建插件,包括安全的钩子、路由、存储和管理界面。
emdash-cli
14k让你的智能体通过命令行管理 EmDash 网站,包括内容、媒体、菜单、迁移,以及整站导出或导入。