Skip to content

Commit 7498e6a

Browse files
authored
chore: generate loop-specific prompts (#37911)
1 parent 94037eb commit 7498e6a

File tree

55 files changed

+1406
-1563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1406
-1563
lines changed
File renamed without changes.
File renamed without changes.

examples/todomvc/.claude/agents/playwright-test-planner.md renamed to examples/todomvc/.claude/agents/playwright-test-planner.agent.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ You will:
4545
- Executive summary of the tested page/application
4646
- Individual scenarios as separate sections
4747
- Each scenario formatted with numbered steps
48+
- Each test case with proposed file name for implementation
4849
- Clear expected results for verification
4950

5051
<example-spec>
@@ -69,6 +70,9 @@ application features:
6970
**Seed:** `tests/seed.spec.ts`
7071

7172
#### 1.1 Add Valid Todo
73+
74+
**File** `tests/adding-new-todos/add-valid-todo.spec.ts`
75+
7276
**Steps:**
7377
1. Click in the "What needs to be done?" input field
7478
2. Type "Buy groceries"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
mode: default
3+
description: Produce test coverage
4+
---
5+
6+
Parameters:
7+
- Task: the task to perform
8+
- Seed file (optional): the seed file to use, defaults to `tests/seed.spec.ts`
9+
- Test plan file (optional): the test plan file to write, under `specs/` folder.
10+
11+
1. Call #playwright-test-planner subagent with prompt:
12+
13+
<plan>
14+
<task-text><!-- the task --></task-text>
15+
<seed-file><!-- path to seed file --></seed-file>
16+
<plan-file><!-- path to test plan file to generate --></plan-file>
17+
</plan>
18+
19+
2. For each test case from the test plan file (1.1, 1.2, ...), one after another, not in parallel, call #playwright-test-generator subagent with prompt:
20+
21+
<generate>
22+
<test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite>
23+
<test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name>
24+
<test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
25+
<seed-file><!-- Seed file path from test plan --></seed-file>
26+
<body><!-- Test case content including steps and expectations --></body>
27+
</generate>
28+
29+
3. Call #playwright-test-healer subagent with prompt:
30+
31+
<heal>Run all tests and fix the failing ones one after another.</heal>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
mode: playwright-test-generator
3+
description: Generate test plan
4+
---
5+
6+
Generate tests for the test plan's bullet 1.1 Add item to card.
7+
8+
Test plan: `specs/coverage.plan.md`
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
mode: playwright-test-healer
3+
description: Fix tests
4+
---
5+
6+
Run all my tests and fix the failing ones.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
mode: playwright-test-planner
3+
description: Create test plan
4+
---
5+
6+
Create test plan for "add to cart" functionality of my app.
7+
8+
- Seed file: `tests/seed.spec.ts`
9+
- Test plan: `specs/coverage.plan.md`

examples/todomvc/.github/chatmodes/ 🎭 planner.chatmode.md renamed to examples/todomvc/.github/chatmodes/🎭 planner.chatmode.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ You will:
4242
- Executive summary of the tested page/application
4343
- Individual scenarios as separate sections
4444
- Each scenario formatted with numbered steps
45+
- Each test case with proposed file name for implementation
4546
- Clear expected results for verification
4647

4748
<example-spec>
@@ -66,6 +67,9 @@ application features:
6667
**Seed:** `tests/seed.spec.ts`
6768

6869
#### 1.1 Add Valid Todo
70+
71+
**File** `tests/adding-new-todos/add-valid-todo.spec.ts`
72+
6973
**Steps:**
7074
1. Click in the "What needs to be done?" input field
7175
2. Type "Buy groceries"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
mode: agent
3+
description: Produce test coverage
4+
---
5+
6+
Parameters:
7+
- Task: the task to perform
8+
- Seed file (optional): the seed file to use, defaults to `tests/seed.spec.ts`
9+
- Test plan file (optional): the test plan file to write, under `specs/` folder.
10+
11+
1. Call #🎭 planner subagent with prompt:
12+
13+
<plan>
14+
<task-text><!-- the task --></task-text>
15+
<seed-file><!-- path to seed file --></seed-file>
16+
<plan-file><!-- path to test plan file to generate --></plan-file>
17+
</plan>
18+
19+
2. For each test case from the test plan file (1.1, 1.2, ...), one after another, not in parallel, call #🎭 generator subagent with prompt:
20+
21+
<generate>
22+
<test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite>
23+
<test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name>
24+
<test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
25+
<seed-file><!-- Seed file path from test plan --></seed-file>
26+
<body><!-- Test case content including steps and expectations --></body>
27+
</generate>
28+
29+
3. Call #🎭 healer subagent with prompt:
30+
31+
<heal>Run all tests and fix the failing ones one after another.</heal>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
mode: 🎭 generator
3+
description: Generate test plan
4+
---
5+
6+
Generate tests for the test plan's bullet 1.1 Add item to card.
7+
8+
Test plan: `specs/coverage.plan.md`

0 commit comments

Comments
 (0)