@athenaflow/plugin-e2e-test-builder 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/dist/{2.0.8 → 2.0.10}/.agents/plugins/marketplace.json +1 -1
- package/dist/{2.0.9 → 2.0.10}/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/{2.0.9 → 2.0.10}/claude/plugin/package.json +8 -2
- package/dist/{2.0.9 → 2.0.10}/claude/plugin/skills/add-e2e-tests/SKILL.md +18 -65
- package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/add-e2e-tests/agents/openai.yaml +1 -1
- package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/add-e2e-tests/references/error-recovery.md +3 -3
- package/dist/{2.0.8/codex → 2.0.10/claude}/plugin/skills/add-e2e-tests/references/scaffolding.md +1 -1
- package/dist/{2.0.9 → 2.0.10}/claude/plugin/skills/fix-flaky-tests/SKILL.md +1 -1
- package/dist/{2.0.8/codex → 2.0.10/claude}/plugin/skills/fix-flaky-tests/references/fix-patterns.md +3 -2
- package/dist/{2.0.9 → 2.0.10}/claude/plugin/skills/generate-test-cases/SKILL.md +8 -2
- package/dist/{2.0.9 → 2.0.10}/claude/plugin/skills/plan-test-coverage/SKILL.md +7 -6
- package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/review-test-cases/SKILL.md +3 -4
- package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/SKILL.md +4 -3
- package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/references/api-setup-teardown.md +1 -1
- package/dist/{2.0.9 → 2.0.10}/codex/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/{2.0.9 → 2.0.10}/codex/plugin/package.json +8 -2
- package/dist/{2.0.9 → 2.0.10}/codex/plugin/skills/add-e2e-tests/SKILL.md +18 -65
- package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/add-e2e-tests/agents/openai.yaml +1 -1
- package/dist/{2.0.9/claude → 2.0.10/codex}/plugin/skills/add-e2e-tests/references/error-recovery.md +3 -3
- package/dist/{2.0.9/claude → 2.0.10/codex}/plugin/skills/add-e2e-tests/references/scaffolding.md +1 -1
- package/dist/{2.0.8/claude → 2.0.10/codex}/plugin/skills/fix-flaky-tests/SKILL.md +1 -1
- package/dist/{2.0.9/claude → 2.0.10/codex}/plugin/skills/fix-flaky-tests/references/fix-patterns.md +3 -2
- package/dist/{2.0.9 → 2.0.10}/codex/plugin/skills/generate-test-cases/SKILL.md +8 -2
- package/dist/{2.0.9 → 2.0.10}/codex/plugin/skills/plan-test-coverage/SKILL.md +7 -6
- package/dist/{2.0.9/claude → 2.0.10/codex}/plugin/skills/review-test-cases/SKILL.md +3 -4
- package/dist/{2.0.9/claude → 2.0.10/codex}/plugin/skills/write-test-code/SKILL.md +4 -3
- package/dist/{2.0.9/claude → 2.0.10/codex}/plugin/skills/write-test-code/references/api-setup-teardown.md +1 -1
- package/dist/{2.0.9 → 2.0.10}/release.json +1 -1
- package/package.json +7 -1
- package/skills/add-e2e-tests/SKILL.md +18 -65
- package/skills/add-e2e-tests/agents/openai.yaml +1 -1
- package/skills/add-e2e-tests/references/error-recovery.md +3 -3
- package/skills/add-e2e-tests/references/scaffolding.md +1 -1
- package/skills/fix-flaky-tests/SKILL.md +1 -1
- package/skills/fix-flaky-tests/references/fix-patterns.md +3 -2
- package/skills/generate-test-cases/SKILL.md +8 -2
- package/skills/plan-test-coverage/SKILL.md +7 -6
- package/skills/review-test-cases/SKILL.md +3 -4
- package/skills/write-test-code/SKILL.md +4 -3
- package/skills/write-test-code/references/api-setup-teardown.md +1 -1
- package/dist/2.0.8/claude/plugin/.claude-plugin/plugin.json +0 -20
- package/dist/2.0.8/claude/plugin/package.json +0 -9
- package/dist/2.0.8/claude/plugin/skills/add-e2e-tests/SKILL.md +0 -217
- package/dist/2.0.8/claude/plugin/skills/add-e2e-tests/agents/claude.yaml +0 -1
- package/dist/2.0.8/claude/plugin/skills/add-e2e-tests/references/scaffolding.md +0 -12
- package/dist/2.0.8/claude/plugin/skills/add-e2e-tests/references/tracker-template.md +0 -53
- package/dist/2.0.8/claude/plugin/skills/fix-flaky-tests/references/fix-patterns.md +0 -91
- package/dist/2.0.8/claude/plugin/skills/generate-test-cases/SKILL.md +0 -184
- package/dist/2.0.8/claude/plugin/skills/plan-test-coverage/SKILL.md +0 -116
- package/dist/2.0.8/codex/plugin/.codex-plugin/plugin.json +0 -15
- package/dist/2.0.8/codex/plugin/package.json +0 -9
- package/dist/2.0.8/codex/plugin/skills/add-e2e-tests/SKILL.md +0 -217
- package/dist/2.0.8/codex/plugin/skills/add-e2e-tests/agents/claude.yaml +0 -1
- package/dist/2.0.8/codex/plugin/skills/add-e2e-tests/references/error-recovery.md +0 -43
- package/dist/2.0.8/codex/plugin/skills/add-e2e-tests/references/tracker-template.md +0 -53
- package/dist/2.0.8/codex/plugin/skills/fix-flaky-tests/SKILL.md +0 -160
- package/dist/2.0.8/codex/plugin/skills/generate-test-cases/SKILL.md +0 -184
- package/dist/2.0.8/codex/plugin/skills/plan-test-coverage/SKILL.md +0 -116
- package/dist/2.0.8/codex/plugin/skills/review-test-cases/SKILL.md +0 -147
- package/dist/2.0.8/codex/plugin/skills/write-test-code/SKILL.md +0 -227
- package/dist/2.0.8/codex/plugin/skills/write-test-code/references/api-setup-teardown.md +0 -83
- package/dist/2.0.8/release.json +0 -18
- package/dist/2.0.9/.agents/plugins/marketplace.json +0 -14
- package/dist/2.0.9/claude/plugin/skills/add-e2e-tests/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/add-e2e-tests/references/authentication.md +0 -8
- package/dist/2.0.9/claude/plugin/skills/add-e2e-tests/references/tracker-template.md +0 -53
- package/dist/2.0.9/claude/plugin/skills/analyze-test-codebase/SKILL.md +0 -142
- package/dist/2.0.9/claude/plugin/skills/analyze-test-codebase/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/analyze-test-codebase/agents/openai.yaml +0 -4
- package/dist/2.0.9/claude/plugin/skills/fix-flaky-tests/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/fix-flaky-tests/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/generate-test-cases/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/generate-test-cases/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/generate-test-cases/references/scenario-categories.md +0 -36
- package/dist/2.0.9/claude/plugin/skills/plan-test-coverage/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/plan-test-coverage/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/review-test-cases/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/review-test-cases/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/review-test-code/SKILL.md +0 -189
- package/dist/2.0.9/claude/plugin/skills/review-test-code/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/review-test-code/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/write-test-code/agents/claude.yaml +0 -3
- package/dist/2.0.9/claude/plugin/skills/write-test-code/agents/openai.yaml +0 -10
- package/dist/2.0.9/claude/plugin/skills/write-test-code/references/anti-patterns.md +0 -88
- package/dist/2.0.9/claude/plugin/skills/write-test-code/references/auth-patterns.md +0 -63
- package/dist/2.0.9/claude/plugin/skills/write-test-code/references/mapping-tables.md +0 -56
- package/dist/2.0.9/claude/plugin/skills/write-test-code/references/network-interception.md +0 -56
- package/dist/2.0.9/codex/plugin/skills/add-e2e-tests/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/add-e2e-tests/references/authentication.md +0 -8
- package/dist/2.0.9/codex/plugin/skills/add-e2e-tests/references/error-recovery.md +0 -43
- package/dist/2.0.9/codex/plugin/skills/add-e2e-tests/references/scaffolding.md +0 -12
- package/dist/2.0.9/codex/plugin/skills/add-e2e-tests/references/tracker-template.md +0 -53
- package/dist/2.0.9/codex/plugin/skills/analyze-test-codebase/SKILL.md +0 -142
- package/dist/2.0.9/codex/plugin/skills/analyze-test-codebase/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/analyze-test-codebase/agents/openai.yaml +0 -4
- package/dist/2.0.9/codex/plugin/skills/fix-flaky-tests/SKILL.md +0 -160
- package/dist/2.0.9/codex/plugin/skills/fix-flaky-tests/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/fix-flaky-tests/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/fix-flaky-tests/references/fix-patterns.md +0 -91
- package/dist/2.0.9/codex/plugin/skills/generate-test-cases/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/generate-test-cases/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/generate-test-cases/references/scenario-categories.md +0 -36
- package/dist/2.0.9/codex/plugin/skills/plan-test-coverage/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/plan-test-coverage/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/review-test-cases/SKILL.md +0 -147
- package/dist/2.0.9/codex/plugin/skills/review-test-cases/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/review-test-cases/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/review-test-code/SKILL.md +0 -189
- package/dist/2.0.9/codex/plugin/skills/review-test-code/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/review-test-code/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/write-test-code/SKILL.md +0 -227
- package/dist/2.0.9/codex/plugin/skills/write-test-code/agents/claude.yaml +0 -3
- package/dist/2.0.9/codex/plugin/skills/write-test-code/agents/openai.yaml +0 -10
- package/dist/2.0.9/codex/plugin/skills/write-test-code/references/anti-patterns.md +0 -88
- package/dist/2.0.9/codex/plugin/skills/write-test-code/references/api-setup-teardown.md +0 -83
- package/dist/2.0.9/codex/plugin/skills/write-test-code/references/auth-patterns.md +0 -63
- package/dist/2.0.9/codex/plugin/skills/write-test-code/references/mapping-tables.md +0 -56
- package/dist/2.0.9/codex/plugin/skills/write-test-code/references/network-interception.md +0 -56
- package/skills/add-e2e-tests/references/tracker-template.md +0 -53
- /package/dist/{2.0.9 → 2.0.10}/claude/plugin/skills/add-e2e-tests/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/add-e2e-tests/references/authentication.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/analyze-test-codebase/SKILL.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/analyze-test-codebase/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/analyze-test-codebase/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/fix-flaky-tests/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/fix-flaky-tests/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/generate-test-cases/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/generate-test-cases/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/generate-test-cases/references/scenario-categories.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/plan-test-coverage/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/plan-test-coverage/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/review-test-cases/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/review-test-cases/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/review-test-code/SKILL.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/review-test-code/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/review-test-code/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/references/anti-patterns.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/references/auth-patterns.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/references/mapping-tables.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/claude/plugin/skills/write-test-code/references/network-interception.md +0 -0
- /package/dist/{2.0.9 → 2.0.10}/codex/plugin/skills/add-e2e-tests/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/add-e2e-tests/references/authentication.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/analyze-test-codebase/SKILL.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/analyze-test-codebase/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/analyze-test-codebase/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/fix-flaky-tests/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/fix-flaky-tests/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/generate-test-cases/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/generate-test-cases/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/generate-test-cases/references/scenario-categories.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/plan-test-coverage/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/plan-test-coverage/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/review-test-cases/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/review-test-cases/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/review-test-code/SKILL.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/review-test-code/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/review-test-code/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/write-test-code/agents/claude.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/write-test-code/agents/openai.yaml +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/write-test-code/references/anti-patterns.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/write-test-code/references/auth-patterns.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/write-test-code/references/mapping-tables.md +0 -0
- /package/dist/{2.0.8 → 2.0.10}/codex/plugin/skills/write-test-code/references/network-interception.md +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# API-Driven Test Setup and Teardown
|
|
2
|
-
|
|
3
|
-
## API-Driven Test Setup
|
|
4
|
-
|
|
5
|
-
Use API calls to set up test data instead of clicking through UI. This is 10-50x faster and more reliable.
|
|
6
|
-
|
|
7
|
-
**When to use API setup:** Creating test users, products, orders, seed data. Setting feature flags. Resetting state between tests.
|
|
8
|
-
|
|
9
|
-
**When to use UI setup:** Only when the creation flow IS the test being verified.
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
test('TC-CART-001: User sees items in cart', async ({ page, request }) => {
|
|
13
|
-
// Arrange: seed data via API (fast, deterministic)
|
|
14
|
-
await request.post('/api/cart/items', {
|
|
15
|
-
data: { productId: 'SKU-123', quantity: 2 }
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// Act: navigate to verify UI
|
|
19
|
-
await page.goto('/cart');
|
|
20
|
-
|
|
21
|
-
// Assert
|
|
22
|
-
await expect(page.getByRole('listitem')).toHaveCount(2);
|
|
23
|
-
});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Reusable API fixture pattern:**
|
|
27
|
-
```typescript
|
|
28
|
-
export const test = base.extend<{ apiClient: APIRequestContext }>({
|
|
29
|
-
apiClient: async ({ playwright }, use) => {
|
|
30
|
-
const ctx = await playwright.request.newContext({
|
|
31
|
-
baseURL: process.env.API_BASE_URL,
|
|
32
|
-
extraHTTPHeaders: { Authorization: `Bearer ${process.env.API_TOKEN}` },
|
|
33
|
-
});
|
|
34
|
-
await use(ctx);
|
|
35
|
-
await ctx.dispose();
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Test Data Teardown
|
|
41
|
-
|
|
42
|
-
Tests that create persistent data (database records, uploaded files, user accounts) MUST clean up after themselves. Leaked test data accumulates across runs and causes false positives/negatives in other tests (pagination counts drift, filter results change, list assertions break).
|
|
43
|
-
|
|
44
|
-
### Strategy 1: API teardown in afterEach (Recommended)
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
let createdTicketId: string;
|
|
48
|
-
|
|
49
|
-
test.beforeEach(async ({ request }) => {
|
|
50
|
-
const resp = await request.post('/api/tickets', {
|
|
51
|
-
data: { title: `Test ${Date.now()}` }
|
|
52
|
-
});
|
|
53
|
-
createdTicketId = (await resp.json()).id;
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test.afterEach(async ({ request }) => {
|
|
57
|
-
if (createdTicketId) {
|
|
58
|
-
await request.delete(`/api/tickets/${createdTicketId}`);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Strategy 2: Fixture with automatic cleanup
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
export const test = base.extend<{ testTicket: { id: string; title: string } }>({
|
|
67
|
-
testTicket: async ({ request }, use) => {
|
|
68
|
-
const resp = await request.post('/api/tickets', {
|
|
69
|
-
data: { title: `Test ${Date.now()}` }
|
|
70
|
-
});
|
|
71
|
-
const ticket = await resp.json();
|
|
72
|
-
await use(ticket);
|
|
73
|
-
// cleanup runs automatically when test finishes
|
|
74
|
-
await request.delete(`/api/tickets/${ticket.id}`);
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Strategy 3: Bulk cleanup in globalTeardown
|
|
80
|
-
|
|
81
|
-
For environments where individual deletion is impractical, tag test data (e.g., `title LIKE 'Test %'`) and delete in batch during `globalTeardown.ts`.
|
|
82
|
-
|
|
83
|
-
If the cleanup API endpoint is unknown, do not invent one. Leave a clear `TODO` with the missing endpoint details, document the cleanup gap in the test file or tracker, and prefer fixture-scoped or environment reset strategies that you can verify. If cleanup is genuinely impossible (no API, no database access), document this as a known limitation in the test file header AND add an `afterEach` that logs a warning.
|
package/dist/2.0.8/release.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": 1,
|
|
3
|
-
"pluginRef": "e2e-test-builder@athena-workflow-marketplace",
|
|
4
|
-
"pluginName": "e2e-test-builder",
|
|
5
|
-
"marketplaceName": "athena-workflow-marketplace",
|
|
6
|
-
"version": "2.0.8",
|
|
7
|
-
"artifacts": {
|
|
8
|
-
"claude": {
|
|
9
|
-
"type": "directory",
|
|
10
|
-
"path": "./claude/plugin"
|
|
11
|
-
},
|
|
12
|
-
"codex": {
|
|
13
|
-
"type": "marketplace",
|
|
14
|
-
"marketplacePath": "./.agents/plugins/marketplace.json",
|
|
15
|
-
"pluginPath": "./codex/plugin"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Run Full E2E Workflow"
|
|
3
|
-
short_description: "Orchestrate browser-led E2E work from exploration to verified tests"
|
|
4
|
-
default_prompt: "Run the full E2E workflow for this feature: maintain a concise progress tracker, explore the live product first, then plan, spec, review, implement, and verify the Playwright tests."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "agent-web-interface"
|
|
10
|
-
description: "Browser automation MCP used to explore the site and verify flows"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Authentication Handling for E2E Tests
|
|
2
|
-
|
|
3
|
-
If the target feature requires login or any form of authentication:
|
|
4
|
-
|
|
5
|
-
1. **Check existing infrastructure** — look for existing test fixtures, environment variables, or auth setup files that already handle authentication. Load the `analyze-test-codebase` skill to find auth patterns.
|
|
6
|
-
2. **Ask the user if no auth setup exists** — request credentials or an auth strategy (stored auth state, API tokens, test accounts). Do not proceed with tests that require login until auth is resolved.
|
|
7
|
-
3. **Never hardcode credentials** — use environment variables, Playwright's `storageState`, or the project's existing auth fixture pattern.
|
|
8
|
-
4. **Handle mid-session auth discovery** — if you discover auth is needed mid-session (e.g., a page redirects to login), ask the user immediately and add auth setup as a prerequisite task.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Tracker Template: e2e-tracker.md
|
|
2
|
-
|
|
3
|
-
Use this as a starting template when creating the tracker file. Adapt sections as needed.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
```markdown
|
|
8
|
-
# E2E Test Tracker
|
|
9
|
-
|
|
10
|
-
## Goal
|
|
11
|
-
|
|
12
|
-
- **URL:** https://myapp.com/checkout
|
|
13
|
-
- **Feature:** Checkout flow with cart, shipping, and payment
|
|
14
|
-
- **Slug:** checkout
|
|
15
|
-
|
|
16
|
-
## Progress
|
|
17
|
-
|
|
18
|
-
### Session 1 — 2026-04-01
|
|
19
|
-
|
|
20
|
-
- Analyzed codebase: Playwright 1.42, TypeScript, existing auth fixture in `tests/fixtures/auth.ts`
|
|
21
|
-
- Browsed checkout flow: 4-step wizard (cart review, shipping, payment, confirmation)
|
|
22
|
-
- Discovered 3 form validation states per step
|
|
23
|
-
- Generated test spec: `test-cases/checkout.md` with TC-CHECKOUT-001 through TC-CHECKOUT-012
|
|
24
|
-
- Review gate passed with warnings (TC-CHECKOUT-008 needs clarification on coupon edge case)
|
|
25
|
-
|
|
26
|
-
### Session 2 — 2026-04-02
|
|
27
|
-
|
|
28
|
-
- Wrote `tests/checkout.spec.ts` covering TC-CHECKOUT-001 through TC-CHECKOUT-012
|
|
29
|
-
- Code review gate passed
|
|
30
|
-
- Ran tests: 10/12 passing, 2 failing (TC-CHECKOUT-006: selector stale, TC-CHECKOUT-011: timeout)
|
|
31
|
-
- Fixed TC-CHECKOUT-006: updated selector from `.price` to `[data-testid="cart-total"]`
|
|
32
|
-
- Fixed TC-CHECKOUT-011: added `waitForResponse` before assertion
|
|
33
|
-
|
|
34
|
-
## Remaining
|
|
35
|
-
|
|
36
|
-
- Re-run full suite to confirm fixes
|
|
37
|
-
- Verify TC-ID coverage: all 12 specs should map to test code
|
|
38
|
-
|
|
39
|
-
## Next Steps
|
|
40
|
-
|
|
41
|
-
- Run `npx playwright test tests/checkout.spec.ts --reporter=list` and record output
|
|
42
|
-
- If all green, mark complete
|
|
43
|
-
- If failures remain, diagnose with `fix-flaky-tests` skill
|
|
44
|
-
|
|
45
|
-
<!-- E2E_COMPLETE -->
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
**Terminal markers** (write as the last line of the tracker when appropriate):
|
|
51
|
-
|
|
52
|
-
- `<!-- E2E_COMPLETE -->` — all tests pass, all TC-IDs covered, work is done
|
|
53
|
-
- `<!-- E2E_BLOCKED: reason -->` — unrecoverable blocker prevents further progress (e.g., `<!-- E2E_BLOCKED: login requires 2FA token we cannot automate -->`)
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: analyze-test-codebase
|
|
3
|
-
description: >
|
|
4
|
-
Scans and reports on an existing Playwright test codebase. This skill should be used to inspect
|
|
5
|
-
the current Playwright setup before writing, reviewing, or fixing tests, and should be loaded
|
|
6
|
-
early when working in a new project to understand existing patterns. Covers: Playwright config,
|
|
7
|
-
page objects, fixtures, helpers, auth/globalSetup patterns, test conventions, and directory
|
|
8
|
-
structure. Triggers: "understand", "check", "show me", "inspect", or "analyze"
|
|
9
|
-
the current test setup, config, infrastructure, patterns, or conventions. In the full add-tests
|
|
10
|
-
workflow, this skill serves as an early read-only analysis sub-step before planning detailed
|
|
11
|
-
coverage or writing code. This skill examines existing files and outputs a structured report.
|
|
12
|
-
It does NOT write or fix tests, install Playwright, or explore live websites — for live site
|
|
13
|
-
exploration, use agent-web-interface-guide instead.
|
|
14
|
-
allowed-tools: Read Glob Grep Bash
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# Analyze Test Codebase
|
|
18
|
-
|
|
19
|
-
Scan and analyze an existing Playwright test codebase to understand its conventions, configuration, and patterns before writing new tests.
|
|
20
|
-
|
|
21
|
-
## Workflow
|
|
22
|
-
|
|
23
|
-
1. **Locate Playwright configuration** — search for `playwright.config.ts`, `playwright.config.js`, or `playwright.config.mjs` in the project root and common subdirectories.
|
|
24
|
-
|
|
25
|
-
2. **Extract configuration details**:
|
|
26
|
-
- `baseURL` — the target application URL
|
|
27
|
-
- `testDir` — where tests live
|
|
28
|
-
- `projects` — browser/device configurations
|
|
29
|
-
- `use` — default options (viewport, headless, trace, screenshot)
|
|
30
|
-
- `webServer` — if Playwright starts the app
|
|
31
|
-
- `globalSetup` / `globalTeardown` — auth or data seeding scripts
|
|
32
|
-
- `reporter` — configured reporters
|
|
33
|
-
|
|
34
|
-
3. **Scan test directory structure**:
|
|
35
|
-
```
|
|
36
|
-
Glob for **/*.spec.ts, **/*.test.ts, **/*.spec.js, **/*.test.js
|
|
37
|
-
```
|
|
38
|
-
- Count total test files
|
|
39
|
-
- Identify naming conventions (`.spec.ts` vs `.test.ts`)
|
|
40
|
-
- Map directory organization (by feature? by page? flat?)
|
|
41
|
-
|
|
42
|
-
4. **Detect patterns in existing tests** — read 2-3 representative test files and identify:
|
|
43
|
-
- **Locator strategy**: `getByRole`, `getByTestId`, CSS selectors, XPath
|
|
44
|
-
- **Wait strategy**: auto-waits, explicit `waitFor*`, any `waitForTimeout` (flag these)
|
|
45
|
-
- **Test structure**: AAA pattern, describe/test nesting, use of `test.step`
|
|
46
|
-
- **Data management**: fixtures, test data files, factory functions
|
|
47
|
-
- **Page Objects**: POM pattern usage, fixture-based injection
|
|
48
|
-
- **Auth handling**: `storageState`, global setup, per-test login
|
|
49
|
-
- **Custom fixtures**: extended `test` with custom fixtures
|
|
50
|
-
- **Helper utilities**: shared functions, custom assertions
|
|
51
|
-
- **Network mocking**: `page.route()` usage, HAR recording (`routeFromHAR`), API interceptors
|
|
52
|
-
- **Visual regression**: `toHaveScreenshot()`, `toMatchSnapshot()`, snapshot directories
|
|
53
|
-
- **Accessibility testing**: `@axe-core/playwright` usage, custom a11y assertions
|
|
54
|
-
- **Cross-browser config**: multiple projects in playwright.config (chromium, firefox, webkit)
|
|
55
|
-
- **Retry configuration**: `retries` count, trace settings (`on-first-retry`)
|
|
56
|
-
- **Parallelism**: `fullyParallel`, `workers` count, test isolation strategy
|
|
57
|
-
|
|
58
|
-
5. **Check for supporting infrastructure**:
|
|
59
|
-
- `fixtures/` or `helpers/` directories
|
|
60
|
-
- `pages/` or `pom/` (Page Object Model)
|
|
61
|
-
- `.env` or `.env.test` files (test-specific environment configuration)
|
|
62
|
-
- CI configuration (`.github/workflows/`, `Jenkinsfile`, etc.)
|
|
63
|
-
- `package.json` scripts for running tests
|
|
64
|
-
- `*.har` files or HAR directories (recorded API responses for mocking)
|
|
65
|
-
- Snapshot directories (`__snapshots__`, `screenshots/`) for visual regression baselines
|
|
66
|
-
- Docker or `docker-compose` for test environment setup
|
|
67
|
-
- Global setup/teardown scripts — what they do (auth, seeding, cleanup)
|
|
68
|
-
|
|
69
|
-
6. **Generate report** — output a structured summary:
|
|
70
|
-
|
|
71
|
-
```markdown
|
|
72
|
-
## Test Codebase Analysis
|
|
73
|
-
|
|
74
|
-
### Framework
|
|
75
|
-
- **Playwright** version X.Y.Z
|
|
76
|
-
- Config: `playwright.config.ts`
|
|
77
|
-
- Test directory: `tests/`
|
|
78
|
-
|
|
79
|
-
### Conventions
|
|
80
|
-
- File naming: `*.spec.ts`
|
|
81
|
-
- Locator preference: getByRole > getByTestId
|
|
82
|
-
- Structure: describe blocks by feature
|
|
83
|
-
- Page Objects: Yes, in `tests/pages/`
|
|
84
|
-
- Custom fixtures: Yes, in `tests/fixtures/`
|
|
85
|
-
|
|
86
|
-
### Auth
|
|
87
|
-
- Method: storageState via global setup
|
|
88
|
-
- Auth file: `tests/.auth/user.json`
|
|
89
|
-
|
|
90
|
-
### Existing Coverage
|
|
91
|
-
- Total test files: N
|
|
92
|
-
- Feature areas covered: [list]
|
|
93
|
-
- Test count: ~N tests
|
|
94
|
-
|
|
95
|
-
### Network Mocking
|
|
96
|
-
- Method: page.route() / HAR / none
|
|
97
|
-
- Patterns: [list any existing mocking patterns]
|
|
98
|
-
|
|
99
|
-
### Visual Testing
|
|
100
|
-
- Enabled: Yes/No
|
|
101
|
-
- Tool: toHaveScreenshot() / third-party / none
|
|
102
|
-
- Baseline directory: [path if exists]
|
|
103
|
-
|
|
104
|
-
### Accessibility Testing
|
|
105
|
-
- Enabled: Yes/No
|
|
106
|
-
- Tool: @axe-core/playwright / custom assertions / none
|
|
107
|
-
|
|
108
|
-
### Cross-Browser & CI
|
|
109
|
-
- Browser projects: [list from config]
|
|
110
|
-
- Retries: N (CI) / N (local)
|
|
111
|
-
- Workers: N / fullyParallel: Yes/No
|
|
112
|
-
- CI platform: GitHub Actions / Jenkins / none detected
|
|
113
|
-
- Trace: [setting from config]
|
|
114
|
-
|
|
115
|
-
### Recommendations for New Tests
|
|
116
|
-
- Follow existing `*.spec.ts` naming
|
|
117
|
-
- Use page objects from `tests/pages/`
|
|
118
|
-
- Import test data from `tests/fixtures/testData.ts`
|
|
119
|
-
- Use `baseURL` for navigation (relative paths)
|
|
120
|
-
- Auth: reuse existing storageState setup
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Out of Scope
|
|
124
|
-
|
|
125
|
-
This skill only reads and reports on the codebase. For related tasks, use the appropriate skill:
|
|
126
|
-
|
|
127
|
-
| Task | Skill |
|
|
128
|
-
|------|-------|
|
|
129
|
-
| Browsing a live site, interacting with UI elements | `agent-web-interface-guide` |
|
|
130
|
-
| Deciding what to test, coverage gaps, priorities | `plan-test-coverage` |
|
|
131
|
-
| Writing or modifying executable test code | `write-test-code` |
|
|
132
|
-
| Diagnosing flaky or failing tests | `fix-flaky-tests` |
|
|
133
|
-
|
|
134
|
-
## Example Usage
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
Claude Code: /analyze-test-codebase
|
|
138
|
-
Codex: $analyze-test-codebase
|
|
139
|
-
|
|
140
|
-
Claude Code: /analyze-test-codebase ./my-app
|
|
141
|
-
Codex: $analyze-test-codebase ./my-app
|
|
142
|
-
```
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Analyze Existing Test Setup"
|
|
3
|
-
short_description: "Inspect Playwright conventions before planning or writing tests"
|
|
4
|
-
default_prompt: "Analyze this Playwright codebase and summarize the current setup as an early workflow step before planning detailed coverage or writing test code."
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Fix Flaky Playwright Tests"
|
|
3
|
-
short_description: "Diagnose unstable Playwright tests and fix the root cause"
|
|
4
|
-
default_prompt: "Diagnose this flaky Playwright test, reproduce the failure, and fix the root cause."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "agent-web-interface"
|
|
10
|
-
description: "Browser automation MCP used to reproduce and inspect unstable flows"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Write TC-ID Specs"
|
|
3
|
-
short_description: "Explore the feature and write detailed TC-ID test case specs"
|
|
4
|
-
default_prompt: "Explore this feature and generate detailed TC-ID test case specifications."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "agent-web-interface"
|
|
10
|
-
description: "Browser automation MCP used to inspect the live flow before writing specs"
|
package/dist/2.0.9/claude/plugin/skills/generate-test-cases/references/scenario-categories.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Scenario Categories — Detailed Checklists
|
|
2
|
-
|
|
3
|
-
These checklists support Step 4 of the generate-test-cases skill. Each category covers scenarios that may not be directly triggerable during browser exploration but must be included in comprehensive test specifications.
|
|
4
|
-
|
|
5
|
-
## Network & Performance
|
|
6
|
-
|
|
7
|
-
- Network failure during form submission (mock 500, timeout)
|
|
8
|
-
- Slow API response (loading states, skeleton screens, spinners)
|
|
9
|
-
- Large data sets (pagination, infinite scroll, 100+ items)
|
|
10
|
-
- Offline behavior (if PWA or service worker is present)
|
|
11
|
-
|
|
12
|
-
## Accessibility (WCAG 2.1 AA)
|
|
13
|
-
|
|
14
|
-
- Keyboard-only navigation through the entire flow (Tab, Enter, Escape)
|
|
15
|
-
- Screen reader announcements for dynamic content (ARIA live regions)
|
|
16
|
-
- Focus management after modal open/close, page transitions
|
|
17
|
-
- Color contrast for error states and disabled elements
|
|
18
|
-
- Form error association (`aria-describedby` linking errors to fields)
|
|
19
|
-
|
|
20
|
-
## Visual Consistency
|
|
21
|
-
|
|
22
|
-
- Layout stability (no unexpected content shifts after load)
|
|
23
|
-
- Responsive behavior at standard breakpoints (mobile 375px, tablet 768px, desktop 1280px)
|
|
24
|
-
- Dark mode rendering if supported
|
|
25
|
-
|
|
26
|
-
## Cross-browser Considerations
|
|
27
|
-
|
|
28
|
-
- Safari-specific behavior (date inputs, smooth scrolling, storage quirks)
|
|
29
|
-
- Firefox form validation differences
|
|
30
|
-
- Mobile browser touch targets and gestures
|
|
31
|
-
|
|
32
|
-
## Concurrent & Session
|
|
33
|
-
|
|
34
|
-
- Session expiry mid-flow (cookie cleared during multi-step)
|
|
35
|
-
- Concurrent access (two tabs, same user)
|
|
36
|
-
- Race conditions (double-click submit, rapid navigation)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Plan Coverage Priorities"
|
|
3
|
-
short_description: "Identify coverage gaps and prioritize what to test first"
|
|
4
|
-
default_prompt: "Review this feature and produce a prioritized E2E coverage plan without writing specs or code."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "agent-web-interface"
|
|
10
|
-
description: "Browser automation MCP used for lightweight site inspection"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Review TC-ID Specs"
|
|
3
|
-
short_description: "Review TC-ID specs for gaps, duplication, and weak assertions"
|
|
4
|
-
default_prompt: "Review these TC-ID test case specifications before implementation and flag quality issues."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "agent-web-interface"
|
|
10
|
-
description: "Browser automation MCP used to spot-check observed behavior claims against live site"
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: review-test-code
|
|
3
|
-
description: >
|
|
4
|
-
Quality review of Playwright test code before final execution signoff. This skill should be used
|
|
5
|
-
when implementation review of executable Playwright tests is needed, not for diagnosis of runtime flakiness.
|
|
6
|
-
Triggers: "review test code", "review Playwright tests", "check test quality",
|
|
7
|
-
"audit test implementation", "review my tests before merging", "check test code for issues",
|
|
8
|
-
"review e2e tests", "code review Playwright", "are my tests stable",
|
|
9
|
-
"check for brittle selectors", "review before running tests". Quality gate
|
|
10
|
-
after write-test-code — catches brittle selectors, force:true misuse, networkidle overuse, Tailwind
|
|
11
|
-
utility class selectors, exact numeric assertions, missing teardown, parallel-unsafe mutations,
|
|
12
|
-
hardcoded data, missing assertions, test coupling, and convention divergence. Review-only — does NOT
|
|
13
|
-
rewrite tests, does NOT run tests. Use fix-flaky-tests for fixing, write-test-code for rewriting.
|
|
14
|
-
allowed-tools: Read Glob Grep Task
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# Review Test Code
|
|
18
|
-
|
|
19
|
-
Review Playwright test code for stability, correctness, and adherence to project conventions before final execution signoff. This is a quality gate — catch structural issues in code before running tests, not after flaky failures.
|
|
20
|
-
|
|
21
|
-
## Input
|
|
22
|
-
|
|
23
|
-
Parse the test file path or directory from: $ARGUMENTS
|
|
24
|
-
|
|
25
|
-
If no argument provided, search for recently modified `*.spec.ts` or `*.test.ts` files and review those.
|
|
26
|
-
|
|
27
|
-
## Workflow
|
|
28
|
-
|
|
29
|
-
### Step 1: Load Context
|
|
30
|
-
|
|
31
|
-
1. Read the test file(s) to review
|
|
32
|
-
2. Read project conventions for comparison:
|
|
33
|
-
- `playwright.config.ts` or `playwright.config.js` — extract `baseURL`, `testDir`, projects, timeouts, `fullyParallel`, `workers`
|
|
34
|
-
- 2-3 existing test files (not the ones under review) to establish the project's conventions
|
|
35
|
-
- `e2e-plan/conventions.md` if it exists
|
|
36
|
-
3. Read the corresponding test case spec (`test-cases/<feature>.md`) if it exists — needed for traceability check
|
|
37
|
-
4. Note the project's locator strategy, fixture patterns, auth approach, and naming conventions
|
|
38
|
-
|
|
39
|
-
### Step 2: Run the Review Checklist
|
|
40
|
-
|
|
41
|
-
Evaluate the test code against each criterion. Track findings by severity:
|
|
42
|
-
|
|
43
|
-
- **BLOCKER** — will cause test failures or false passes (missing assertions, wrong selectors, broken isolation)
|
|
44
|
-
- **WARNING** — will cause flakiness or maintenance burden (brittle selectors, arbitrary waits, poor structure)
|
|
45
|
-
- **SUGGESTION** — style or convention improvement (naming, organization, minor readability)
|
|
46
|
-
|
|
47
|
-
#### 2a. Locator Quality
|
|
48
|
-
|
|
49
|
-
| Check | What to Look For |
|
|
50
|
-
|-------|-----------------|
|
|
51
|
-
| Semantic locators preferred | `getByRole`, `getByLabel`, `getByPlaceholder` over CSS selectors |
|
|
52
|
-
| No fragile positional selectors | `.first()`, `.nth()`, `.last()` without documented justification |
|
|
53
|
-
| No dynamic IDs or classes | Selectors containing generated hashes, UUIDs, or auto-incremented values |
|
|
54
|
-
| No utility framework classes | Selectors must not contain Tailwind (`rounded-lg`, `flex`, `bg-*`), Bootstrap (`btn-primary`, `col-md-*`), or similar utility classes — these are styling, not identity |
|
|
55
|
-
| Scoped to containers | Locators narrowed to `main`, `nav`, `[role="dialog"]` where needed |
|
|
56
|
-
| No exact long text matches | Use regex with key words instead of full marketing copy |
|
|
57
|
-
|
|
58
|
-
When a locator appears suspicious, delegate verification to a subagent (Task tool): instruct it to open the target URL, locate the element using the browser MCP tools (`find`, `get_element`), and report back whether the element exists and is unique.
|
|
59
|
-
|
|
60
|
-
#### 2b. Waiting and Timing
|
|
61
|
-
|
|
62
|
-
| Check | What to Look For |
|
|
63
|
-
|-------|-----------------|
|
|
64
|
-
| No `waitForTimeout()` | Arbitrary sleeps mask real timing issues |
|
|
65
|
-
| Proper action-response waits | `waitForResponse` before asserting API-dependent UI |
|
|
66
|
-
| Auto-retrying assertions used | `await expect(el).toBeVisible()` not `expect(await el.isVisible()).toBe(true)` |
|
|
67
|
-
| Reasonable explicit timeouts | Custom timeouts (`{ timeout: 10000 }`) have a comment explaining why |
|
|
68
|
-
| No `networkidle` overuse | `networkidle` is fragile; prefer specific response waits |
|
|
69
|
-
|
|
70
|
-
#### 2c. Assertions
|
|
71
|
-
|
|
72
|
-
| Check | What to Look For |
|
|
73
|
-
|-------|-----------------|
|
|
74
|
-
| Every test has assertions | No test blocks without `expect()` calls |
|
|
75
|
-
| Assertions test user outcomes | Visible text, URL changes, element states — not internal state or CSS classes |
|
|
76
|
-
| Assertions are specific | `toHaveText('Welcome, John')` not just `toBeVisible()` |
|
|
77
|
-
| Error paths have assertions | Error scenario tests verify the error message, not just that "something happened" |
|
|
78
|
-
| No exact server-computed values | Dashboard counters, totals, and aggregates must not assert exact numbers — use patterns, ranges, or seed data first |
|
|
79
|
-
| No `toBeTruthy()` on locators | Use Playwright-specific matchers (`toBeVisible`, `toBeEnabled`, `toHaveText`) |
|
|
80
|
-
|
|
81
|
-
#### 2d. Test Isolation and Structure
|
|
82
|
-
|
|
83
|
-
| Check | What to Look For |
|
|
84
|
-
|-------|-----------------|
|
|
85
|
-
| No shared mutable state | Tests do not depend on execution order or modify shared variables |
|
|
86
|
-
| Proper setup/teardown | `beforeEach`/`afterEach` for shared setup, not duplicated in each test |
|
|
87
|
-
| AAA structure | Clear Arrange → Act → Assert sections (comments optional but structure required) |
|
|
88
|
-
| No test coupling | Test B does not depend on side effects from Test A |
|
|
89
|
-
| Auth handled correctly | `storageState` or fixture, not UI login in every test (unless testing login itself) |
|
|
90
|
-
| Test data is unique | Uses `Date.now()`, factories, or unique IDs — not hardcoded shared data |
|
|
91
|
-
| Parallel-safe (if `fullyParallel: true` or `workers` > 1 found in config) | Tests that create data must not assert on unscoped lists or counts — filter assertions to the specific data created. If parallelism is disabled, note as SUGGESTION rather than WARNING |
|
|
92
|
-
| Data cleanup present | Tests that create persistent records (API POST/PUT) must have corresponding teardown (`afterEach`, fixture cleanup, or `globalTeardown`) |
|
|
93
|
-
|
|
94
|
-
#### 2e. Convention Adherence
|
|
95
|
-
|
|
96
|
-
| Check | What to Look For |
|
|
97
|
-
|-------|-----------------|
|
|
98
|
-
| TC-ID in test title | Every test has `TC-<FEATURE>-<NNN>: Description` format |
|
|
99
|
-
| File naming matches project | Follows existing `*.spec.ts` or `*.test.ts` convention |
|
|
100
|
-
| Import style matches project | Imports from project fixtures file if one exists, not raw `@playwright/test` |
|
|
101
|
-
| baseURL used | `page.goto('/')` not `page.goto('https://example.com/')` |
|
|
102
|
-
| POM pattern followed (if used) | Page objects for interactions, tests for assertions |
|
|
103
|
-
| Consistent locator strategy | Same locator approach as existing tests |
|
|
104
|
-
|
|
105
|
-
#### 2f. TC-ID Traceability
|
|
106
|
-
|
|
107
|
-
If a test case spec file exists for this feature:
|
|
108
|
-
- Verify every TC-ID from the spec has a corresponding test
|
|
109
|
-
- Flag TC-IDs in the spec with no implementation
|
|
110
|
-
- Flag tests with TC-IDs not present in the spec (orphaned tests)
|
|
111
|
-
- Note: not every spec TC-ID must be implemented — but missing ones should be acknowledged
|
|
112
|
-
|
|
113
|
-
#### 2g. Anti-Pattern Detection
|
|
114
|
-
|
|
115
|
-
Flag any instances of these known anti-patterns:
|
|
116
|
-
1. Raw CSS selectors where semantic locators would work
|
|
117
|
-
2. `waitForTimeout()` used as a fix
|
|
118
|
-
3. `.first()` / `.nth()` without justification
|
|
119
|
-
4. Exact long text matches (fragile to copy changes)
|
|
120
|
-
5. Login via UI in every test (should use storageState)
|
|
121
|
-
6. UI clicks to set up test data (should use API)
|
|
122
|
-
7. No error path tests in the suite
|
|
123
|
-
8. Hardcoded test data
|
|
124
|
-
9. Tests depending on execution order
|
|
125
|
-
10. `expect(await el.isVisible()).toBe(true)` instead of `await expect(el).toBeVisible()`
|
|
126
|
-
11. Missing `await` on Playwright calls (easy to miss, causes silent failures)
|
|
127
|
-
12. `{ force: true }` on interactions without documented justification (masks actionability issues — overlapping elements, disabled state, not scrolled into view)
|
|
128
|
-
13. `waitForLoadState('networkidle')` as default wait strategy — breaks on long-polling, WebSockets, analytics beacons; use specific `waitForResponse` or UI assertions instead
|
|
129
|
-
14. CSS utility class selectors (Tailwind `rounded-lg`, `flex`, Bootstrap `btn-primary`, `col-md-*`) — styling classes are volatile, never use as selectors
|
|
130
|
-
15. Asserting exact server-computed values (`toHaveText('12450')`) — use pattern matchers, ranges, or seed data to control expected values
|
|
131
|
-
|
|
132
|
-
### Step 3: Produce the Review Report
|
|
133
|
-
|
|
134
|
-
Output a structured review with this format:
|
|
135
|
-
|
|
136
|
-
```markdown
|
|
137
|
-
# Test Code Review: <file or feature>
|
|
138
|
-
|
|
139
|
-
**Files reviewed:** <list>
|
|
140
|
-
**Total tests:** <count>
|
|
141
|
-
**Review date:** <date>
|
|
142
|
-
|
|
143
|
-
## Verdict: PASS | PASS WITH WARNINGS | NEEDS REVISION
|
|
144
|
-
|
|
145
|
-
## Blockers (<count>)
|
|
146
|
-
- **<file>:<line>** `<test name>`: <issue description>
|
|
147
|
-
|
|
148
|
-
## Warnings (<count>)
|
|
149
|
-
- **<file>:<line>** `<test name>`: <issue description>
|
|
150
|
-
|
|
151
|
-
## Suggestions (<count>)
|
|
152
|
-
- **<file>:<line>**: <issue description>
|
|
153
|
-
|
|
154
|
-
## Convention Divergences
|
|
155
|
-
- <How this code differs from the project's established patterns>
|
|
156
|
-
|
|
157
|
-
## TC-ID Traceability
|
|
158
|
-
- **Implemented:** <count> / <total in spec>
|
|
159
|
-
- **Missing from implementation:** <list of TC-IDs>
|
|
160
|
-
- **Orphaned (no spec):** <list of TC-IDs>
|
|
161
|
-
|
|
162
|
-
## Summary
|
|
163
|
-
<2-3 sentences on overall code quality and what to address before test execution>
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Step 4: Verdict Rules
|
|
167
|
-
|
|
168
|
-
- **PASS** — no blockers, 2 or fewer warnings. Proceed to test execution.
|
|
169
|
-
- **PASS WITH WARNINGS** — no blockers, 3+ warnings. Can proceed but should address warnings for long-term stability.
|
|
170
|
-
- **NEEDS REVISION** — 1+ blockers. Do not run tests expecting stable results until blockers are resolved.
|
|
171
|
-
|
|
172
|
-
## Principles
|
|
173
|
-
|
|
174
|
-
- **Review-only** — never modify test files; report findings for the author to act on
|
|
175
|
-
- **Evidence over opinion** — cite specific file paths, line numbers, and code snippets when flagging issues
|
|
176
|
-
- **Spot-check selectors** — delegate to a subagent with browser access to verify 2-3 suspicious locators against the live site
|
|
177
|
-
- **Convention-first** — compare against the project's existing test patterns, not an abstract ideal
|
|
178
|
-
- **Bounded output** — the review should be actionable and finite, not a full rewrite specification
|
|
179
|
-
- **Severity matters** — a missing `await` is a blocker; a naming style preference is a suggestion
|
|
180
|
-
|
|
181
|
-
## Example Usage
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
Claude Code: /review-test-code tests/e2e/login.spec.ts
|
|
185
|
-
Codex: $review-test-code tests/e2e/login.spec.ts
|
|
186
|
-
|
|
187
|
-
Claude Code: /review-test-code tests/e2e/
|
|
188
|
-
Codex: $review-test-code tests/e2e/
|
|
189
|
-
```
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Review Playwright Test Code"
|
|
3
|
-
short_description: "Review Playwright test implementation for stability and correctness"
|
|
4
|
-
default_prompt: "Review this Playwright test implementation before execution and flag quality issues."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "agent-web-interface"
|
|
10
|
-
description: "Browser automation MCP used to verify selectors against the live site"
|