{
  "schemaVersion": "1.0",
  "item": {
    "slug": "auto-qa",
    "name": "Auto Qa",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/zxvchaos/auto-qa",
    "canonicalUrl": "https://clawhub.ai/zxvchaos/auto-qa",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/auto-qa",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=auto-qa",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/state_snapshot_20260220.md",
      "scenarios/generic_visual_template.json",
      "scenarios/mvp_smoke.json",
      "scenarios/registry.json",
      "scenarios/wehub_visual_demo.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/auto-qa"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/auto-qa",
    "agentPageUrl": "https://openagent3.xyz/skills/auto-qa/agent",
    "manifestUrl": "https://openagent3.xyz/skills/auto-qa/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/auto-qa/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Auto QA (OpenClaw Browser)",
        "body": "用于一期 MVP：\n\n自动执行网页关键路径\n自动采集失败证据（截图、console、network、trace）\n自动输出 CTO 可读报告与修复任务包\n自动重试、断点续跑、健康检查与失败分类（环境/产品）"
      },
      {
        "title": "实际组件构成（一期 MVP）",
        "body": "场景定义组件\n\n位置：demo/scenarios/*.json\n作用：声明测试步骤、断言条件、期望结果。\n输入：业务路径（P0 场景）。\n输出：可执行步骤序列（供执行编排器读取）。\n\n执行编排器\n\n位置：src/skills/auto-qa/scripts/run_autoqa.py\n作用：读取场景并调用 openclaw browser 执行动作。\n输入：场景 JSON、浏览器 profile、run_id。\n输出：步骤结果、证据文件、汇总报告与修复提示包。\n\n浏览器执行器（OpenClaw 内置能力）\n\n位置：OpenClaw CLI openclaw browser ...\n作用：点击、输入、等待、快照、截图、日志与 trace。\n输入：编排器下发的步骤参数。\n输出：结构化 JSON 结果和调试数据。\n\n证据归档组件\n\n位置：demo/artifacts/run-<run_id>/\n作用：按 run 归档步骤明细、截图、console、network、trace。\n输入：执行过程中的实时证据。\n输出：可追溯的失败证据包。\n\n报告生成组件\n\n位置：demo/reports/run-<run_id>/report.json、demo/reports/run-<run_id>/report.html\n作用：给出通过率、阻断项、Go/No-Go 判定。\n输入：步骤结果 + 证据统计。\n输出：机器可读（JSON）与演示可读（HTML）报告。\n\n修复任务包生成组件\n\n位置：demo/reports/run-<run_id>/fix_plan.json、next_window_prompt.md、standby_prompt.txt\n作用：将\"测试失败证据\"转成\"可直接执行的修复任务\"。\n输入：失败步骤、console、network、trace 路径。\n输出：根因假设、检查方向、修改方向、验收标准、下一窗口提示词。\n\n稳定性增强组件\n\n位置：src/skills/auto-qa/scripts/run_autoqa.py\n作用：减少\"主画面外运行\"时的抖动风险，提升演示稳定度。\n能力：\n\n步骤自动重试（默认每步 1 次重试）\n断点续跑（从失败步骤继续）\n健康检查（off/on-failure/each-step）\n失败分类（environment/product/unknown）\n\n门禁断言组件\n\n位置：src/skills/auto-qa/scripts/run_autoqa.py\n作用：将采证数据升级为发布门禁判定，防止\"假 GO\"。\n默认规则：\n\nconsole error -> 违规（critical）\n同域 network 4xx -> 违规（critical）\n同域 network 5xx -> 违规（blocker）\n\n\n报告输出：\n\ngateViolations\ngateViolationCountsBySeverity\nriskLevel\nreleaseDecision（GO / CONDITIONAL_GO / NO_GO）\nreviewStatus（consistent / needs_inspection）\nreviewConclusion（复核一致 / 复核需进一步检验）\nreviewFindings（需进一步检验时的具体项）\n\nTrace 对齐组件\n\n位置：demo/reports/run-<run_id>/step_trace_map.json\n作用：把步骤时间窗与 trace 时间线自动对齐，便于\"步骤 -> 证据\"快速追溯。\n输出：每个步骤对应的 trace 事件计数、帧计数、console/API/network 样本。\n\n报告通知组件\n\n位置：src/skills/auto-qa/scripts/run_autoqa.py（运行参数触发）\n作用：自动截取 report.html 全页图并发送到聊天频道。\n规则：\n\n传入 --notify-channel 时触发。\n未传 --notify-target 时，自动从 openclaw status --json 最近会话推断目标（当前频道优先）。"
      },
      {
        "title": "一期范围（防跑偏）",
        "body": "仅网页 P0 场景（3-5 条关键路径）\n证据四件套：screenshot + console + network + trace\n交付最小集合：\n\nreport.json\nreport.html\nfix_plan.json\nnext_window_prompt.md\nstandby_prompt.txt"
      },
      {
        "title": "目录约定",
        "body": "demo/\n  scenarios/\n    mvp_smoke.json\n    _generated/          ← agent 智能生成的临时 scenario 存放目录\n  artifacts/\n    run-<run_id>/\n      steps.json\n      console.json\n      network.json\n      health_checks.json\n      trace.zip\n      screenshots/\n  reports/\n    run-<run_id>/\n      report.json\n      report.html\n      report_full.png\n      step_trace_map.json\n      fix_plan.json\n      next_window_prompt.md\n      standby_prompt.txt"
      },
      {
        "title": "场景 JSON（最小格式）",
        "body": "{\n  \"name\": \"MVP Smoke\",\n  \"autoScreenshot\": true,\n  \"continueOnFailure\": false,\n  \"steps\": [\n    { \"id\": \"step-001\", \"action\": \"open\", \"url\": \"https://example.com\", \"expected\": \"页面可访问\" },\n    { \"id\": \"step-002\", \"action\": \"wait\", \"text\": \"Example Domain\", \"expected\": \"标题出现\" },\n    {\n      \"id\": \"step-003\",\n      \"action\": \"assert_text_contains\",\n      \"value\": \"Example Domain\",\n      \"expected\": \"正文包含关键字\"\n    }\n  ]\n}"
      },
      {
        "title": "场景 JSON（门禁规则示例）",
        "body": "{\n  \"name\": \"WeHub Smoke\",\n  \"gates\": {\n    \"enabled\": true,\n    \"minPassRate\": 95,\n    \"console\": {\n      \"errorAsFailure\": true,\n      \"ignoreMessagePatterns\": [\"known harmless error\"]\n    },\n    \"network\": {\n      \"sameOrigin4xxAsFailure\": true,\n      \"sameOrigin5xxAsFailure\": true,\n      \"thirdParty5xxAsFailure\": false,\n      \"ignoreUrlPatterns\": [\"/favicon.ico\"],\n      \"ignoreStatusCodes\": [401]\n    }\n  },\n  \"steps\": []\n}"
      },
      {
        "title": "场景 JSON（动作展示配置示例）",
        "body": "{\n  \"name\": \"Visual Demo\",\n  \"visual\": {\n    \"enabled\": true,\n    \"focusTabBeforeStep\": true,\n    \"preActionWaitMs\": 220,\n    \"postActionWaitMs\": 420,\n    \"highlightBeforeClick\": true,\n    \"highlightBeforeType\": true,\n    \"highlightWaitMs\": 480\n  },\n  \"steps\": []\n}\n\n说明：\n\nfocusTabBeforeStep：每步前尽量聚焦受控 tab，减少后台节流导致的观感抖动。\npreActionWaitMs/postActionWaitMs：动作前后节奏等待，提升\"可见点击/跳转\"观感。\nhighlightBeforeClick/highlightBeforeType：动作前高亮目标元素。"
      },
      {
        "title": "支持动作（MVP）",
        "body": "open\nnavigate\nsnapshot\nclick\nhover\ntype\npress\nback\nscroll\nclick_link_same_origin\nwait\nevaluate\nassert_url_contains\nassert_text_contains\nscreenshot\nnoop"
      },
      {
        "title": "场景 JSON 校验层（安全网）",
        "body": "run_autoqa.py 在加载 scenario 时自动执行 pre-flight 校验：\n\nJSON 语法：解析失败会报告精确行号/列号\n必须字段：每个 step 必须含 action 字段\n动作白名单：action 值必须在上述\"支持动作\"列表内，否则报错并列出全部合法值\n参数完整性：open/navigate 须含 url；click/hover/type 须含 ref；assert_* 须含 value\n\n校验在执行前触发，出错时给出明确的 step 索引和原因——不会默默失败。\n\n生成 scenario 时请确保遵守上述约束。id 字段建议保留（格式 step-NNN），缺省时引擎会自动补全。"
      },
      {
        "title": "场景 JSON（探索配置与返回边覆盖）",
        "body": "{\n  \"exploration\": {\n    \"enabled\": true,\n    \"maxDepth\": 3,\n    \"maxChildrenPerNode\": 5,\n    \"maxPages\": 30,\n    \"maxDurationMinutes\": 15,\n    \"sameOriginOnly\": true\n  },\n  \"steps\": [\n    { \"id\": \"step-010\", \"action\": \"click_link_same_origin\", \"depth\": 2 },\n    { \"id\": \"step-011\", \"action\": \"back\", \"returnEdge\": true, \"depth\": 2 }\n  ]\n}\n\n说明：\n\ndepth：步骤所属探索层级（用于覆盖统计）。\nreturnEdge=true：该步骤计入\"返回边\"覆盖统计（back 动作默认计入）。"
      },
      {
        "title": "运行方式",
        "body": "在仓库根目录执行：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id wehub_demo \\\n  --browser-profile openclaw \\\n  --auto-start-browser"
      },
      {
        "title": "执行协议（强约束）",
        "body": "当用户表达\"跑 QA / 再测一次 / 做自动回归 / 开始测试\"等执行意图时，默认进入直接执行，不先回复\"计划确认\"。"
      },
      {
        "title": "场景生成优先级（核心规则 — 严格按此顺序执行）",
        "body": "正常流程不使用预设脚本。场景（scenario）应由 agent 智能生成。\n\n优先级 1：用户给了测试要求（自然语言）\n\n用户可能说：\"测一下登录功能\"、\"检查购物车流程\"、\"用以下用例做自动 QA 测试：……\"。\n\nagent 必须：\n\n用 openclaw browser open <url> 打开目标\n用 openclaw browser snapshot --interactive --labels 扫描页面结构\n理解用户的自然语言要求，对照页面上实际存在的元素（表单、按钮、链接、输入框等）\n生成包含用户所有要求的 scenario JSON（每条要求对应具体的 action + expected + assertion）\n将 scenario JSON 写入 demo/scenarios/_generated/<run-id>.json\n用 --scenario <path> --force-direct-scenario-path 执行\n\n严禁忽略用户的任何测试要求。 如果页面上找不到用户要求的元素，在 scenario 中仍要包含该步骤并标注 expected，让执行引擎报告失败——而不是静默跳过。\n\n优先级 2：用户只给了 URL，没有具体要求\n\nagent 必须：\n\n用 openclaw browser open <url> 打开目标\n用 openclaw browser snapshot --interactive --labels 扫描页面结构\n分析页面上的所有可交互元素：链接、按钮、表单、输入框、导航菜单等\n智能生成覆盖以下维度的 scenario JSON：\n\n页面可访问性（navigate + assert_url）\n核心可交互元素（click 按钮、填写表单、点击链接）\n导航完整性（跳转 + 返回）\n内容断言（assert_text_contains 关键文案）\n\n\n将 scenario JSON 写入 demo/scenarios/_generated/<run-id>.json 并执行\n执行完成后，BFS 探索引擎自动补充未覆盖的同域页面\n\n生成的 scenario 必须基于实际页面内容，不能凭空猜测。 每个 step 的 ref、url、text 必须来自 snapshot 的真实数据。\n\n优先级 3（极端后备）：snapshot 失败或浏览器不可用\n\n仅当以上两种方式都失败时（如浏览器无法启动、目标不可达），才回退到预设脚本：\n\n使用注册表默认 defaultScenarioId 或 generic_template\n必须向用户明确警告：\"无法扫描目标，已回退到通用模板，测试覆盖度有限\"\n\n预设脚本（scenario-id）仅用于以下场景：\n\n用户明确要求使用某个 scenario-id（调试/演示用途）\n浏览器/网络故障导致无法扫描目标\n开发者本地调试"
      },
      {
        "title": "频道与目标策略",
        "body": "不做固定频道硬编码；频道可变且应随会话上下文切换。\n未显式指定通知目标时，沿用脚本默认\"最近活跃会话自动推断\"能力。"
      },
      {
        "title": "汇报口径",
        "body": "一旦命中执行意图，先回\"已开始执行 + 本次 run 参数摘要\"，随后立即落地执行。\n执行完成后再返回报告路径与结论，不把\"执行前计划说明\"作为前置阻塞。\n\n常用参数：\n\n--scenario <path>：直传 scenario JSON 路径（需配合 --force-direct-scenario-path）\n--scenario-id <id>：从注册表选择场景（仅调试/演示；默认注册表：demo/scenarios/registry.json）\n--scenario-registry <path>：指定场景注册表路径\n--scenario-var key=value：覆盖场景变量（可重复；用于模板场景的 {{start_url}}/{{start_domain}} 等占位）\n--allow-direct-scenario-path：允许接收 --scenario <path> 直传请求（默认关闭；默认会回退注册表默认场景）\n--force-direct-scenario-path：强制执行直传路径（智能生成场景时必须开启）\n--run-id <id>：手动指定 run id\n--output-root demo：输出根目录\n--allow-external-scenario：允许执行仓库 demo/scenarios 目录外的场景（默认关闭，防误跑）\n--allow-legacy-scenario：允许执行 meta.legacy=true 的旧场景（默认关闭）\n--no-trace：关闭 trace 录制\n--browser-bin <bin>：指定 OpenClaw 可执行名（默认 openclaw）\n--browser-cmd \"<cmd>\"：指定完整命令前缀（例如 pnpm --dir src openclaw）\n--max-step-retries <n>：每步默认重试次数（默认 1）\n--retry-wait-ms <ms>：重试间隔（默认 800）\n--showcase-recheck：启用复核执行并与主执行结果对照（默认开启）\n--showcase-continue-on-failure：复核执行遇到差异后是否继续（默认开启）\n--showcase-max-step-retries <n>：复核执行默认重试次数（默认 0）\n--showcase-retry-wait-ms <ms>：复核执行重试间隔（默认 500）\n--showcase-time-budget-ms <ms>：复核执行时间预算（默认 90000，超时即提前收口并继续产出最终报告）\n--resume-from-step-id <stepId>：从指定步骤开始续跑\n--resume-from-run-id <runId>：从某次历史失败 run 的首个失败步骤续跑\n--resume-last-failed：从同一场景最近一次失败 run 自动续跑\n--health-check-interval <off|on-failure|each-step>：健康检查频率（默认 on-failure）\n--trace-start-mode <auto|immediate|after-first-step>：trace 启动时机（默认 auto）\n--notify-channel <channel>：自动发送报告截图到指定频道（支持 discord/.../auto/current，不依赖固定频道名）\n--notify-target <target>：频道目标（不传则自动推断最近会话目标）\n--notify-account <id>：可选 accountId\n--notify-message <text>：可选通知文案\n--notify-auto-current-channel：未显式指定频道/目标时，自动发到最近活跃会话（默认开启）\n--notify-max-session-age-ms <ms>：自动推断会话的最大\"最近活跃时间\"（默认 30 分钟）\n--cleanup-orphan-openclaw-processes：运行前自动清理多余 OpenClaw 专用 Chrome 进程（默认开启）\n\n最终形态执行约束（当前实现）：\n\nAnalysis Pass：无视觉、全量执行、深度固定 3；默认\"失败优先截图\"（analysisAutoScreenshot=false），保留 console/network/trace 全量采证。\nShowcase Pass：只跑 Analysis 产出的主链路 + 失败链路，并按 trace 对齐复核。\nShowcase Pass 中若场景步骤是 open，复核执行自动改为同 tab navigate，避免额外新开 tab。\n若两次执行不一致：报告标注 needs_inspection，不阻塞本轮交付。\n若 Showcase 触发时间预算：标注 partial_timeout，并继续生成 report.html/report_full.png 与回传。\n\n执行超时建议（重要）：\n\n从外层 exec 调脚本时，必须设置 timeout >= 900 秒。\n300 秒在\"analysis + showcase + trace + 通知\"组合下容易被外层提前杀掉，导致看起来\"截图回传丢失\"。"
      },
      {
        "title": "次佳演示模式（同机不抢主画面）",
        "body": "你关心的\"炫酷演示 + 不打断主画面工作\"建议这样跑：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id wehub_demo \\\n  --browser-profile openclaw \\\n  --auto-start-browser \\\n  --max-step-retries 1 \\\n  --health-check-interval on-failure\n\n说明：\n\n该模式可在同一台机器运行，不要求你一直把测试窗口放在主画面。\n但若你手动频繁干预同一浏览器窗口，仍会增加波动；重试与健康检查用于兜底并在报告中标注风险归因。\n在 trace-start-mode=auto 下，若首步是 open/navigate，trace 会延后到第一步后启动，减少 about:blank 首屏干扰。\n默认会生成报告全页截图（report_full.png，兼容名 report_screenshot.png）。\n默认会尝试把截图和结论自动发到最近活跃的当前会话频道（可用 --no-notify-auto-current-channel 关闭）。"
      },
      {
        "title": "可视化演示场景（新增）",
        "body": "文件：/Users/chikakochou/OpenClaw/demo/scenarios/wehub_visual_demo.json\n特点：包含\"首屏截图 -> 下翻 -> 下翻后截图 -> 点击跳转同域目标页 -> 返回首页\"的强可视化动作链，适合 CTO 演示。\n场景 ID：wehub_demo（演示门禁配置，已忽略已知 index.css 404 噪音）\n严格门禁 ID：wehub_release（发布判定，不忽略已知 4xx）\n\n运行示例（含自动发当前 Discord 频道）：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id wehub_demo \\\n  --browser-profile openclaw \\\n  --auto-start-browser"
      },
      {
        "title": "泛用模板场景（仅调试/演示用）",
        "body": "文件：/Users/chikakochou/OpenClaw/demo/scenarios/generic_visual_template.json\n场景 ID：generic_template\n模板内置变量占位：\n\n{{start_url}}\n{{start_domain}}\n\n\n注意：正常流程应使用智能生成（优先级 1/2），此模板仅在极端后备或调试时使用。\n示例：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id generic_template \\\n  --scenario-var start_url=http://wehub.us/ \\\n  --scenario-var start_domain=wehub.us \\\n  --browser-profile openclaw \\\n  --auto-start-browser"
      },
      {
        "title": "失败到修复闭环",
        "body": "失败时自动生成 fix_plan.json：\n\n问题摘要\n高概率根因（含置信度）\n检查方向\n修改方向\n验收标准\n回滚条件\n\n\n自动生成 next_window_prompt.md：可直接贴到下一窗口执行\n自动生成 standby_prompt.txt：一句确认即可启动修复流程"
      },
      {
        "title": "最近验证样例（2026-02-20）",
        "body": "runId：wehub-gate-sample-20260220-v2\n报告路径：\n\n/Users/chikakochou/.openclaw/workspace/demo/reports/run-wehub-gate-sample-20260220-v2/report.json\n/Users/chikakochou/.openclaw/workspace/demo/reports/run-wehub-gate-sample-20260220-v2/report.html\n\n\n结果摘要：\n\nreleaseDecision = NO_GO\nriskLevel = high\n门禁违规命中：console error、同域 network 404"
      },
      {
        "title": "Trace 修复记录（2026-02-21）",
        "body": "修复范围：openclaw browser trace start/stop 在嵌套子命令下丢失 --browser-profile 参数的问题。\n根因：CLI 只读取了一层父命令选项，导致 trace 子命令回退到默认 profile（通常是 chrome）。\n修复后验证：\n\ntrace start/stop 在 --browser-profile openclaw 下可正常生成 trace。\nAutoQA run wehub-trace-fix-20260221-v1 已验证 tracePath 存在且报告无 trace warning。"
      },
      {
        "title": "工程注意事项",
        "body": "若 openclaw browser 无法连接，请先启动 OpenClaw 网关/浏览器服务。\nclick/type 依赖快照 ref，场景需要提供稳定 ref 或结合 wait/evaluate 先定位。\n一期先保证可执行和可追溯，不在本阶段引入跨浏览器矩阵和全量性能压测。"
      }
    ],
    "body": "Auto QA (OpenClaw Browser)\n\n用于一期 MVP：\n\n自动执行网页关键路径\n自动采集失败证据（截图、console、network、trace）\n自动输出 CTO 可读报告与修复任务包\n自动重试、断点续跑、健康检查与失败分类（环境/产品）\n实际组件构成（一期 MVP）\n场景定义组件\n位置：demo/scenarios/*.json\n作用：声明测试步骤、断言条件、期望结果。\n输入：业务路径（P0 场景）。\n输出：可执行步骤序列（供执行编排器读取）。\n执行编排器\n位置：src/skills/auto-qa/scripts/run_autoqa.py\n作用：读取场景并调用 openclaw browser 执行动作。\n输入：场景 JSON、浏览器 profile、run_id。\n输出：步骤结果、证据文件、汇总报告与修复提示包。\n浏览器执行器（OpenClaw 内置能力）\n位置：OpenClaw CLI openclaw browser ...\n作用：点击、输入、等待、快照、截图、日志与 trace。\n输入：编排器下发的步骤参数。\n输出：结构化 JSON 结果和调试数据。\n证据归档组件\n位置：demo/artifacts/run-<run_id>/\n作用：按 run 归档步骤明细、截图、console、network、trace。\n输入：执行过程中的实时证据。\n输出：可追溯的失败证据包。\n报告生成组件\n位置：demo/reports/run-<run_id>/report.json、demo/reports/run-<run_id>/report.html\n作用：给出通过率、阻断项、Go/No-Go 判定。\n输入：步骤结果 + 证据统计。\n输出：机器可读（JSON）与演示可读（HTML）报告。\n修复任务包生成组件\n位置：demo/reports/run-<run_id>/fix_plan.json、next_window_prompt.md、standby_prompt.txt\n作用：将\"测试失败证据\"转成\"可直接执行的修复任务\"。\n输入：失败步骤、console、network、trace 路径。\n输出：根因假设、检查方向、修改方向、验收标准、下一窗口提示词。\n稳定性增强组件\n位置：src/skills/auto-qa/scripts/run_autoqa.py\n作用：减少\"主画面外运行\"时的抖动风险，提升演示稳定度。\n能力：\n步骤自动重试（默认每步 1 次重试）\n断点续跑（从失败步骤继续）\n健康检查（off/on-failure/each-step）\n失败分类（environment/product/unknown）\n门禁断言组件\n位置：src/skills/auto-qa/scripts/run_autoqa.py\n作用：将采证数据升级为发布门禁判定，防止\"假 GO\"。\n默认规则：\nconsole error -> 违规（critical）\n同域 network 4xx -> 违规（critical）\n同域 network 5xx -> 违规（blocker）\n报告输出：\ngateViolations\ngateViolationCountsBySeverity\nriskLevel\nreleaseDecision（GO / CONDITIONAL_GO / NO_GO）\nreviewStatus（consistent / needs_inspection）\nreviewConclusion（复核一致 / 复核需进一步检验）\nreviewFindings（需进一步检验时的具体项）\nTrace 对齐组件\n位置：demo/reports/run-<run_id>/step_trace_map.json\n作用：把步骤时间窗与 trace 时间线自动对齐，便于\"步骤 -> 证据\"快速追溯。\n输出：每个步骤对应的 trace 事件计数、帧计数、console/API/network 样本。\n报告通知组件\n位置：src/skills/auto-qa/scripts/run_autoqa.py（运行参数触发）\n作用：自动截取 report.html 全页图并发送到聊天频道。\n规则：\n传入 --notify-channel 时触发。\n未传 --notify-target 时，自动从 openclaw status --json 最近会话推断目标（当前频道优先）。\n一期范围（防跑偏）\n仅网页 P0 场景（3-5 条关键路径）\n证据四件套：screenshot + console + network + trace\n交付最小集合：\nreport.json\nreport.html\nfix_plan.json\nnext_window_prompt.md\nstandby_prompt.txt\n目录约定\ndemo/\n  scenarios/\n    mvp_smoke.json\n    _generated/          ← agent 智能生成的临时 scenario 存放目录\n  artifacts/\n    run-<run_id>/\n      steps.json\n      console.json\n      network.json\n      health_checks.json\n      trace.zip\n      screenshots/\n  reports/\n    run-<run_id>/\n      report.json\n      report.html\n      report_full.png\n      step_trace_map.json\n      fix_plan.json\n      next_window_prompt.md\n      standby_prompt.txt\n\n场景 JSON（最小格式）\n{\n  \"name\": \"MVP Smoke\",\n  \"autoScreenshot\": true,\n  \"continueOnFailure\": false,\n  \"steps\": [\n    { \"id\": \"step-001\", \"action\": \"open\", \"url\": \"https://example.com\", \"expected\": \"页面可访问\" },\n    { \"id\": \"step-002\", \"action\": \"wait\", \"text\": \"Example Domain\", \"expected\": \"标题出现\" },\n    {\n      \"id\": \"step-003\",\n      \"action\": \"assert_text_contains\",\n      \"value\": \"Example Domain\",\n      \"expected\": \"正文包含关键字\"\n    }\n  ]\n}\n\n场景 JSON（门禁规则示例）\n{\n  \"name\": \"WeHub Smoke\",\n  \"gates\": {\n    \"enabled\": true,\n    \"minPassRate\": 95,\n    \"console\": {\n      \"errorAsFailure\": true,\n      \"ignoreMessagePatterns\": [\"known harmless error\"]\n    },\n    \"network\": {\n      \"sameOrigin4xxAsFailure\": true,\n      \"sameOrigin5xxAsFailure\": true,\n      \"thirdParty5xxAsFailure\": false,\n      \"ignoreUrlPatterns\": [\"/favicon.ico\"],\n      \"ignoreStatusCodes\": [401]\n    }\n  },\n  \"steps\": []\n}\n\n场景 JSON（动作展示配置示例）\n{\n  \"name\": \"Visual Demo\",\n  \"visual\": {\n    \"enabled\": true,\n    \"focusTabBeforeStep\": true,\n    \"preActionWaitMs\": 220,\n    \"postActionWaitMs\": 420,\n    \"highlightBeforeClick\": true,\n    \"highlightBeforeType\": true,\n    \"highlightWaitMs\": 480\n  },\n  \"steps\": []\n}\n\n\n说明：\n\nfocusTabBeforeStep：每步前尽量聚焦受控 tab，减少后台节流导致的观感抖动。\npreActionWaitMs/postActionWaitMs：动作前后节奏等待，提升\"可见点击/跳转\"观感。\nhighlightBeforeClick/highlightBeforeType：动作前高亮目标元素。\n支持动作（MVP）\nopen\nnavigate\nsnapshot\nclick\nhover\ntype\npress\nback\nscroll\nclick_link_same_origin\nwait\nevaluate\nassert_url_contains\nassert_text_contains\nscreenshot\nnoop\n场景 JSON 校验层（安全网）\n\nrun_autoqa.py 在加载 scenario 时自动执行 pre-flight 校验：\n\nJSON 语法：解析失败会报告精确行号/列号\n必须字段：每个 step 必须含 action 字段\n动作白名单：action 值必须在上述\"支持动作\"列表内，否则报错并列出全部合法值\n参数完整性：open/navigate 须含 url；click/hover/type 须含 ref；assert_* 须含 value\n\n校验在执行前触发，出错时给出明确的 step 索引和原因——不会默默失败。\n\n生成 scenario 时请确保遵守上述约束。id 字段建议保留（格式 step-NNN），缺省时引擎会自动补全。\n\n场景 JSON（探索配置与返回边覆盖）\n{\n  \"exploration\": {\n    \"enabled\": true,\n    \"maxDepth\": 3,\n    \"maxChildrenPerNode\": 5,\n    \"maxPages\": 30,\n    \"maxDurationMinutes\": 15,\n    \"sameOriginOnly\": true\n  },\n  \"steps\": [\n    { \"id\": \"step-010\", \"action\": \"click_link_same_origin\", \"depth\": 2 },\n    { \"id\": \"step-011\", \"action\": \"back\", \"returnEdge\": true, \"depth\": 2 }\n  ]\n}\n\n\n说明：\n\ndepth：步骤所属探索层级（用于覆盖统计）。\nreturnEdge=true：该步骤计入\"返回边\"覆盖统计（back 动作默认计入）。\n运行方式\n\n在仓库根目录执行：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id wehub_demo \\\n  --browser-profile openclaw \\\n  --auto-start-browser\n\n执行协议（强约束）\n\n当用户表达\"跑 QA / 再测一次 / 做自动回归 / 开始测试\"等执行意图时，默认进入直接执行，不先回复\"计划确认\"。\n\n场景生成优先级（核心规则 — 严格按此顺序执行）\n\n正常流程不使用预设脚本。场景（scenario）应由 agent 智能生成。\n\n优先级 1：用户给了测试要求（自然语言）\n\n用户可能说：\"测一下登录功能\"、\"检查购物车流程\"、\"用以下用例做自动 QA 测试：……\"。\n\nagent 必须：\n\n用 openclaw browser open <url> 打开目标\n用 openclaw browser snapshot --interactive --labels 扫描页面结构\n理解用户的自然语言要求，对照页面上实际存在的元素（表单、按钮、链接、输入框等）\n生成包含用户所有要求的 scenario JSON（每条要求对应具体的 action + expected + assertion）\n将 scenario JSON 写入 demo/scenarios/_generated/<run-id>.json\n用 --scenario <path> --force-direct-scenario-path 执行\n\n严禁忽略用户的任何测试要求。 如果页面上找不到用户要求的元素，在 scenario 中仍要包含该步骤并标注 expected，让执行引擎报告失败——而不是静默跳过。\n\n优先级 2：用户只给了 URL，没有具体要求\n\nagent 必须：\n\n用 openclaw browser open <url> 打开目标\n用 openclaw browser snapshot --interactive --labels 扫描页面结构\n分析页面上的所有可交互元素：链接、按钮、表单、输入框、导航菜单等\n智能生成覆盖以下维度的 scenario JSON：\n页面可访问性（navigate + assert_url）\n核心可交互元素（click 按钮、填写表单、点击链接）\n导航完整性（跳转 + 返回）\n内容断言（assert_text_contains 关键文案）\n将 scenario JSON 写入 demo/scenarios/_generated/<run-id>.json 并执行\n执行完成后，BFS 探索引擎自动补充未覆盖的同域页面\n\n生成的 scenario 必须基于实际页面内容，不能凭空猜测。 每个 step 的 ref、url、text 必须来自 snapshot 的真实数据。\n\n优先级 3（极端后备）：snapshot 失败或浏览器不可用\n\n仅当以上两种方式都失败时（如浏览器无法启动、目标不可达），才回退到预设脚本：\n\n使用注册表默认 defaultScenarioId 或 generic_template\n必须向用户明确警告：\"无法扫描目标，已回退到通用模板，测试覆盖度有限\"\n\n预设脚本（scenario-id）仅用于以下场景：\n\n用户明确要求使用某个 scenario-id（调试/演示用途）\n浏览器/网络故障导致无法扫描目标\n开发者本地调试\n频道与目标策略\n不做固定频道硬编码；频道可变且应随会话上下文切换。\n未显式指定通知目标时，沿用脚本默认\"最近活跃会话自动推断\"能力。\n汇报口径\n一旦命中执行意图，先回\"已开始执行 + 本次 run 参数摘要\"，随后立即落地执行。\n执行完成后再返回报告路径与结论，不把\"执行前计划说明\"作为前置阻塞。\n\n常用参数：\n\n--scenario <path>：直传 scenario JSON 路径（需配合 --force-direct-scenario-path）\n--scenario-id <id>：从注册表选择场景（仅调试/演示；默认注册表：demo/scenarios/registry.json）\n--scenario-registry <path>：指定场景注册表路径\n--scenario-var key=value：覆盖场景变量（可重复；用于模板场景的 {{start_url}}/{{start_domain}} 等占位）\n--allow-direct-scenario-path：允许接收 --scenario <path> 直传请求（默认关闭；默认会回退注册表默认场景）\n--force-direct-scenario-path：强制执行直传路径（智能生成场景时必须开启）\n--run-id <id>：手动指定 run id\n--output-root demo：输出根目录\n--allow-external-scenario：允许执行仓库 demo/scenarios 目录外的场景（默认关闭，防误跑）\n--allow-legacy-scenario：允许执行 meta.legacy=true 的旧场景（默认关闭）\n--no-trace：关闭 trace 录制\n--browser-bin <bin>：指定 OpenClaw 可执行名（默认 openclaw）\n--browser-cmd \"<cmd>\"：指定完整命令前缀（例如 pnpm --dir src openclaw）\n--max-step-retries <n>：每步默认重试次数（默认 1）\n--retry-wait-ms <ms>：重试间隔（默认 800）\n--showcase-recheck：启用复核执行并与主执行结果对照（默认开启）\n--showcase-continue-on-failure：复核执行遇到差异后是否继续（默认开启）\n--showcase-max-step-retries <n>：复核执行默认重试次数（默认 0）\n--showcase-retry-wait-ms <ms>：复核执行重试间隔（默认 500）\n--showcase-time-budget-ms <ms>：复核执行时间预算（默认 90000，超时即提前收口并继续产出最终报告）\n--resume-from-step-id <stepId>：从指定步骤开始续跑\n--resume-from-run-id <runId>：从某次历史失败 run 的首个失败步骤续跑\n--resume-last-failed：从同一场景最近一次失败 run 自动续跑\n--health-check-interval <off|on-failure|each-step>：健康检查频率（默认 on-failure）\n--trace-start-mode <auto|immediate|after-first-step>：trace 启动时机（默认 auto）\n--notify-channel <channel>：自动发送报告截图到指定频道（支持 discord/.../auto/current，不依赖固定频道名）\n--notify-target <target>：频道目标（不传则自动推断最近会话目标）\n--notify-account <id>：可选 accountId\n--notify-message <text>：可选通知文案\n--notify-auto-current-channel：未显式指定频道/目标时，自动发到最近活跃会话（默认开启）\n--notify-max-session-age-ms <ms>：自动推断会话的最大\"最近活跃时间\"（默认 30 分钟）\n--cleanup-orphan-openclaw-processes：运行前自动清理多余 OpenClaw 专用 Chrome 进程（默认开启）\n\n最终形态执行约束（当前实现）：\n\nAnalysis Pass：无视觉、全量执行、深度固定 3；默认\"失败优先截图\"（analysisAutoScreenshot=false），保留 console/network/trace 全量采证。\nShowcase Pass：只跑 Analysis 产出的主链路 + 失败链路，并按 trace 对齐复核。\nShowcase Pass 中若场景步骤是 open，复核执行自动改为同 tab navigate，避免额外新开 tab。\n若两次执行不一致：报告标注 needs_inspection，不阻塞本轮交付。\n若 Showcase 触发时间预算：标注 partial_timeout，并继续生成 report.html/report_full.png 与回传。\n\n执行超时建议（重要）：\n\n从外层 exec 调脚本时，必须设置 timeout >= 900 秒。\n300 秒在\"analysis + showcase + trace + 通知\"组合下容易被外层提前杀掉，导致看起来\"截图回传丢失\"。\n次佳演示模式（同机不抢主画面）\n\n你关心的\"炫酷演示 + 不打断主画面工作\"建议这样跑：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id wehub_demo \\\n  --browser-profile openclaw \\\n  --auto-start-browser \\\n  --max-step-retries 1 \\\n  --health-check-interval on-failure\n\n\n说明：\n\n该模式可在同一台机器运行，不要求你一直把测试窗口放在主画面。\n但若你手动频繁干预同一浏览器窗口，仍会增加波动；重试与健康检查用于兜底并在报告中标注风险归因。\n在 trace-start-mode=auto 下，若首步是 open/navigate，trace 会延后到第一步后启动，减少 about:blank 首屏干扰。\n默认会生成报告全页截图（report_full.png，兼容名 report_screenshot.png）。\n默认会尝试把截图和结论自动发到最近活跃的当前会话频道（可用 --no-notify-auto-current-channel 关闭）。\n可视化演示场景（新增）\n文件：/Users/chikakochou/OpenClaw/demo/scenarios/wehub_visual_demo.json\n特点：包含\"首屏截图 -> 下翻 -> 下翻后截图 -> 点击跳转同域目标页 -> 返回首页\"的强可视化动作链，适合 CTO 演示。\n场景 ID：wehub_demo（演示门禁配置，已忽略已知 index.css 404 噪音）\n严格门禁 ID：wehub_release（发布判定，不忽略已知 4xx）\n\n运行示例（含自动发当前 Discord 频道）：\n\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id wehub_demo \\\n  --browser-profile openclaw \\\n  --auto-start-browser\n\n泛用模板场景（仅调试/演示用）\n文件：/Users/chikakochou/OpenClaw/demo/scenarios/generic_visual_template.json\n场景 ID：generic_template\n模板内置变量占位：\n{{start_url}}\n{{start_domain}}\n注意：正常流程应使用智能生成（优先级 1/2），此模板仅在极端后备或调试时使用。\n示例：\npython3 src/skills/auto-qa/scripts/run_autoqa.py \\\n  --scenario-id generic_template \\\n  --scenario-var start_url=http://wehub.us/ \\\n  --scenario-var start_domain=wehub.us \\\n  --browser-profile openclaw \\\n  --auto-start-browser\n\n失败到修复闭环\n失败时自动生成 fix_plan.json：\n问题摘要\n高概率根因（含置信度）\n检查方向\n修改方向\n验收标准\n回滚条件\n自动生成 next_window_prompt.md：可直接贴到下一窗口执行\n自动生成 standby_prompt.txt：一句确认即可启动修复流程\n最近验证样例（2026-02-20）\nrunId：wehub-gate-sample-20260220-v2\n报告路径：\n/Users/chikakochou/.openclaw/workspace/demo/reports/run-wehub-gate-sample-20260220-v2/report.json\n/Users/chikakochou/.openclaw/workspace/demo/reports/run-wehub-gate-sample-20260220-v2/report.html\n结果摘要：\nreleaseDecision = NO_GO\nriskLevel = high\n门禁违规命中：console error、同域 network 404\nTrace 修复记录（2026-02-21）\n修复范围：openclaw browser trace start/stop 在嵌套子命令下丢失 --browser-profile 参数的问题。\n根因：CLI 只读取了一层父命令选项，导致 trace 子命令回退到默认 profile（通常是 chrome）。\n修复后验证：\ntrace start/stop 在 --browser-profile openclaw 下可正常生成 trace。\nAutoQA run wehub-trace-fix-20260221-v1 已验证 tracePath 存在且报告无 trace warning。\n工程注意事项\n若 openclaw browser 无法连接，请先启动 OpenClaw 网关/浏览器服务。\nclick/type 依赖快照 ref，场景需要提供稳定 ref 或结合 wait/evaluate 先定位。\n一期先保证可执行和可追溯，不在本阶段引入跨浏览器矩阵和全量性能压测。"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/zxvchaos/auto-qa",
    "publisherUrl": "https://clawhub.ai/zxvchaos/auto-qa",
    "owner": "zxvchaos",
    "version": "1.2.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/auto-qa",
    "downloadUrl": "https://openagent3.xyz/downloads/auto-qa",
    "agentUrl": "https://openagent3.xyz/skills/auto-qa/agent",
    "manifestUrl": "https://openagent3.xyz/skills/auto-qa/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/auto-qa/agent.md"
  }
}