# Write E2e Cases

> Use when adding or updating Rsbuild end-to-end tests in `e2e/cases`, including new feature coverage, bug reproduction, and regression prevention.

- Skill: `tomevault-io/write-e2e-cases` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/write-e2e-cases`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/write-e2e-cases/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/write-e2e-cases

---


# Write E2E Cases

## Steps

1. Review uncommitted git changes to define test scope and target behavior.

2. Read `e2e/README.md` and follow its conventions.

3. Prefer `@e2e/helper` methods (for example `dev`, `build`) to keep tests minimal.

4. Add Playwright cases under `e2e/cases`, following existing directory patterns.

5. Keep assertions focused and readable; avoid redundant setup and checks.

6. Run `pnpm e2e` to validate.

## Case Structure

- Include a `src` directory in every case (required).
- Add `rsbuild.config.ts` only when needed.
- Split into multiple case directories when cases need different `src` code or different Rsbuild configs.

## Constraints

- If tests can pass only after source-code changes, do not change source code directly. Explain the required source change and ask the user before proceeding.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/web-infra-dev) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

