write-e2e-cases

star 3.3k

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

web-infra-dev By web-infra-dev schedule Updated 5/22/2026

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

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, getDistFiles, findFile, getFileContent, expectFile, and expectFileWithContent) to keep tests minimal, including file and file-content assertions.

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

  5. Use short, direct, and stable assertions. Avoid redundant setup and checks.

  6. Run pnpm e2e to validate.

Case Structure

  • Include a src directory in every case (required).
  • Prefer putting static Rsbuild configurations in rsbuild.config.ts to enable easier debugging via npx rsbuild.
  • Use inline config for dynamic values or minor per-test variations.
  • 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.
Install via CLI
npx skills add https://github.com/web-infra-dev/rsbuild --skill write-e2e-cases
Repository Details
star Stars 3,324
call_split Forks 268
navigation Branch main
article Path SKILL.md
Occupations
More from Creator
web-infra-dev
web-infra-dev Explore all skills →