From 5e4faeece34b3ccb9c99a20d0f6de5a63cb03e98 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 10 Feb 2026 17:40:10 +0800 Subject: [PATCH] docs: add write-e2e-cases skill --- .agents/skills/write-e2e-cases/SKILL.md | 30 +++++++++++++++++++++++++ e2e/README.md | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 .agents/skills/write-e2e-cases/SKILL.md diff --git a/.agents/skills/write-e2e-cases/SKILL.md b/.agents/skills/write-e2e-cases/SKILL.md new file mode 100644 index 0000000000..2abff8df32 --- /dev/null +++ b/.agents/skills/write-e2e-cases/SKILL.md @@ -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. diff --git a/e2e/README.md b/e2e/README.md index ada54244b3..11387f27cd 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -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.