# Test Execution

> Use when confirmed planning artifacts and final execution plan are available and page verification, field comparison, evidence capture, or priority execution is requested.

- Skill: `coffeecheese/test-execution` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add coffeecheese/test-execution`
- Raw SKILL.md: https://api.skillmd.com/api/skills/coffeecheese/test-execution/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: CoffeeCheese (https://skillmd.com/u/coffeecheese)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/coffeecheese/test-execution

---


# Test Execution

## Goal

Execute confirmed test cases and record evidence by priority.

## Required Inputs

- Confirmed module artifact directory.
- Readable `01-04` planning artifacts.
- Final execution plan from `execution-gate`.
- Confirmed risk boundary.
- Runtime dependency check result from `execution-gate`, including downgrade strategy for unavailable optional dependencies.

## Execution Modes

Single-agent mode:

- Execute `P0 -> P1 -> P2 -> P3`.
- Write each priority result to its own `执行结果/Px/` directory.
- Each priority directory must contain priority-owned `05-执行记录.md` and `06-缺陷记录.md`, plus `screenshots/`, `videos/`, and `scripts/`.

Multi-agent mode:

- Dispatch by priority only.
- A child agent writes only its assigned `执行结果/Px/` directory.
- Each assigned priority directory must contain priority-owned `05-执行记录.md` and `06-缺陷记录.md`, plus `screenshots/`, `videos/`, and `scripts/`.
- Child agents do not modify `01-04`.
- Child agents do not write root `05-执行记录.md` or `06-缺陷记录.md`.

## Priority Directory Contract

For every executed priority, use this structure:

```text
执行结果/Px/
执行结果/Px/05-执行记录.md
执行结果/Px/06-缺陷记录.md
执行结果/Px/screenshots/
执行结果/Px/videos/
执行结果/Px/scripts/
```

Root `05-执行记录.md` and `06-缺陷记录.md` are generated by `result-aggregation` from these priority-owned files.

## First-Run Browser Protocol

Before the first browser navigation for each page or key flow, read and apply [browser-execution-protocol.md](references/browser-execution-protocol.md). Use it again when a browser recheck enters an unknown page state.

- Match reconnaissance to static HTML or a dynamic application.
- Complete the enter, readiness, reconnaissance, locator, action, assertion, classification, evidence, and cleanup loop.
- Keep observable readiness conditions, runtime observation, locator risk, and resource ownership explicit in the priority execution record.
- Preserve the backend and diagnostic escalation rules below; the protocol standardizes execution behavior and does not replace the confirmed backend.

## Evidence Rules

- Passing cases need a result summary and do not require screenshots.
- Field differences require screenshots.
- Operation failures require an actual-result summary and a screenshot when feasible. Record Console, Network, Playwright video, Trace, or HAR evidence only when the selected backend actually produced it; otherwise record `未产生（原因）` and the resulting evidence gap.
- Missing account, permission, data, environment, or dependency is recorded as `阻塞`.
- Blockers are not defects unless the user confirms they are product or implementation issues.

## Diagnostic Escalation

Escalate from `agent-browser` to Chrome DevTools CLI only when one of these conditions occurs:

- Console runtime error or white screen.
- Key request returns 4xx, 5xx, timeout, CORS, blocked, or redirect loop.
- Page load or key interaction exceeds the confirmed threshold.
- UI, API, local storage, or session state appears inconsistent.
- Upload, drag-and-drop, iframe, shadow DOM, canvas, map, chart, or rich text editor interaction fails.
- Current evidence is insufficient to write a reproducible defect.

Escalate from Chrome DevTools CLI to Chrome DevTools MCP only when CLI output cannot complete the diagnosis.

## Execution Backend Rules

Default backend:

- Use `agent-browser` for first-run browser execution.
- Use priority-isolated browser sessions in multi-agent mode, such as `AGENT_BROWSER_SESSION=P0`, `AGENT_BROWSER_SESSION=P1`, `AGENT_BROWSER_SESSION=P2`, and `AGENT_BROWSER_SESSION=P3`.
- Prefer batch execution and concise command output.
- Store screenshots, videos, scripts, and diagnostic files on disk, then reference paths in Markdown records.
- Generate Playwright Test regression script drafts only when the final execution plan requests script persistence or when a P0/P1 failure needs future regression.

Failure diagnostics:

- Use Chrome DevTools CLI when `agent-browser` evidence is insufficient.
- Use Chrome DevTools MCP only when CLI diagnostics are unavailable, insufficient, or require interactive DevTools analysis.
- Child agents must not start MCP by default.
- If a dependency is unavailable, record the downgrade strategy and continue only when the remaining evidence is sufficient.
- Read the dependency check result before page execution.
- The main agent owns dependency installation prompts and install execution after explicit user confirmation.
- Child agents must not install dependencies. They may only record blockers or request main-agent intervention.
- If a diagnostic backend is unavailable, record the downgrade reason and evidence gap in the priority execution record.
- Do not claim Console, Network, HAR, trace, or MCP evidence unless the related tool actually produced it.

## Progress Output

Report progress at priority start, meaningful checkpoints, failures, blockers, and priority completion. Keep updates concise and include evidence paths.

