preview-test

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Preview Test

预览测试

Functionally test a deployed PR preview without assuming the host, deployment platform, app stack, tracker, or domain.
无需假设宿主、部署平台、应用栈、追踪器或域名,对已部署的PR预览进行功能测试。

References

参考资料

  • references/preview-detection.md
    — URL, PR number, readiness, vision, and verdict contract.
  • references/vcs-host-detection.md
    — host CLI fallback pattern.
  • references/preview-detection.md
    — URL、PR编号、就绪状态、视觉验证和结论约定。
  • references/vcs-host-detection.md
    — 宿主CLI回退模式。

Workflow

工作流程

  1. Resolve inputs.
    • Read
      .turkit.yaml
      if present.
    • Resolve the preview URL via
      references/preview-detection.md
      .
    • If the URL cannot be resolved, ask the operator for a URL or permission to skip. If skipped, output
      status: "FAIL"
      with a finding explaining that no preview URL was available.
  2. Resolve automation path.
    • Prefer an available browser/Playwright MCP or host-native browser tool.
    • If no browser automation tool is available, ask the operator to provide manual observations or skip. Do not invent results.
    • Never require Claude-specific, Codex-specific, Cursor-specific, or Gemini-specific tooling for correctness.
  3. Open the preview.
    • Navigate to the resolved URL.
    • Apply
      preview.wait_for
      per
      references/preview-detection.md
      when configured.
    • If the preview is not reachable or readiness never appears, return
      FAIL
      with evidence.
  4. Run the requested scenario.
    • Use the operator's prompt, PR description, ticket text, or changed surface to identify the flow to test.
    • Exercise the smallest user-visible path that proves the feature works.
    • Capture relevant console/runtime/network errors if the browser tool exposes them.
    • Do not assume authentication, seed data, tenant, locale, or environment names. Ask when needed.
  5. Analyze visual state.
    • Apply
      preview.vision
      per
      references/preview-detection.md
      .
    • If screenshot/vision is unavailable, continue with functional evidence and report the residual risk.
    • Treat visual issues as findings only when tied to the requested behavior or obvious broken UI.
  6. Return the structured verdict. End the response with a JSON object matching the contract:
    json
    {
      "status": "PASS",
      "findings": []
    }
  1. 解析输入
    • 若存在
      .turkit.yaml
      则读取该文件。
    • 通过
      references/preview-detection.md
      解析预览URL。
    • 若无法解析URL,询问操作者提供URL或是否允许跳过。若跳过,输出
      status: "FAIL"
      并附上说明:无可用预览URL。
  2. 确定自动化路径
    • 优先使用可用的浏览器/Playwright MCP或宿主原生浏览器工具。
    • 若无浏览器自动化工具可用,询问操作者提供手动观测结果或是否允许跳过。不得编造测试结果。
    • 正确性验证绝不能依赖Claude专属、Codex专属、Cursor专属或Gemini专属工具。
  3. 打开预览
    • 导航至解析得到的URL。
    • 若已配置,按照
      references/preview-detection.md
      中的
      preview.wait_for
      规则等待。
    • 若预览无法访问或始终未显示就绪状态,返回
      FAIL
      并附上证据。
  4. 运行请求的测试场景
    • 根据操作者的提示、PR描述、工单文本或变更内容确定要测试的流程。
    • 执行最小的用户可见路径以验证功能正常工作。
    • 若浏览器工具支持,捕获相关的控制台/运行时/网络错误。
    • 不得假设身份验证、种子数据、租户、区域设置或环境名称。必要时询问操作者。
  5. 分析视觉状态
    • 按照
      references/preview-detection.md
      中的
      preview.vision
      规则进行视觉验证。
    • 若截图/视觉验证不可用,继续使用功能证据并报告剩余风险。
    • 仅当视觉问题与请求的行为相关或属于明显损坏的UI时,才将其列为问题点。
  6. 返回结构化结论。 响应末尾需附上符合约定的JSON对象:
    json
    {
      "status": "PASS",
      "findings": []
    }

Guardrails

约束规则

  • No hardcoded preview hostnames, domains, tenants, stacks, or package managers.
  • No project-specific assumptions.
  • Do not run local build/test commands unless the operator explicitly asks; this skill tests the deployed preview.
  • Do not mark
    PASS
    if the preview could not be opened, the requested flow was not exercised, or required visual analysis was unavailable and essential.
  • Use
    FAIL
    with a clear configuration/tooling finding when the operator chooses not to provide a URL or manual evidence.
  • Apply
    references/output-preferences.md
    for operator-facing language/style, but keep the final JSON keys in English.
  • 不得硬编码预览主机名、域名、租户、技术栈或包管理器。
  • 不得做出项目特定的假设。
  • 除非操作者明确要求,否则不得运行本地构建/测试命令;本技能仅测试已部署的预览环境。
  • 若无法打开预览、未执行请求的测试流程,或必要的视觉分析不可用且至关重要时,不得标记为
    PASS
  • 当操作者选择不提供URL或手动证据时,返回
    FAIL
    并附上清晰的配置/工具问题说明。
  • 面向操作者的语言/风格需遵循
    references/output-preferences.md
    ,但最终JSON的键需保留英文。