Stabilize e2e pattern

From glowingkitty/OpenMates · View interactive version

Stabilize e2e pattern is an AI agent skill from the GitHub repository glowingkitty/OpenMates. Convert repeated Playwright wait/stabilize/lookup/assertion fixes into shared deterministic helpers. Use when the same spec or flow fails repeatedly, commits say wait/stabilize/lookup/assertion, or an E2E fix looks like a one-off timing patch.

How to use this skill

Skill file

Stabilize E2E Pattern

Use this skill when an E2E failure is likely part of a recurring readiness or

selector pattern rather than a unique product bug. The goal is to prevent spec

debt from spreading through one-off waits, repeated lookups, and fragile local

assertions.

When To Use

Workflow

  1. Read test-results/reports/failed/<spec>.md and the current screenshot folder for the failed spec.
  2. Read the failing spec and any helpers it already imports.
  3. Classify the failure into one readiness category:
  1. Search for existing shared helpers before editing. Prefer extending helpers under frontend/apps/web_app/tests/helpers/ over editing one spec inline.
  2. If no helper exists, add the smallest helper that waits on deterministic UI, network, storage, or debug state. Do not add sleeps.
  3. Migrate the failing spec to the shared helper. If nearby specs duplicate the same wait pattern, migrate those too only when the diff stays small.
  4. Add useful diagnostics at the helper boundary, such as screenshot step labels, failed-response logging, or state-specific error messages.
  5. Run python3 scripts/tests.py run --spec <name>.spec.ts through the unified test control plane. Do not run Playwright locally.

Rules

Output

Return a concise report:

## E2E Stabilization
Pattern: <category>
Shared helper: <created|updated|existing helper path>
Specs migrated: <list>
Diagnostics added: <list>
Verification: <test command/run id or blocker>
Residual risk: <one sentence>
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.