一个面向 OpenClaw 的综合性浏览器自动化测试技能,可执行功能、UI、无障碍访问、性能和视觉回归测试。
此技能使 OpenClaw 能够启动浏览器并对 Web 应用程序执行全面的测试。它支持多种测试类型并提供详细报告。
功能测试
UI 测试
无障碍访问测试
性能测试
视觉回归测试
安全测试
端到端测试
[VibeTesting]
目标 URL: https://example.com
测试类型: functional
[VibeTesting]
目标 URL: https://myapp.com
测试类型: comprehensive
包含: functional, accessibility, performance
报告格式: html
[VibeTesting]
目标 URL: https://example.com
测试类型: accessibility
WCAG 等级: AA
| 参数 | 必需 | 描述 | 默认值 |
|---|---|---|---|
target_url |
是 | 待测试的 URL | - |
testing_type |
否 | 测试类型 | comprehensive |
include |
否 | 要运行的测试类别 | 全部 |
exclude |
否 | 要跳过的测试类别 | 无 |
report_format |
否 | 输出格式 | html |
viewport |
否 | 浏览器视口大小 | 1920x1080 |
headless |
否 | 无头模式运行(无浏览器UI) | true |
timeout |
否 | 测试超时时间(秒) | 60 |
wait_for_network |
否 | 等待网络空闲 | true |
cookies |
否 | 要设置的 Cookie | {} |
auth |
否 | 基本身份验证凭据 | null |
wcag_level |
否 | WCAG 合规等级 | AA |
performance_threshold |
否 | 最大加载时间(毫秒) | 3000 |
screenshot_baseline |
否 | 用于对比的基准截图 | null |
visual_threshold |
否 | 视觉差异阈值 (0-1) | 0.01 |
快速冒烟测试 (5-10 秒)
* 基本页面加载
* 主要元素存在性
* 无 JavaScript 错误
完整功能测试 (30-60 秒)
* 表单测试
* 按钮交互
* 导航流程
* API 验证
完整测试套件 (2-5 分钟)
* 所有功能测试
* 无障碍访问审计
* 性能指标
* 视觉回归
* 安全检查
专项无障碍访问测试 (1-2 分钟)
* WCAG 合规性
* ARIA 标签
* 键盘导航
* 屏幕阅读器文本
性能专项测试 (30-60 秒)
* 页面加载时间
* 核心 Web 指标
* 资源计时
* Lighthouse 评分
视觉回归测试 (1-2 分钟)
* 全页面截图
* 布局对比
* 视觉差异生成
安全专项测试 (30-60 秒)
* HTTPS 检查
* CSP 验证
* 基础漏洞扫描
端到端用户旅程测试 (时间可变)
* 多步骤流程
* 身份验证
* 结账流程
* 用户场景
[VibeTesting]
target_url: https://example.com
testing_type: quick
[VibeTesting]
target_url: https://myapp.com
testing_type: accessibility
wcag_level: AA
report_format: detailed
[VibeTesting]
target_url: https://myapp.com
testing_type: performance
viewport: 390x844
performance_threshold: 2000
headless: true
[VibeTesting]
target_url: https://myapp.com
testing_type: visual
screenshot_baseline: baseline.png
visual_threshold: 0.05
[VibeTesting]
target_url: https://myshop.com
testing_type: e2e
steps:
- add_item_to_cart
- proceed_to_checkout
- fill_shipping
- fill_payment
- complete_order
auth:
user: test@example.com
pass: testpass123
[VibeTesting]
target_url: https://myapp.com
testing_type: functional
elements:
validate:
- selector: "#login-form"
fields: ["email", "password"]
- selector: "#submit-btn"
action: click
expect:
- selector: ".success-message"
visible: true
实时测试进度和结果
详细的交互式报告,包含:
* 测试摘要
* 通过/失败明细
* 性能指标
* 无障碍访问评分
* 视觉差异(如适用)
* 截图
* 改进建议
机器可读的结果,便于 CI/CD 集成
- name: 浏览器测试
uses: openclaw/vibetesting
with:
target_url: https://staging.example.com
testing_type: comprehensive
report_format: json
- name: VibeTesting
run: |
npx vibetesting \
--url ${{ env.URL }} \
--type comprehensive \
--output results/
测试环境
性能
安全
视觉测试
无障碍访问
viewports:
desktop: 1920x1080
tablet: 768x1024
mobile: 390x844
wait:
network: idle # 等待网络空闲
dom: stable # 等待 DOM 稳定
selector: "#loaded" # 等待特定元素
timeout: 30
retry:
attempts: 3
delay: 1000 # 毫秒
selectors:
- ".loading-spinner"
- "#async-content"
执行摘要
功能测试结果
无障碍访问报告
性能指标
视觉对比
安全发现
测试愉快! 🧪🔍✨