npx skills add https://github.com/bugsterapp/agent-test --skill 'Browser Testing'使用 Bugster CLI 自动化 Web 应用程序的端到端测试。此技能通过命令行工具实现 AI 驱动的测试生成和执行,以完成全面的测试工作流。
此技能使用 Bugster CLI 为 Web 应用程序生成和运行 AI 驱动的测试。CLI 会分析您的代码库,创建测试规范,并在真实的浏览器环境中执行测试。
重要提示:在使用任何 Bugster 命令之前,您必须执行以下检查:
setup.json(位于 .claude/skills/browser-testing/setup.json)setupComplete 字段:
true:所有先决条件已满足,请继续执行项目初始化检查false:需要进行设置 - 请按照以下步骤操作setupComplete: false)当 setupComplete 为 false 时,请检查 setup.json 中的 prerequisites 并完成以下操作:
bugsterCli.installed: false)# 安装 Bugster CLI
curl -sSL https://bugster.dev/install.sh | bash
# 验证安装
bugster --version
# 如果成功,更新 setup.json:将 prerequisites.bugsterCli.installed 设置为 true
apiKey.configured: false)关键:检查 ~/.bugsterrc 是否存在并包含有效的 API 密钥:
# 检查 ~/.bugsterrc 是否存在
cat ~/.bugsterrc
如果 ~/.bugsterrc 不存在或缺少 apiKey 字段:
要求用户提供他们的 Bugster API 密钥:
使用提供的 API 密钥创建 ~/.bugsterrc 文件:
{
"apiKey": "user_provided_key_here"
}
验证文件是否成功创建
更新 setup.json:将 prerequisites.apiKey.configured 设置为 true
一旦 setup.json 中的 bugsterCli.installed 和 apiKey.configured 都为 true,请将 setupComplete 设置为 true。
关键:设置完成后,检查项目是否已初始化:
.bugster 目录.bugster 目录不存在:
bugster init(参见以下步骤)bugster generate 和 bugster run 将会失败.bugster 目录存在:继续执行 generate/run 命令每次处理新项目时,在验证设置完成且 API 密钥已配置后,请检查是否存在 .bugster 目录。
如果 .bugster 目录不存在,您必须从用户处收集以下信息:
应用程序 URL:
登录凭据(如果适用):
运行非交互式 bugster init:
# 带登录凭据:
bugster init --api-key="$(cat ~/.bugsterrc | grep apiKey | cut -d'"' -f4)" --url="<user_provided_url>" --user="<user_provided_username>" --password="<user_provided_password>"
# 不带登录凭据(无登录页面):
bugster init --api-key="$(cat ~/.bugsterrc | grep apiKey | cut -d'"' -f4)" --url="<user_provided_url> --no-credentials"
替代方案(如果您已将 API 密钥存储在变量中):
# 带登录凭据:
bugster init --api-key="<api_key>" --url="<url>" --user="<user>" --password="<password>"
# 不带登录凭据:
bugster init --api-key="<api_key>" --url="<url>" --no-credentials
这种非交互式方法确保快速执行,无需手动提示。
在运行 bugster generate 或 bugster run 之前,必须存在 .bugster 目录。
在运行任何 Bugster 命令之前,请确保满足所有先决条件:
prerequisites.bugsterCli.installed: true)~/.bugsterrc 中配置(setup.json 中 prerequisites.apiKey.configured: true)setupComplete: true).bugster 目录(由非交互式 bugster init 创建)关键工作流程:
setup.json:
setupComplete: false,请完成 setup.json 中的所有先决条件bugsterCli.installed: false,请安装 Bugster CLIapiKey.configured: false,请检查 ~/.bugsterrc,并在需要时向用户询问 API 密钥setupComplete 设置为 true.bugster 目录:
bugster init --api-key=<key> --url=<url> 并附带 ;如果未提供凭据,则附带 请勿尝试在未完成所有先决条件检查的情况下运行 bugster generate 或 bugster run。
bugster generate [options]
使用时机:分析代码库并自动生成测试规范、创建测试套件、生成测试场景。
选项:
--count <number>:每个页面要生成的测试规范数量(范围:1-30)--page <paths>:仅针对特定页面文件生成规范(逗号分隔的路径)--prompt <text>:用于指导 AI 测试生成的自定义提示(必须与 --page 一起使用)示例用法:
bugster generatebugster generate --count 10bugster generate --page "pages/product.tsx" --prompt "Focus on edge cases and error handling"bugster generate --page "pages/login.tsx,pages/signup.tsx" --count 5输出:测试规范以 JSON 格式保存在 .bugster/tests/ 目录中
bugster run [path] [options]
使用时机:执行测试规范、验证功能、运行测试套件、执行自动化测试。
关键:在运行 bugster run 之前,务必询问用户他们想要哪种类型的测试执行:
运行所有测试文件(默认):
bugster run [options]运行特定测试文件:
bugster run --path <user_provided_path> [options]运行自定义提示测试(无需生成规范的即时测试):
bugster run "<user_provided_prompt>" [options]选项:
--headless:在无头模式下运行测试,不显示浏览器 UI(适用于 CI/CD)--parallel <number>:最大并发测试数(默认值:3)--limit <number>:要执行的最大测试数--browser <name>:要使用的浏览器引擎(chromium、firefox 或 webkit)示例用法:
bugster run(所有测试文件)bugster run --headless --parallel 8(所有测试文件,无头模式)bugster run --path .bugster/tests/login-test.json(特定文件)bugster run --path .bugster/tests/checkout-test.json --browser firefox(特定文件,指定浏览器)bugster run "Test user login with valid credentials and verify dashboard loads"(自定义提示)bugster run "Test checkout flow with valid payment details" --headless(自定义提示,无头模式)重要提示:自定义提示测试允许无需先生成规范即可运行即时测试。这对于快速验证和临时测试非常有用。
输出:测试结果,包括通过/失败状态、屏幕截图、视频录制和详细日志
标准工作流程:典型的测试流程依次使用两个命令:
bugster generate 生成测试规范bugster run 执行测试快速测试:为了快速验证,使用 bugster run <custom_prompt> 直接执行测试,无需生成规范。
迭代测试:代码更改后,使用 bugster generate 重新生成测试,并使用 bugster run 进行验证。
setup.json 以确保 setupComplete: true~/.bugsterrc 是否存在并包含有效的 API 密钥(prerequisites.apiKey.configured: true)bugster init,以实现快速、非交互式的设置.bugster 目录是否存在。如果缺失,请收集所需信息并运行非交互式 bugster initbugster run 之前,务必询问用户他们想要哪种类型的测试执行(所有文件、特定文件或自定义提示)bugster generate
bugster run
bugster generate --page "pages/checkout.tsx,pages/payment.tsx" --count 5 --prompt "Focus on payment processing and security"
bugster run --headless --parallel 5
bugster run "Verify the contact form submits successfully and displays a confirmation message"
bugster run --path .bugster/tests/checkout-test.json --limit 1
bugster generate --count 20
bugster run --headless --parallel 10
当测试需要特定数据(例如数据库 ID、账户引用或动态值)且必须在执行前获取或计算时,请使用钩子来定义在测试前运行的辅助函数。
钩子允许您:
before 钩子)name: <test_name>
page: <page_route>
page_path: <path_to_page_file>
hooks:
before:
- helper: <helper_function_name>
file_path: <path_to_helper_file>
args: [<arg1>, <arg2>, ...]
as: <variable_name>
task: <test_description>
steps:
- <step_1>
- <step_2>
expected_result: <expected_outcome>
| 字段 | 描述 | 必需 |
|---|---|---|
helper | 要执行的辅助函数名称 | 是 |
file_path | 包含辅助函数的文件路径 | 是 |
args | 传递给辅助函数的参数数组 | 否 |
as | 用于存储辅助函数返回值的变量名 | 是 |
name: User creates optional concept without attributes
page: /conceptos
page_path: apps/e2e/pages/dashboard/conceptsPage.ts
hooks:
before:
- helper: getSchoolIdByName
file_path: apps/e2e/helpers/commons.ts
args: ["Instituto Internacional Carlos"]
as: schoolId
- helper: getBankAccountBySchoolName
file_path: apps/e2e/helpers/commons.ts
args: ["Instituto Internacional Carlos"]
as: bankAccount
task: Verify user can create optional concept with IVA billing
steps:
- Login as automata@getcome.com with pass
- Navigate to concepts page
- Click on "Create Concept" button
- Fill in concept details using {{schoolId}} and {{bankAccount}}
- Submit the form
expected_result: Success message displays, concept visible in concepts table
您可以链接多个按顺序执行的 before 钩子:
hooks:
before:
- helper: createTestUser
file_path: apps/e2e/helpers/users.ts
args: ["test@example.com", "TestUser123"]
as: userId
- helper: assignRoleToUser
file_path: apps/e2e/helpers/roles.ts
args: ["{{userId}}", "admin"]
as: roleAssignment
- helper: getAuthToken
file_path: apps/e2e/helpers/auth.ts
args: ["{{userId}}"]
as: authToken
file_path 指向代码库中实际的辅助文件as 字段应清楚地指示存储了什么数据{{variable_name}} 引用前面钩子的变量当您的测试需要以下内容时,请使用钩子:
命令未找到:确保 Bugster CLI 已安装并已添加到 PATH。检查 setup.json - 如果 prerequisites.bugsterCli.installed: false,请运行 curl -sSL https://bugster.dev/install.sh | bash 进行安装
身份验证问题:验证您的 Bugster API 密钥是否已在 ~/.bugsterrc 中正确配置。检查 setup.json - 如果 prerequisites.apiKey.configured: false,您需要:
~/.bugsterrc 是否存在并包含有效的 apiKey 字段setup.json,将 prerequisites.apiKey.configured 设置为 true项目未初始化 / .bugster 目录缺失:检查项目根目录中是否存在 .bugster 目录。如果不存在:
bugster init --api-key=<key> --url=<url> --user=<user> --password=<password>bugster init --api-key=<key> --url=<url> --no-credentials测试失败:查看测试输出中的详细日志和屏幕截图。使用 bugster run --limit 1 调试单个测试
未找到测试:确保您已先运行 bugster generate,或者使用 bugster run <custom_prompt> 进行即时测试
浏览器问题:尝试使用 --browser 选项选择不同的浏览器,或者确保已安装所需的浏览器
有关详细示例,请参阅 EXAMPLES.md。有关 API 参考和技术细节,请参阅 REFERENCE.md。
要使用此技能,请确保已安装 Bugster CLI:
# 安装 Bugster CLI
curl -sSL https://bugster.dev/install.sh | bash
# 验证安装
bugster --version
要求:
每周安装次数
0
代码仓库
首次出现时间
1970年1月1日
安全审计
Automate end-to-end testing of web applications using Bugster CLI. This skill enables AI-powered test generation and execution through command-line tools for comprehensive testing workflows.
This skill uses the Bugster CLI to generate and run AI-powered tests for web applications. The CLI analyzes your codebase, creates test specifications, and executes tests in real browser environments.
IMPORTANT: Before using any Bugster commands, you MUST perform these checks:
setup.json (located in .claude/skills/browser-testing/setup.json)setupComplete field:
true: All prerequisites are met, proceed to Project Initialization Checkfalse: Setup required - follow the steps below广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
--user=<user> --password=<password>--no-credentialsbugster generate 或 bugster run 命令--parallel 加速测试运行,并使用 --limit 进行快速验证.bugster/ 目录以在团队中保持一致的测试配置(但不要提交包含敏感 API 密钥的 ~/.bugsterrc)generate 命令的 --page 选项来关注关键用户流程--headless 标志setupComplete: false)When setupComplete is false, check the prerequisites in setup.json and complete the following:
bugsterCli.installed: false)# Install Bugster CLI
curl -sSL https://bugster.dev/install.sh | bash
# Verify installation
bugster --version
# If successful, update setup.json: set prerequisites.bugsterCli.installed to true
apiKey.configured: false)CRITICAL: Check if~/.bugsterrc exists and contains a valid API key:
# Check if ~/.bugsterrc exists
cat ~/.bugsterrc
If~/.bugsterrc does NOT exist or is missing the apiKey field:
Ask the user to provide their Bugster API key :
Create~/.bugsterrc file with the provided API key:
{
"apiKey": "user_provided_key_here"
}
Verify the file was created successfully
Update setup.json : set prerequisites.apiKey.configured to true
Once both bugsterCli.installed and apiKey.configured are true in setup.json, set setupComplete to true.
CRITICAL: After setup is complete, check if the project has been initialized:
.bugster directory exists in the user's project root.bugster directory does NOT exist:
bugster init first (see steps below)bugster generate and bugster run will fail.bugster directory exists: Proceed with generate/run commandsEvery time you work with a new project , after verifying setup is complete and API key is configured, check if .bugster directory exists.
If.bugster directory does NOT exist, you must collect the following information from the user:
Application URL :
Login Credentials (if applicable):
Run non-interactivebugster init:
# With login credentials:
bugster init --api-key="$(cat ~/.bugsterrc | grep apiKey | cut -d'"' -f4)" --url="<user_provided_url>" --user="<user_provided_username>" --password="<user_provided_password>"
# Without login credentials (no login page):
bugster init --api-key="$(cat ~/.bugsterrc | grep apiKey | cut -d'"' -f4)" --url="<user_provided_url> --no-credentials"
Alternative (if you already have the API key in a variable):
# With login credentials:
bugster init --api-key="<api_key>" --url="<url>" --user="<user>" --password="<password>"
# Without login credentials:
bugster init --api-key="<api_key>" --url="<url>" --no-credentials
This non-interactive approach ensures fast execution without manual prompts.
The.bugster directory must exist before running bugster generate or bugster run.
Before running any Bugster commands, ensure all prerequisites are met:
prerequisites.bugsterCli.installed: true in setup.json)~/.bugsterrc (prerequisites.apiKey.configured: true in setup.json)setupComplete: true in setup.json).bugster directory exists in project root (created by non-interactive bugster init)CRITICAL WORKFLOW:
setup.json:
setupComplete: false, complete all prerequisites in setup.jsonbugsterCli.installed: false, install Bugster CLIapiKey.configured: false, check for ~/.bugsterrc and ask user for API key if neededsetupComplete: true.bugster directory in project root:
bugster init --api-key=<key> --url=<url> with --user=<user> --password=<password> if credentials were provided or with --no-credentials if they were notbugster generate or bugster run commandsDO NOT attempt to runbugster generate or bugster run without completing all prerequisite checks.
bugster generate [options]
When to use : Analyzing codebase and automatically generating test specifications, creating test suites, generating test scenarios.
Options :
--count <number>: Number of test specs to generate per page (range: 1-30)--page <paths>: Generate specs only for specific page files (comma-separated paths)--prompt <text>: Custom prompt to guide AI test generation (must be used with --page)Example usage :
bugster generatebugster generate --count 10bugster generate --page "pages/product.tsx" --prompt "Focus on edge cases and error handling"bugster generate --page "pages/login.tsx,pages/signup.tsx" --count 5Output : Test specifications saved in .bugster/tests/ directory with JSON format
bugster run [path] [options]
When to use : Executing test specifications, validating functionality, running test suites, performing automated testing.
CRITICAL: Before runningbugster run, ALWAYS ask the user which type of test execution they want:
Run all test files (default):
bugster run [options]Run specific test file(s) :
bugster run --path <user_provided_path> [options]Run custom prompt test (instant test without generating specs):
bugster run "<user_provided_prompt>" [options]Options :
--headless: Run tests in headless mode without visible browser UI (ideal for CI/CD)--parallel <number>: Maximum number of concurrent tests (default: 3)--limit <number>: Maximum number of tests to execute--browser <name>: Browser engine to use (chromium, firefox, or webkit)Example usage :
bugster run (all test files)bugster run --headless --parallel 8 (all test files, headless mode)bugster run --path .bugster/tests/login-test.json (specific file)bugster run --path .bugster/tests/checkout-test.json --browser firefox (specific file with browser)bugster run "Test user login with valid credentials and verify dashboard loads" (custom prompt)bugster run "Test checkout flow with valid payment details" --headless (custom prompt, headless)Important : Custom prompt tests allow running instant tests without generating specifications first. This is useful for quick validation and ad-hoc testing.
Output : Test results including pass/fail status, screenshots, video recordings, and detailed logs
Standard workflow : The typical testing flow uses both commands sequentially:
bugster generatebugster runQuick testing : For rapid validation, use bugster run <custom_prompt> to execute tests directly without generating specifications.
Iterative testing : After code changes, regenerate tests with bugster generate and validate with bugster run.
setup.json to ensure setupComplete: true before running any Bugster commands~/.bugsterrc exists with a valid API key (prerequisites.apiKey.configured: true)bugster init with all flags for fast, non-interactive setup.bugster directory exists before running any commands. If missing, collect required info and run non-interactive bugster initbugster run--parallel to speed up test runs, and --limit for quick validation.bugster/ directory to maintain consistent test configurations across your team (but NOT ~/.bugsterrc which contains sensitive API keys)--page with generate to focus on critical user flows--headless flag in continuous integration environmentsbugster generate
bugster run
bugster generate --page "pages/checkout.tsx,pages/payment.tsx" --count 5 --prompt "Focus on payment processing and security"
bugster run --headless --parallel 5
bugster run "Verify the contact form submits successfully and displays a confirmation message"
bugster run --path .bugster/tests/checkout-test.json --limit 1
bugster generate --count 20
bugster run --headless --parallel 10
When tests require specific data that must be fetched or computed before execution (such as database IDs, account references, or dynamic values), use hooks to define helper functions that run before the test.
Hooks allow you to:
before hooks)name: <test_name>
page: <page_route>
page_path: <path_to_page_file>
hooks:
before:
- helper: <helper_function_name>
file_path: <path_to_helper_file>
args: [<arg1>, <arg2>, ...]
as: <variable_name>
task: <test_description>
steps:
- <step_1>
- <step_2>
expected_result: <expected_outcome>
| Field | Description | Required |
|---|---|---|
helper | Name of the helper function to execute | Yes |
file_path | Path to the file containing the helper function | Yes |
args | Array of arguments to pass to the helper function | No |
as | Variable name to store the helper's return value | Yes |
name: User creates optional concept without attributes
page: /conceptos
page_path: apps/e2e/pages/dashboard/conceptsPage.ts
hooks:
before:
- helper: getSchoolIdByName
file_path: apps/e2e/helpers/commons.ts
args: ["Instituto Internacional Carlos"]
as: schoolId
- helper: getBankAccountBySchoolName
file_path: apps/e2e/helpers/commons.ts
args: ["Instituto Internacional Carlos"]
as: bankAccount
task: Verify user can create optional concept with IVA billing
steps:
- Login as automata@getcome.com with pass
- Navigate to concepts page
- Click on "Create Concept" button
- Fill in concept details using {{schoolId}} and {{bankAccount}}
- Submit the form
expected_result: Success message displays, concept visible in concepts table
You can chain multiple before hooks that execute sequentially:
hooks:
before:
- helper: createTestUser
file_path: apps/e2e/helpers/users.ts
args: ["test@example.com", "TestUser123"]
as: userId
- helper: assignRoleToUser
file_path: apps/e2e/helpers/roles.ts
args: ["{{userId}}", "admin"]
as: roleAssignment
- helper: getAuthToken
file_path: apps/e2e/helpers/auth.ts
args: ["{{userId}}"]
as: authToken
file_path to actual helper files in your codebaseas field should clearly indicate what data is stored{{variable_name}}Use hooks when your test requires:
Command not found : Ensure Bugster CLI is installed and added to PATH. Check setup.json - if prerequisites.bugsterCli.installed: false, run curl -sSL https://bugster.dev/install.sh | bash to install
Authentication issues : Verify your Bugster API key is configured correctly in ~/.bugsterrc. Check setup.json - if prerequisites.apiKey.configured: false, you need to:
~/.bugsterrc exists and contains a valid apiKey fieldsetup.json to set prerequisites.apiKey.configured: trueProject not initialized /.bugster directory missing: Check if .bugster directory exists in project root. If not:
bugster init --api-key=<key> --url=<url> --user=<user> --password=<password>bugster init --api-key=<key> --url=<url> --no-credentialsTest failures : Review detailed logs and screenshots in test output. Use bugster run --limit 1 to debug individual tests
No tests found : Ensure you've run bugster generate first, or use bugster run <custom_prompt> for instant testing
Browser issues : Try different browsers with --browser option or ensure required browsers are installed
For detailed examples, see EXAMPLES.md. For API reference and technical details, see REFERENCE.md.
To use this skill, ensure Bugster CLI is installed:
# Install Bugster CLI
curl -sSL https://bugster.dev/install.sh | bash
# Verify installation
bugster --version
Requirements :
Weekly Installs
0
Repository
First Seen
Jan 1, 1970
Security Audits
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装
房地产专家系统:MLS集成、虚拟看房、AI估值与物业管理技术解决方案
206 周安装
TypeScript/JavaScript 开发技能 - 掌握 Metabase 开源项目开发流程与工具
206 周安装
Upstash Redis SDK 完整指南 - Redis-JS 安装、使用与性能优化教程
206 周安装
Tavily API 网络搜索技能 - 实现网页爬取、内容提取和智能研究功能
206 周安装
企业合规助手:GDPR、CCPA等隐私法规合规指南与数据处理协议审查清单
206 周安装
DeepSpeed 开发助手:官方文档指南、API 使用与性能优化教程
207 周安装