QATest - 一键准备执行环境:检查/启动 OneKey CDP(9222) + 启动 Dashboard 执行面板(5050),并引导在面板勾选用例开始执行。 Triggers on: /qatest, "/qatest 开始执行", "qatest/开始执行", "打开执行面板", "开始执行用例".
你是 QATest — 用于“打开执行面板 + 连接本地 CDP 的 OneKey app + 开始执行用例”的快捷入口。
说明:本流程会启动 Dashboard 服务,但不会使用
open命令自动打开浏览器页面(规则禁止)。你可以手动在浏览器访问http://localhost:5050。
不论 .env 是否已配置,每次会话首次都必须询问:
请选择要测试的平台:
1. 桌面端 TF 包(TestFlight)— /Applications/OneKey-3.localized/OneKey.app
2. 桌面端 MAS 包(Mac App Store)— 请提供路径
3. 浏览器插件端 — 请提供插件 ID(Extension ID)+ Chrome 用户目录(User Data Dir)
4. Web 端 — 请提供要使用的 Chrome 用户目录(User Data Dir)
.env 的 ONEKEY_BIN=,按下方 Phase 1 启动Chrome Profile 自动扫描逻辑:
~/Library/Application Support/Google/Chrome/ 下所有 Profilefor dir in ~/Library/Application\ Support/Google/Chrome/Profile* ~/Library/Application\ Support/Google/Chrome/Default; do
[ -d "$dir" ] && python3 -c "
import json, os
prefs = json.load(open(os.path.join('$dir', 'Preferences')))
print(f'$(basename \"$dir\") → {prefs.get(\"profile\",{}).get(\"name\",\"unnamed\")}')
" 2>/dev/null
done
Launch command: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --remote-debugging-port=9222 --user-data-dir="$HOME/Library/Application Support/Google/Chrome" --profile-directory="<Profile>"
# 桌面端:
curl -s http://127.0.0.1:9222/json/version
# 如果没响应,重启 OneKey(禁止 open,禁止第二实例)
pkill -f "OneKey" 2>/dev/null; sleep 2
$ONEKEY_BIN --remote-debugging-port=9222 &
sleep 5
curl -s http://127.0.0.1:9222/json/version
# 插件端/Web 端:
# google-chrome --remote-debugging-port=9222 [--user-data-dir=<path>] [--load-extension=<path>]
# 启动 Dashboard
cd /Users/chole/workspace/QA-AGENTS && npx tsx src/dashboard/server.ts
健康检查:
curl -s -I http://localhost:5050 | head -n 5
http://localhost:5050如果用户在指令中提供了用例 ID(例如 SEARCH-001, SEARCH-002),则:
执行结果(Runner 写入):
shared/results/<TEST-ID>.json示例查看:
ls -1 shared/results/*.json | tail -n 20
open 启动 OneKey 或自动打开 Dashboard 页面