| name | desktop-e2e-fixture-seeding |
| description | Record, export, derive, and refresh desktop replay-backed E2E fixtures for PwrAgent. Use when Codex needs to seed or update `apps/desktop/e2e/fixtures/*` from a live desktop session with Computer Use, add a new capture recipe, promote `raw.capture.jsonl` into `replay.fixture.json`, or wire a replay-backed Electron spec around a captured scenario. |
Desktop E2E Fixture Seeding
Use this skill to turn a live desktop session into replay-backed Electron test
coverage.
Read First
Repo and desktop AGENTS.md instructions already apply. For this workflow,
read these files first:
- ../../../apps/desktop/e2e/fixtures/README.md
Then read the scenario recipe you are seeding or refreshing:
If you are adding a new scenario, mirror those recipe files and update the
shared fixture workflow doc.
Workflow
-
Pick the scenario and confirm whether you are refreshing an existing fixture
or adding a new one.
-
Prepare a disposable worktree if the capture recipe edits files.
-
Launch the desktop app in record mode:
PWRAGNT_PROTOCOL_CAPTURE=true \
PWRAGNT_PROTOCOL_CAPTURE_ROOT=/tmp/pwragent-protocol-captures \
pnpm dev
-
Use Computer Use primitives only and follow the scenario recipe exactly:
get_app_state
click
type_text
press_key
scroll
-
Stop at the recipe's documented stop point. Record the backend-qualified
session id, thread id, and capture id if the export flow exposes them.
-
Export the raw session evidence:
pnpm --filter @pwragent/desktop export:session-capture -- \
--capture-root /tmp/pwragent-protocol-captures \
--session codex:<thread-id> \
--output /tmp/<scenario>.raw.capture.jsonl
-
Derive the curated replay fixture:
pnpm --filter @pwragent/desktop derive:replay-fixture -- \
--input /tmp/<scenario>.raw.capture.jsonl \
--output-dir apps/desktop/e2e/fixtures/<scenario> \
--scenario <scenario> \
--backend codex \
--thread-id <thread-id> \
--source-capture-id <capture-id> \
--start <sequence> \
--end <sequence>
-
Add or update the Playwright Electron spec. Follow the style in:
-
Run the relevant checks:
pnpm test:desktop-e2e
pnpm test
pnpm typecheck
Guardrails
- Do not hand-edit
raw.capture.jsonl.
- Keep the replay window tight. Preserve only the protocol slice needed for the
user-visible assertion.
- Keep
capture-recipe.md, raw.capture.jsonl, and replay.fixture.json
together in the same scenario directory.
- Prefer assertions on visible UI outcomes, transcript order, and composer
state rather than protocol internals.
- Update ../../../README.md and
../../../apps/desktop/e2e/fixtures/README.md
when you add a new scenario or materially change the operator workflow.