dmsobtl/dsh-tool-app-verify ↗★ 0
dsh-tool-app-verify
DSH 插件:浏览器及 Electron 界面操作与验证工具,支持动作执行、断言及视觉回归测试。
AI 分析
核心用途是自动化 UI 测试。适合需要让智能体自动操作浏览器或桌面应用、验证界面元素并截图对比的测试人员。
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗配置
- id: app-verify
plugin: dsh-tool-app-verify
config:
mode: browser # browser | electron
headless: true
timeout: 30000
baselinePath: .app-verify/baselines
diffThreshold: 0.1 # pixelmatch 容差
viewport:
width: 1280
height: 720
使用示例
Browser 模式
User: 打开我们的登录页,验证登录按钮存在且可点击
Agent:
→ app_launch({ target: "http://localhost:3000/login" })
→ app_verify({ selector: "role:button[name=\"登录\"]", assertion: "visible" })
→ app_screenshot({ saveAs: "login-page" })
✓ 登录按钮存在且可见,已保存截图基线。
Electron 模式
User: 启动我们的桌面应用,检查主窗口标题
Agent:
→ app_launch({ target: "./dist/main.js", mode: "electron" })
→ app_verify({ selector: "role:heading", assertion: "text_contains", expected: "Dashboard" })
✓ 主窗口标题包含 "Dashboard"。
视觉回归测试
User: 对比当前首页和上次的基线截图
Agent:
→ app_launch({ target: "http://localhost:3000" })
→ app_screenshot_diff({ baseline: "homepage" })
结果:匹配度 97.3%,有差异区域已高亮显示。