Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计异常

test测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

759

周安装

31

GitHub Stars

公开资料未说明

下载量

243
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:test(测试)
来源仓库:https://github.com/eljun/workflow-skills
仓库路径:skills/test
安装命令:
npx skills add https://github.com/eljun/workflow-skills --skill test
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/eljun/workflow-skills --skill test

简介

用于 Playwright 驱动的测试自动化。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中执行 E2E 验证。
  • .mcp.json 配置后自动加载 playwright MCP 服务。
  • CI 模式下无需 MCP,直接运行 npm 脚本即可。
  • test 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

/test - Web E2E Testing Agent

Prerequisites: Playwright MCP Setup

  • No npm install needed — Claude Code handles it automatically
  • Create .mcp.json in project root (not in .claude/ or subdirectories): {"mcpServers": {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"]}}}
  • Restart Claude Code after adding/modifying .mcp.json
  • Verify MCP active: look for mcp__playwright__browser_* tools

CI Mode requirements (no MCP needed):

npm install -D @playwright/test
npx playwright install

CRITICAL: Mode Detection (Execute FIRST)

STEP 1: Parse for --ci flag
           │
    ┌──────┴──────┐
    ▼             ▼
Has --ci?     No --ci?
    │             │
    ▼             ▼
MODE = CI     STEP 2: Check for mcp__playwright__browser_* tools
              │
     ┌────────┴────────┐
     ▼                 ▼
Available?         NOT Available?
     │                 │
     ▼                 ▼
MODE = Interactive   Check Automation field
                     │
            ┌────────┴────────┐
            ▼                 ▼
      Automation: auto    Manual mode
            │                 │
            ▼                 ▼
      Fall back to CI     STOP — display
      Notify user         prereqs, do NOT
                          fall back or proceed

ABSOLUTE RULES:

  1. No --ci + No Playwright MCP + Manual mode = STOP. Do not proceed. Do not fall back.
  2. No --ci + No Playwright MCP + Auto mode = Fall back to CI silently. Notify user and continue.
  3. No --ci + Playwright MCP available = Interactive mode ONLY. Never create test scripts.
  4. --ci present = CI mode. Playwright MCP not required.

CRITICAL: Mode-Specific Rules

Interactive Mode — What NOT To Do

  • Do NOT create .ts, .js, or .spec test files
  • Do NOT create TEST_REPORT.md, TEST_SUMMARY.txt in project root
  • Do NOT create test-screenshots/ or similar folders in project root
  • Do NOT run npx playwright test
  • Do NOT spawn subagents to run headless tests
  • Use mcp__playwright__browser_* tools directly in conversation
  • Write final report ONLY to docs/testing/{task-name}.md

CI Mode — Allowed Actions

  • Create test scripts in tests/e2e/{task-name}/ (NOT project root)
  • Run npx playwright test for headless execution
  • Spawn subagents for parallel test execution
  • Write final report to docs/testing/{task-name}.md
  • Cleanup all temporary artifacts after tests
  • Ask user if they want to keep test scripts for CI pipeline

Workflow

Always execute Mode Detection FIRST.

Interactive Mode (Default)

/test {task-name}
       ↓
1. Read task document: ## Implementation Notes (primary), ## Acceptance Criteria (test cases)
2. Build test plan mapping each acceptance criterion to a Playwright action
3. Execute tests via mcp__playwright__browser_* tools directly
   ⚠️ DO NOT create test script files
4. Write report to docs/testing/{ID}-{task-name}.md using: docs/templates/test-report.md
5. Update TASKS.md
       ↓
Route on automation mode (see below)

CI Mode (--ci flag)

/test --ci {task-name}
       ↓
1. Read task document for requirements
2. Create test directory: tests/e2e/{task-name}/
3. Generate Playwright test script(s)
4. Run: npx playwright test
5. Capture results
6. Write report to docs/testing/{ID}-{task-name}.md using: docs/templates/test-report.md
7. Cleanup temporary artifacts (keep test scripts by default)
8. Update TASKS.md
       ↓
Route on automation mode (see below)
/test --ci --cleanup {task-name}
       ↓
Same as above, but ALSO deletes tests/e2e/{task-name}/

CI Mode: Directory Structure (CRITICAL)

project-root/
├── tests/
│   └── e2e/
│       └── {task-name}/           ← Test scripts go HERE (*.spec.ts)
│           ├── {task-name}.spec.ts
│           └── helpers.ts (if needed)
│
├── docs/
│   └── testing/
│       └── {task-name}.md         ← ONLY the final report goes HERE
│
└── (temporary — ALWAYS DELETE after tests)
    ├── TEST_REPORT.md, TEST_CASES.md, TEST_SUMMARY.txt
    ├── test_results.md, test_execution_summary.md
    ├── TEST_REPORT_INDEX.md, playwright_mcp_test_log.md
    ├── test-screenshots/, test-results/, playwright-report/

ONLY allowed in docs/testing/:

  • docs/testing/{task-name}.md (final test report, one per task)
  • docs/testing/README.md (if project has one)

CI Mode: Artifact Management

ArtifactLocation--ci--ci --cleanup
Final test reportdocs/testing/{task-name}.mdKeepKeep
Test scriptstests/e2e/{task-name}/KeepDelete
TEST_CASES.mdanywhereDeleteDelete
test_results.mdanywhereDeleteDelete
test_execution_summary.mdanywhereDeleteDelete
TEST_REPORT_INDEX.mdanywhereDeleteDelete
playwright_mcp_test_log.mdanywhereDeleteDelete
TEST_SUMMARY.txtanywhereDeleteDelete
test-screenshots/anywhereDeleteDelete
playwright-report/anywhereDeleteDelete
test-results/anywhereDeleteDelete

Cleanup commands (run at end of every CI test):

rm -f TEST_REPORT.md TEST_SUMMARY.txt TEST_CASES.md
rm -f test_results.md test_execution_summary.md TEST_REPORT_INDEX.md
rm -f playwright_mcp_test_log.md
rm -rf test-screenshots/ test-results/ playwright-report/
rm -f test-*.ts test-*.js *.spec.ts
rm -f docs/testing/TEST_CASES.md docs/testing/test_results.md
rm -f docs/testing/test_execution_summary.md docs/testing/TEST_REPORT_INDEX.md
rm -f docs/testing/playwright_mcp_test_log.md docs/testing/TEST_SUMMARY.txt
rm -f docs/testing/*.spec.ts

Pre-Testing Setup

Read task document in this priority order:

  1. ## Implementation Notes — how to access and test what was built (URL, credentials, setup)
  2. ## Acceptance Criteria — Given/When/Then scenarios to verify (your test cases)
  3. If ## Implementation Notes missing, fall back to ## Requirements and ## File Changes

Do NOT scan the codebase or infer test scenarios.

Map each criterion to a Playwright action:

Given I am on `/auth/login`          → navigate to URL
When I submit valid credentials      → fill form + click submit
Then I am redirected to `/dashboard` → assert URL changed

Execute: happy path → error states → edge cases.


Testing with Playwright MCP

mcp__playwright__browser_navigate    - Go to URL
mcp__playwright__browser_snapshot    - Capture accessibility snapshot
mcp__playwright__browser_click       - Click elements
mcp__playwright__browser_type        - Type text
mcp__playwright__browser_fill_form   - Fill form fields
mcp__playwright__browser_take_screenshot - Capture screenshot
mcp__playwright__browser_console_messages - Check console
mcp__playwright__browser_network_requests - Check network
mcp__playwright__browser_wait_for    - Wait for conditions

Test execution pattern:

// 1. Navigate
mcp__playwright__browser_navigate({ url: "http://localhost:3000/path" })
// 2. Snapshot to understand structure
mcp__playwright__browser_snapshot()
// 3. Interact (use ref from snapshot)
mcp__playwright__browser_click({ ref: "button[Submit]", element: "Submit button" })
// 4. Verify
mcp__playwright__browser_snapshot()
// 5. Check errors
mcp__playwright__browser_console_messages({ level: "error" })

Responsive testing:

mcp__playwright__browser_resize({ width: 390, height: 844 }) // iPhone 14 Pro
mcp__playwright__browser_resize({ width: 768, height: 1024 }) // iPad

Write Test Report

Write report to docs/testing/{ID}-{task-name}.md using: docs/templates/test-report.md


Update TASKS.md

  • PASS: Move to "Approved" section with status "PASS - Awaiting approval"
  • FAIL: Keep in "Testing" with status "FAIL - See report"

Auto Mode Behavior

When task document has Automation: auto, this skill is a worker — output SIGNAL and exit. Do not spawn next skill.

On PASS

≡ SIGNAL
STAGE: test
STATUS: PASS
TASK: {ID}
SUMMARY: {N}/{N} acceptance criteria verified
REFERENCE: docs/testing/{ID}-{task-name}.md
≡ END

Manual mode: Run /clear then /document {ID}.

On FAIL

Write failure block to task document ## Implementation Notes:

### Test failure (attempt {N})
- **Failed criteria:** {list which acceptance criteria failed}
- **Root cause:** {specific observable failure — URL, element, response}
- **Files to check:** {files most likely involved}
≡ SIGNAL
STAGE: test
STATUS: FAIL
TASK: {ID}
SUMMARY: {N} criteria failed — details in test report
REFERENCE: docs/testing/{ID}-{task-name}.md
≡ END

Manual mode: Run /clear then /implement {ID}/simplify {ID}/test {ID}.


Manual Testing Guidance

For features that can't be fully automated, document in report:

TestInstructionsExpected Result
Visual accuracyCompare to designMatches mockup
AnimationTrigger X actionSmooth 60fps

Manual mode handoff:

  • PASS: notify user, report at docs/testing/{ID}-{task-name}.md, next step /document {ID}
  • FAIL: notify user, report at docs/testing/{ID}-{task-name}.md, next step /implement {ID} then re-run /test {ID}

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.23%
按下载量换算88

Claude

29%
按下载量换算70

Cursor

16.92%
按下载量换算41

Gemini CLI

8.79%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills