Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .agents/skills/write-e2e-cases/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
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`) 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.
2 changes: 2 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ test('test 1 + 1', () => {
expect(1 + 1).toBe(2);
});
```

You can use the local skill at [`write-e2e-cases`](../.agents/skills/write-e2e-cases/SKILL.md) to add new test cases.
Loading