Automate E2E Tests
Turn a validated behavior into durable regression coverage using the project's E2E, integration, contract, or mobile test framework. This is a generic starter skill; project teams should run setup-task-to-pr to enrich it with exact paths, commands, fixtures, auth, device setup, and CI rules.
When Not to Use
- Do not use for manual QA, screenshots, video, or validation reports only. Use
test-feature.
- Do not use for broad flaky-suite repair or skip audits unless the user asks for suite maintenance.
- Do not use when unit, component, API, parser, validator, or contract tests are the better level of coverage.
- Do not add E2E tests for docs-only or internal refactors with no user-observable behavior.
Inputs
Before editing tests, read:
- The requirement or ticket.
- The implementation diff.
- The feature validation report from
test-feature or the configured testing skill, if present.
- Existing E2E configs, specs, fixtures, and helpers.
- Project test instructions.
Discover common frameworks:
rg --files -g 'playwright.config.*' -g 'cypress.config.*' -g 'wdio.conf.*' -g 'nightwatch.conf.*' -g 'detox.config.*' -g 'maestro.yaml' -g '.maestro/**' -g 'package.json' -g 'pom.xml' -g 'build.gradle*'
find . -maxdepth 4 -type d \( -name e2e -o -name cypress -o -name playwright -o -name specs -o -name tests -o -name maestro \) 2>/dev/null | sort
If no E2E framework exists, do not introduce one without user approval. Document the coverage gap and suggest the smallest viable framework choice.
Coverage Decision
Add or update E2E coverage when:
- Auth, routing, browser/mobile UI, persistence, realtime behavior, payments, onboarding, checkout, permissions, or multi-service integration is the thing being protected.
- A core user journey changed.
- A bug reproduction needs a full-stack regression test.
- The project already has nearby E2E coverage for the same surface.
Prefer lower-level tests, with a documented reason, when:
- The behavior is pure calculation, parsing, validation, formatting, or data mapping.
- The E2E setup would be brittle because required test data, auth, or environments are missing.
- Equivalent E2E coverage already exists.
- The change is not user-observable.
Authoring Flow
- Identify the smallest durable journey from the validation report or requirement.
- Search existing specs before creating new files:
rg -n "<route|feature words|button text|test id|domain term>" .
- Reuse existing fixtures, auth helpers, page objects, seed data, server setup, device setup, and test utilities.
- Update an existing spec when it already owns the behavior.
- Create a new spec only in the closest established E2E folder.
- Prefer accessible roles, labels, and visible text. Add stable test selectors only when the UI needs a durable test contract.
- Assert user-visible outcomes and persisted state. Do not assert private implementation details.
- Cover the changed happy path and at least one meaningful failure, boundary, or recovery path when practical.
- Keep the test deterministic. Avoid broad sleeps unless the existing suite has a scoped settle helper and no better signal exists.
Surface Guidance
| Surface |
Guidance |
| Web/PWA |
Prefer existing Playwright, Cypress, WebdriverIO, or framework-specific browser tests. Reuse auth storage and fixture setup. |
| Native mobile |
Prefer existing Appium, Detox, Maestro, XCUITest, Espresso, or project simulator/device harness. Do not invent device setup. |
| API |
Prefer integration or contract tests over browser E2E unless a UI flow is part of the requirement. |
| Desktop |
Use the project's established desktop automation harness. If none exists, document the gap before adding tooling. |
| Monorepo |
Place tests beside the app or in the established cross-app E2E package. |
Validation
Run the narrowest focused command first. Examples:
npx playwright test path/to/spec
npx cypress run --spec path/to/spec
npm run e2e -- path/to/spec
pnpm e2e path/to/spec
yarn e2e path/to/spec
./gradlew connectedAndroidTest
xcodebuild test -scheme <scheme> -destination <destination>
maestro test path/to/flow.yaml
Use the command the project already documents. For new or meaningfully changed browser/mobile specs, repeat the focused test when practical to catch obvious flakes.
Run broader E2E or CI-equivalent checks only when touched helpers, fixtures, setup code, or shared flows make the focused run insufficient.
Failure Handling
- Spec exposes a product bug: fix the product if in scope, then rerun the focused spec.
- Spec is flaky: tighten selectors, setup, waits, data isolation, or assertions. If this becomes broad suite repair, stop and report that the task has changed.
- Missing fixture/auth/device support: add the narrowest reusable support if safe; otherwise document the blocker.
- No approved E2E framework: ask before introducing one.
- Environment unavailable: record exact command, error, and unverified risk in the PR/testing notes.
Artifacts
Success produces one of:
- A new or updated E2E spec/flow.
- A new or updated integration or contract test when that is the right regression layer.
- A narrow fixture/helper update required by that spec.
- A documented E2E coverage exception with the alternate coverage used.
Report the exact files changed, command run, pass/fail result, and remaining risk.
Source
Generic starter from Supatest AI supa-skills automate-e2e-tests v1.0.1. Run setup-task-to-pr in each project to create a local enriched version.
Self-Improvement
If this skill chooses the wrong regression layer, misses a project test framework, or creates brittle tests, patch this skill or the configured project-local version before closing.
1---2name: automate-e2e-tests3description: This skill should be used when the user asks to add or update durable E2E, integration, contract, browser, mobile, API, routing, auth, or multi-service regression tests after a feature is validated. Do not use for manual QA only.4---56# Automate E2E Tests78Turn a validated behavior into durable regression coverage using the project's E2E, integration, contract, or mobile test framework. This is a generic starter skill; project teams should run `setup-task-to-pr` to enrich it with exact paths, commands, fixtures, auth, device setup, and CI rules.910## When Not to Use1112- Do not use for manual QA, screenshots, video, or validation reports only. Use `test-feature`.13- Do not use for broad flaky-suite repair or skip audits unless the user asks for suite maintenance.14- Do not use when unit, component, API, parser, validator, or contract tests are the better level of coverage.15- Do not add E2E tests for docs-only or internal refactors with no user-observable behavior.1617## Inputs1819Before editing tests, read:20211. The requirement or ticket.222. The implementation diff.233. The feature validation report from `test-feature` or the configured testing skill, if present.244. Existing E2E configs, specs, fixtures, and helpers.255. Project test instructions.2627Discover common frameworks:2829```bash30rg --files -g 'playwright.config.*' -g 'cypress.config.*' -g 'wdio.conf.*' -g 'nightwatch.conf.*' -g 'detox.config.*' -g 'maestro.yaml' -g '.maestro/**' -g 'package.json' -g 'pom.xml' -g 'build.gradle*'31find . -maxdepth 4 -type d \( -name e2e -o -name cypress -o -name playwright -o -name specs -o -name tests -o -name maestro \) 2>/dev/null | sort32```3334If no E2E framework exists, do not introduce one without user approval. Document the coverage gap and suggest the smallest viable framework choice.3536## Coverage Decision3738Add or update E2E coverage when:3940- Auth, routing, browser/mobile UI, persistence, realtime behavior, payments, onboarding, checkout, permissions, or multi-service integration is the thing being protected.41- A core user journey changed.42- A bug reproduction needs a full-stack regression test.43- The project already has nearby E2E coverage for the same surface.4445Prefer lower-level tests, with a documented reason, when:4647- The behavior is pure calculation, parsing, validation, formatting, or data mapping.48- The E2E setup would be brittle because required test data, auth, or environments are missing.49- Equivalent E2E coverage already exists.50- The change is not user-observable.5152## Authoring Flow53541. Identify the smallest durable journey from the validation report or requirement.552. Search existing specs before creating new files:56 ```bash57 rg -n "<route|feature words|button text|test id|domain term>" .58 ```593. Reuse existing fixtures, auth helpers, page objects, seed data, server setup, device setup, and test utilities.604. Update an existing spec when it already owns the behavior.615. Create a new spec only in the closest established E2E folder.626. Prefer accessible roles, labels, and visible text. Add stable test selectors only when the UI needs a durable test contract.637. Assert user-visible outcomes and persisted state. Do not assert private implementation details.648. Cover the changed happy path and at least one meaningful failure, boundary, or recovery path when practical.659. Keep the test deterministic. Avoid broad sleeps unless the existing suite has a scoped settle helper and no better signal exists.6667## Surface Guidance6869| Surface | Guidance |70|---|---|71| Web/PWA | Prefer existing Playwright, Cypress, WebdriverIO, or framework-specific browser tests. Reuse auth storage and fixture setup. |72| Native mobile | Prefer existing Appium, Detox, Maestro, XCUITest, Espresso, or project simulator/device harness. Do not invent device setup. |73| API | Prefer integration or contract tests over browser E2E unless a UI flow is part of the requirement. |74| Desktop | Use the project's established desktop automation harness. If none exists, document the gap before adding tooling. |75| Monorepo | Place tests beside the app or in the established cross-app E2E package. |7677## Validation7879Run the narrowest focused command first. Examples:8081```bash82npx playwright test path/to/spec83npx cypress run --spec path/to/spec84npm run e2e -- path/to/spec85pnpm e2e path/to/spec86yarn e2e path/to/spec87./gradlew connectedAndroidTest88xcodebuild test -scheme <scheme> -destination <destination>89maestro test path/to/flow.yaml90```9192Use the command the project already documents. For new or meaningfully changed browser/mobile specs, repeat the focused test when practical to catch obvious flakes.9394Run broader E2E or CI-equivalent checks only when touched helpers, fixtures, setup code, or shared flows make the focused run insufficient.9596## Failure Handling9798- **Spec exposes a product bug:** fix the product if in scope, then rerun the focused spec.99- **Spec is flaky:** tighten selectors, setup, waits, data isolation, or assertions. If this becomes broad suite repair, stop and report that the task has changed.100- **Missing fixture/auth/device support:** add the narrowest reusable support if safe; otherwise document the blocker.101- **No approved E2E framework:** ask before introducing one.102- **Environment unavailable:** record exact command, error, and unverified risk in the PR/testing notes.103104## Artifacts105106Success produces one of:107108- A new or updated E2E spec/flow.109- A new or updated integration or contract test when that is the right regression layer.110- A narrow fixture/helper update required by that spec.111- A documented E2E coverage exception with the alternate coverage used.112113Report the exact files changed, command run, pass/fail result, and remaining risk.114115## Source116117Generic starter from Supatest AI supa-skills `automate-e2e-tests` v1.0.1. Run `setup-task-to-pr` in each project to create a local enriched version.118119## Self-Improvement120121If this skill chooses the wrong regression layer, misses a project test framework, or creates brittle tests, patch this skill or the configured project-local version before closing.