@bugzy-ai/bugzy 1.14.1 → 1.15.0
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/dist/cli/index.cjs +304 -470
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +304 -470
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +285 -463
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +285 -463
- package/dist/index.js.map +1 -1
- package/dist/subagents/index.cjs +165 -313
- package/dist/subagents/index.cjs.map +1 -1
- package/dist/subagents/index.js +165 -313
- package/dist/subagents/index.js.map +1 -1
- package/dist/subagents/metadata.cjs +4 -4
- package/dist/subagents/metadata.cjs.map +1 -1
- package/dist/subagents/metadata.js +4 -4
- package/dist/subagents/metadata.js.map +1 -1
- package/dist/tasks/index.cjs +59 -75
- package/dist/tasks/index.cjs.map +1 -1
- package/dist/tasks/index.js +59 -75
- package/dist/tasks/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/init/.bugzy/runtime/templates/test-result-schema.md +2 -2
- package/templates/init/AGENTS.md +3 -3
- package/templates/init/CLAUDE.md +3 -3
- package/templates/init/tests/CLAUDE.md +193 -0
- /package/templates/init/{.bugzy/runtime → tests/docs}/test-execution-strategy.md +0 -0
- /package/templates/init/{.bugzy/runtime → tests/docs}/testing-best-practices.md +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -96,9 +96,9 @@ var init_generate_test_cases = __esm({
|
|
|
96
96
|
generateTestCasesTask = {
|
|
97
97
|
slug: TASK_SLUGS.GENERATE_TEST_CASES,
|
|
98
98
|
name: "Generate Test Cases",
|
|
99
|
-
description: "Generate manual test case documentation AND automated
|
|
99
|
+
description: "Generate manual test case documentation AND automated test scripts from test plan",
|
|
100
100
|
frontmatter: {
|
|
101
|
-
description: "Generate manual test case documentation AND automated
|
|
101
|
+
description: "Generate manual test case documentation AND automated test scripts from test plan",
|
|
102
102
|
"argument-hint": "--type [exploratory|functional|regression|smoke] --focus [optional-feature]"
|
|
103
103
|
},
|
|
104
104
|
steps: [
|
|
@@ -106,12 +106,12 @@ var init_generate_test_cases = __esm({
|
|
|
106
106
|
{
|
|
107
107
|
inline: true,
|
|
108
108
|
title: "Generate Test Cases Overview",
|
|
109
|
-
content: `Generate comprehensive test artifacts including BOTH manual test case documentation AND automated
|
|
109
|
+
content: `Generate comprehensive test artifacts including BOTH manual test case documentation AND automated test scripts. Read \`./tests/CLAUDE.md\` for framework-specific conventions, directory structure, and commands.
|
|
110
110
|
|
|
111
111
|
This command generates:
|
|
112
112
|
1. **Manual Test Case Documentation** (in \`./test-cases/\`) - Human-readable test cases in markdown format
|
|
113
|
-
2. **Automated
|
|
114
|
-
3. **Page
|
|
113
|
+
2. **Automated Test Scripts** (in directory from \`./tests/CLAUDE.md\`) - Executable test scripts
|
|
114
|
+
3. **Page Objects** (in directory from \`./tests/CLAUDE.md\`) - Reusable page classes for automated tests
|
|
115
115
|
4. **Supporting Files** (fixtures, helpers, components) - As needed for test automation`
|
|
116
116
|
},
|
|
117
117
|
// Step 2: Security Notice (library)
|
|
@@ -146,9 +146,9 @@ Read the test plan from \`test-plan.md\` to understand:
|
|
|
146
146
|
|
|
147
147
|
**1.2 Check Existing Test Cases and Tests**
|
|
148
148
|
- List all files in \`./test-cases/\` to understand existing manual test coverage
|
|
149
|
-
- List
|
|
149
|
+
- List existing automated tests in the test directory (see \`./tests/CLAUDE.md\` for structure)
|
|
150
150
|
- Determine next test case ID (TC-XXX format)
|
|
151
|
-
- Identify existing
|
|
151
|
+
- Identify existing page objects (see \`./tests/CLAUDE.md\` for directory)
|
|
152
152
|
- Avoid creating overlapping test cases or duplicate automation`
|
|
153
153
|
},
|
|
154
154
|
// Step 6: Documentation Researcher (conditional library step)
|
|
@@ -257,8 +257,8 @@ Before invoking the agent, identify the test cases for the current area:
|
|
|
257
257
|
- Test type: {type}
|
|
258
258
|
- Test plan: test-plan.md
|
|
259
259
|
- Manual test cases directory: ./test-cases/
|
|
260
|
-
- Existing automated tests: ./tests/
|
|
261
|
-
- Existing
|
|
260
|
+
- Existing automated tests: [directory from ./tests/CLAUDE.md]
|
|
261
|
+
- Existing page objects: [directory from ./tests/CLAUDE.md]
|
|
262
262
|
|
|
263
263
|
**Knowledge Base Patterns (MUST APPLY):**
|
|
264
264
|
Include ALL relevant testing patterns from the knowledge base that apply to this area. For example, if the KB documents timing behaviors (animation delays, loading states), selector gotchas, or recommended assertion approaches \u2014 list them here explicitly and instruct the agent to use the specific patterns described (e.g., specific assertion methods with specific timeouts). The test-code-generator does not have access to the knowledge base, so you MUST relay the exact patterns and recommended code approaches.
|
|
@@ -269,7 +269,7 @@ Include ALL relevant testing patterns from the knowledge base that apply to this
|
|
|
269
269
|
3. Explore the feature area to understand implementation (gather selectors, URLs, flows)
|
|
270
270
|
4. Build missing Page Objects and supporting code
|
|
271
271
|
5. For each test case marked \`automated: true\`:
|
|
272
|
-
- Create automated
|
|
272
|
+
- Create automated test in the test directory (from ./tests/CLAUDE.md)
|
|
273
273
|
- Update the manual test case file to reference the automated test path
|
|
274
274
|
- Apply ALL knowledge base patterns listed above (timing, selectors, assertions)
|
|
275
275
|
6. Run and iterate on each test until it passes or fails with a product bug
|
|
@@ -300,15 +300,7 @@ Move to the next area and repeat until all areas are complete.
|
|
|
300
300
|
{
|
|
301
301
|
inline: true,
|
|
302
302
|
title: "Create Directories if Needed",
|
|
303
|
-
content: `Ensure required directories exist
|
|
304
|
-
\`\`\`bash
|
|
305
|
-
mkdir -p ./test-cases
|
|
306
|
-
mkdir -p ./tests/specs
|
|
307
|
-
mkdir -p ./tests/pages
|
|
308
|
-
mkdir -p ./tests/components
|
|
309
|
-
mkdir -p ./tests/fixtures
|
|
310
|
-
mkdir -p ./tests/helpers
|
|
311
|
-
\`\`\``
|
|
303
|
+
content: `Ensure required directories exist. Create the \`./test-cases/\` directory for manual test cases, and create the test directories specified in \`./tests/CLAUDE.md\` (test specs, page objects, components, fixtures, helpers).`
|
|
312
304
|
},
|
|
313
305
|
// Step 14: Extract Env Variables (library)
|
|
314
306
|
"extract-env-variables",
|
|
@@ -328,7 +320,7 @@ mkdir -p ./tests/helpers
|
|
|
328
320
|
- Features covered by automation
|
|
329
321
|
- Areas kept manual-only (and why)
|
|
330
322
|
3. Highlight key automated test scenarios
|
|
331
|
-
4. Share command to run automated tests
|
|
323
|
+
4. Share command to run automated tests (from \`./tests/CLAUDE.md\`)
|
|
332
324
|
5. Ask for team review and validation
|
|
333
325
|
6. Mention any areas needing exploration or clarification
|
|
334
326
|
7. Use appropriate channel and threading for the update
|
|
@@ -373,8 +365,8 @@ The team communication should include:
|
|
|
373
365
|
- Areas kept manual-only (and why)
|
|
374
366
|
|
|
375
367
|
**Next Steps:**
|
|
376
|
-
- Command to run automated tests
|
|
377
|
-
- Instructions to run specific test file
|
|
368
|
+
- Command to run automated tests (from \`./tests/CLAUDE.md\`)
|
|
369
|
+
- Instructions to run specific test file (from \`./tests/CLAUDE.md\`)
|
|
378
370
|
- Note about copying .env.testdata to .env
|
|
379
371
|
- Mention any exploration needed for edge cases
|
|
380
372
|
|
|
@@ -390,7 +382,7 @@ The team communication should include:
|
|
|
390
382
|
- **Test Independence**: Each test must be runnable in isolation and in parallel`
|
|
391
383
|
}
|
|
392
384
|
],
|
|
393
|
-
requiredSubagents: ["
|
|
385
|
+
requiredSubagents: ["browser-automation", "test-code-generator"],
|
|
394
386
|
optionalSubagents: ["documentation-researcher", "team-communicator"],
|
|
395
387
|
dependentTasks: []
|
|
396
388
|
};
|
|
@@ -597,7 +589,7 @@ The team communication should include:
|
|
|
597
589
|
- Instructions for the user to fill in actual values in .env.testdata before running tests`
|
|
598
590
|
}
|
|
599
591
|
],
|
|
600
|
-
requiredSubagents: ["
|
|
592
|
+
requiredSubagents: ["browser-automation"],
|
|
601
593
|
optionalSubagents: ["documentation-researcher", "team-communicator"],
|
|
602
594
|
dependentTasks: []
|
|
603
595
|
};
|
|
@@ -1135,7 +1127,7 @@ After queuing and notifying, the task is DONE. Do NOT:
|
|
|
1135
1127
|
- Execute /verify-changes, /run-tests, /generate-test-cases directly
|
|
1136
1128
|
- Wait for team response (messaging infrastructure handles that)
|
|
1137
1129
|
- Create or modify test files
|
|
1138
|
-
- Run
|
|
1130
|
+
- Run automated tests
|
|
1139
1131
|
|
|
1140
1132
|
#### 5.6 Update Event Processor Memory
|
|
1141
1133
|
If new patterns discovered, append to \`.bugzy/runtime/memory/event-processor.md\`:
|
|
@@ -1250,10 +1242,10 @@ var init_run_tests = __esm({
|
|
|
1250
1242
|
runTestsTask = {
|
|
1251
1243
|
slug: TASK_SLUGS.RUN_TESTS,
|
|
1252
1244
|
name: "Run Tests",
|
|
1253
|
-
description: "Execute automated
|
|
1245
|
+
description: "Execute automated tests, analyze failures, and fix test issues automatically",
|
|
1254
1246
|
frontmatter: {
|
|
1255
|
-
description: "Execute automated
|
|
1256
|
-
"argument-hint": '[file-pattern|tag|all] (e.g., "auth", "@smoke",
|
|
1247
|
+
description: "Execute automated tests, analyze failures, and fix test issues automatically",
|
|
1248
|
+
"argument-hint": '[file-pattern|tag|all] (e.g., "auth", "@smoke", or a specific test file path)'
|
|
1257
1249
|
},
|
|
1258
1250
|
steps: [
|
|
1259
1251
|
// Step 1: Overview (inline)
|
|
@@ -1262,7 +1254,7 @@ var init_run_tests = __esm({
|
|
|
1262
1254
|
title: "Run Tests Overview",
|
|
1263
1255
|
content: `# Run Tests Command
|
|
1264
1256
|
|
|
1265
|
-
Execute automated
|
|
1257
|
+
Execute automated tests, analyze failures using JSON reports, automatically fix test issues, and log product bugs. Read \`./tests/CLAUDE.md\` for framework-specific conventions and commands.`
|
|
1266
1258
|
},
|
|
1267
1259
|
// Step 2: Security Notice (library)
|
|
1268
1260
|
"security-notice",
|
|
@@ -1275,9 +1267,9 @@ Execute automated Playwright tests, analyze failures using JSON reports, automat
|
|
|
1275
1267
|
**Parse Arguments:**
|
|
1276
1268
|
Extract the following from arguments:
|
|
1277
1269
|
- **selector**: Test selection criteria
|
|
1278
|
-
- File pattern: "auth" \u2192
|
|
1279
|
-
- Tag: "@smoke" \u2192 runs tests with
|
|
1280
|
-
- Specific file:
|
|
1270
|
+
- File pattern: "auth" \u2192 find matching test files (see \`./tests/CLAUDE.md\` for directory structure)
|
|
1271
|
+
- Tag: "@smoke" \u2192 runs tests with tag annotation
|
|
1272
|
+
- Specific file: path to a specific test file
|
|
1281
1273
|
- All tests: "all" or "" \u2192 runs entire test suite`
|
|
1282
1274
|
},
|
|
1283
1275
|
// Step 4: Load Project Context (library)
|
|
@@ -1293,34 +1285,26 @@ Extract the following from arguments:
|
|
|
1293
1285
|
inline: true,
|
|
1294
1286
|
title: "Identify Automated Tests to Run",
|
|
1295
1287
|
content: `#### Understand Test Selection
|
|
1288
|
+
|
|
1289
|
+
Read \`./tests/CLAUDE.md\` for the test directory structure, file patterns, and execution commands.
|
|
1290
|
+
|
|
1296
1291
|
Parse the selector argument to determine which tests to run:
|
|
1297
1292
|
|
|
1298
1293
|
**File Pattern** (e.g., "auth", "login"):
|
|
1299
|
-
- Find matching test files
|
|
1294
|
+
- Find matching test files in the test directory specified by \`./tests/CLAUDE.md\`
|
|
1300
1295
|
- Example: "auth" \u2192 finds all test files with "auth" in the name
|
|
1301
1296
|
|
|
1302
1297
|
**Tag** (e.g., "@smoke", "@regression"):
|
|
1303
|
-
- Run tests with specific
|
|
1304
|
-
- Use Playwright's \`--grep\` option
|
|
1298
|
+
- Run tests with specific tag annotation using the tag command from \`./tests/CLAUDE.md\`
|
|
1305
1299
|
|
|
1306
|
-
**Specific File
|
|
1307
|
-
- Run that specific test file
|
|
1300
|
+
**Specific File**:
|
|
1301
|
+
- Run that specific test file using the single-file command from \`./tests/CLAUDE.md\`
|
|
1308
1302
|
|
|
1309
1303
|
**All Tests** ("all" or no selector):
|
|
1310
|
-
- Run entire test suite
|
|
1304
|
+
- Run entire test suite using the run-all command from \`./tests/CLAUDE.md\`
|
|
1311
1305
|
|
|
1312
1306
|
#### Find Matching Test Files
|
|
1313
|
-
Use glob patterns to find test files
|
|
1314
|
-
\`\`\`bash
|
|
1315
|
-
# For file pattern
|
|
1316
|
-
ls tests/specs/**/*[pattern]*.spec.ts
|
|
1317
|
-
|
|
1318
|
-
# For specific file
|
|
1319
|
-
ls tests/specs/auth/login.spec.ts
|
|
1320
|
-
|
|
1321
|
-
# For all tests
|
|
1322
|
-
ls tests/specs/**/*.spec.ts
|
|
1323
|
-
\`\`\`
|
|
1307
|
+
Use glob patterns to find test files in the directory structure defined by \`./tests/CLAUDE.md\`.
|
|
1324
1308
|
|
|
1325
1309
|
#### Validate Test Files Exist
|
|
1326
1310
|
Check that at least one test file was found:
|
|
@@ -1334,7 +1318,7 @@ Before running tests, confirm the selection with the user if ambiguous:
|
|
|
1334
1318
|
- **No selector** (all tests): Confirm running full suite before executing`
|
|
1335
1319
|
},
|
|
1336
1320
|
// Step 7-10: Test Execution (library steps)
|
|
1337
|
-
"run-
|
|
1321
|
+
"run-tests",
|
|
1338
1322
|
"parse-test-results",
|
|
1339
1323
|
"triage-failures",
|
|
1340
1324
|
"fix-test-issues",
|
|
@@ -1360,8 +1344,8 @@ If no test cases match the selection criteria:
|
|
|
1360
1344
|
2. List available test cases or suggest running \`/generate-test-cases\` first
|
|
1361
1345
|
3. Provide examples of valid selection criteria
|
|
1362
1346
|
|
|
1363
|
-
#### If
|
|
1364
|
-
If the
|
|
1347
|
+
#### If Browser Automation Agent Fails
|
|
1348
|
+
If the browser-automation agent encounters issues:
|
|
1365
1349
|
1. Report the specific error
|
|
1366
1350
|
2. Suggest troubleshooting steps
|
|
1367
1351
|
3. Offer to run tests individually if batch execution failed
|
|
@@ -1375,18 +1359,18 @@ If selected test cases have formatting issues:
|
|
|
1375
1359
|
### Important Notes
|
|
1376
1360
|
|
|
1377
1361
|
**Test Selection Strategy**:
|
|
1378
|
-
- **Always read**
|
|
1362
|
+
- **Always read** \`./tests/docs/test-execution-strategy.md\` before selecting tests
|
|
1379
1363
|
- Default to \`@smoke\` tests for fast validation unless user explicitly requests otherwise
|
|
1380
1364
|
- Smoke tests provide 100% manual test case coverage with zero redundancy (~2-5 min)
|
|
1381
1365
|
- Full regression includes intentional redundancy for diagnostic value (~10-15 min)
|
|
1382
1366
|
- Use context keywords from user request to choose appropriate tier
|
|
1383
1367
|
|
|
1384
1368
|
**Test Execution**:
|
|
1385
|
-
- Automated
|
|
1369
|
+
- Automated tests are executed via bash command, not through agents
|
|
1386
1370
|
- Test execution time varies by tier (see strategy document for details)
|
|
1387
1371
|
- JSON reports provide structured test results for analysis
|
|
1388
|
-
-
|
|
1389
|
-
- Test artifacts are stored in
|
|
1372
|
+
- Test framework may capture traces, screenshots, and videos on failures (see \`./tests/CLAUDE.md\`)
|
|
1373
|
+
- Test artifacts are stored as defined in \`./tests/CLAUDE.md\`
|
|
1390
1374
|
|
|
1391
1375
|
**Failure Handling**:
|
|
1392
1376
|
- Test failures are automatically triaged (product bugs vs test issues)
|
|
@@ -1396,11 +1380,11 @@ If selected test cases have formatting issues:
|
|
|
1396
1380
|
- Critical failures trigger immediate team notification
|
|
1397
1381
|
|
|
1398
1382
|
**Related Documentation**:
|
|
1399
|
-
-
|
|
1400
|
-
-
|
|
1383
|
+
- \`./tests/docs/test-execution-strategy.md\` - When and why to run specific tests
|
|
1384
|
+
- \`./tests/docs/testing-best-practices.md\` - How to write tests (patterns and anti-patterns)`
|
|
1401
1385
|
}
|
|
1402
1386
|
],
|
|
1403
|
-
requiredSubagents: ["
|
|
1387
|
+
requiredSubagents: ["browser-automation", "test-debugger-fixer"],
|
|
1404
1388
|
optionalSubagents: ["issue-tracker", "team-communicator"],
|
|
1405
1389
|
dependentTasks: []
|
|
1406
1390
|
};
|
|
@@ -1432,7 +1416,7 @@ var init_verify_changes = __esm({
|
|
|
1432
1416
|
## Overview
|
|
1433
1417
|
|
|
1434
1418
|
This task performs comprehensive change verification with:
|
|
1435
|
-
- **Automated testing**: Execute
|
|
1419
|
+
- **Automated testing**: Execute automated tests with automatic triage and fixing
|
|
1436
1420
|
- **Manual verification checklists**: Generate role-specific checklists for non-automatable scenarios
|
|
1437
1421
|
- **Multi-trigger support**: Works from manual CLI, Slack messages, GitHub PRs, and CI/CD
|
|
1438
1422
|
- **Smart output routing**: Results formatted and delivered to the appropriate channel`
|
|
@@ -1663,11 +1647,11 @@ Analyze the change description to identify affected feature areas:
|
|
|
1663
1647
|
|
|
1664
1648
|
| Description Keywords | Inferred Test Scope | Example |
|
|
1665
1649
|
|---------------------|-------------------|---------|
|
|
1666
|
-
| "login", "authentication", "sign in/up" |
|
|
1667
|
-
| "checkout", "payment", "purchase" |
|
|
1668
|
-
| "cart", "shopping cart", "add to cart" |
|
|
1650
|
+
| "login", "authentication", "sign in/up" | Auth test suite | "Fix login page validation" -> Auth tests |
|
|
1651
|
+
| "checkout", "payment", "purchase" | Checkout test suite | "Optimize checkout flow" -> Checkout tests |
|
|
1652
|
+
| "cart", "shopping cart", "add to cart" | Cart test suite | "Update cart calculations" -> Cart tests |
|
|
1669
1653
|
| "API", "endpoint", "backend" | API test suites | "Add new user API endpoint" -> User API tests |
|
|
1670
|
-
| "profile", "account", "settings" |
|
|
1654
|
+
| "profile", "account", "settings" | Profile/settings test suite | "Profile page redesign" -> Profile tests |
|
|
1671
1655
|
|
|
1672
1656
|
**Inference strategy:**
|
|
1673
1657
|
1. **Extract feature keywords** from PR title and description
|
|
@@ -1742,13 +1726,13 @@ If the Jira issue or PR references test accounts/data (e.g., TEST_PREMIUM_USER,
|
|
|
1742
1726
|
|
|
1743
1727
|
**CRITICAL**: Never conclude "manual verification required" or "BLOCKED" solely because test data is missing. Always create the test artifacts first.
|
|
1744
1728
|
|
|
1745
|
-
### Generate
|
|
1729
|
+
### Generate Automated Test Specs
|
|
1746
1730
|
|
|
1747
1731
|
{{INVOKE_TEST_CODE_GENERATOR}} to create automated test specs:
|
|
1748
1732
|
- Read the manual test cases you just created
|
|
1749
1733
|
- Explore the feature in the browser to discover selectors and flows
|
|
1750
|
-
- Create
|
|
1751
|
-
- Create test specs in
|
|
1734
|
+
- Create page objects in the directory specified by \`./tests/CLAUDE.md\`
|
|
1735
|
+
- Create test specs in the directory specified by \`./tests/CLAUDE.md\`
|
|
1752
1736
|
- Run each new test to verify it passes
|
|
1753
1737
|
- Update the manual test case with \`automated_test\` reference
|
|
1754
1738
|
|
|
@@ -1758,7 +1742,7 @@ Skip this step \u2014 proceed directly to running existing tests.`,
|
|
|
1758
1742
|
conditionalOnSubagent: "test-code-generator"
|
|
1759
1743
|
},
|
|
1760
1744
|
// Step 8-11: Test Execution (library steps)
|
|
1761
|
-
"run-
|
|
1745
|
+
"run-tests",
|
|
1762
1746
|
"parse-test-results",
|
|
1763
1747
|
"triage-failures",
|
|
1764
1748
|
"fix-test-issues",
|
|
@@ -1947,7 +1931,7 @@ Post PR comment if GitHub context available.`,
|
|
|
1947
1931
|
- Recommend: Check test configuration and prerequisites
|
|
1948
1932
|
|
|
1949
1933
|
**If test execution fails:**
|
|
1950
|
-
- Report specific error (
|
|
1934
|
+
- Report specific error (test framework not installed, env vars missing)
|
|
1951
1935
|
- Suggest troubleshooting steps
|
|
1952
1936
|
- Don't proceed with triage if tests didn't run
|
|
1953
1937
|
|
|
@@ -1977,7 +1961,7 @@ A successful verification includes:
|
|
|
1977
1961
|
10. Clear recommendation provided (merge / review / block)`
|
|
1978
1962
|
}
|
|
1979
1963
|
],
|
|
1980
|
-
requiredSubagents: ["
|
|
1964
|
+
requiredSubagents: ["browser-automation", "test-debugger-fixer"],
|
|
1981
1965
|
optionalSubagents: ["documentation-researcher", "issue-tracker", "team-communicator", "changelog-historian", "test-code-generator"],
|
|
1982
1966
|
dependentTasks: []
|
|
1983
1967
|
};
|
|
@@ -2034,7 +2018,7 @@ This command orchestrates the complete test coverage workflow in a single execut
|
|
|
2034
2018
|
},
|
|
2035
2019
|
// Phase 2: Exploration Protocol
|
|
2036
2020
|
"exploration-protocol",
|
|
2037
|
-
// Execute exploration via
|
|
2021
|
+
// Execute exploration via browser-automation
|
|
2038
2022
|
"create-exploration-test-case",
|
|
2039
2023
|
"run-exploration",
|
|
2040
2024
|
"process-exploration-results",
|
|
@@ -2045,7 +2029,7 @@ This command orchestrates the complete test coverage workflow in a single execut
|
|
|
2045
2029
|
"generate-test-cases",
|
|
2046
2030
|
"automate-test-cases",
|
|
2047
2031
|
// Phase 5: Test Execution
|
|
2048
|
-
"run-
|
|
2032
|
+
"run-tests",
|
|
2049
2033
|
"parse-test-results",
|
|
2050
2034
|
// Phase 6: Triage and Fix (NEW - was missing from full-test-coverage)
|
|
2051
2035
|
"triage-failures",
|
|
@@ -2062,7 +2046,7 @@ This command orchestrates the complete test coverage workflow in a single execut
|
|
|
2062
2046
|
},
|
|
2063
2047
|
"generate-final-report"
|
|
2064
2048
|
],
|
|
2065
|
-
requiredSubagents: ["
|
|
2049
|
+
requiredSubagents: ["browser-automation", "test-code-generator", "test-debugger-fixer"],
|
|
2066
2050
|
optionalSubagents: ["documentation-researcher", "team-communicator", "issue-tracker"],
|
|
2067
2051
|
dependentTasks: ["run-tests", "generate-test-cases"]
|
|
2068
2052
|
};
|
|
@@ -2089,7 +2073,7 @@ var init_explore_application = __esm({
|
|
|
2089
2073
|
{
|
|
2090
2074
|
inline: true,
|
|
2091
2075
|
title: "Explore Application Overview",
|
|
2092
|
-
content: `Discover actual UI elements, workflows, and behaviors using the
|
|
2076
|
+
content: `Discover actual UI elements, workflows, and behaviors using the browser-automation agent. Updates test plan and project documentation with findings.`
|
|
2093
2077
|
},
|
|
2094
2078
|
// Step 2: Security Notice (from library)
|
|
2095
2079
|
"security-notice",
|
|
@@ -2136,7 +2120,7 @@ var init_explore_application = __esm({
|
|
|
2136
2120
|
"cleanup-temp-files",
|
|
2137
2121
|
"update-knowledge-base"
|
|
2138
2122
|
],
|
|
2139
|
-
requiredSubagents: ["
|
|
2123
|
+
requiredSubagents: ["browser-automation"],
|
|
2140
2124
|
optionalSubagents: ["team-communicator"],
|
|
2141
2125
|
dependentTasks: []
|
|
2142
2126
|
};
|
|
@@ -2507,9 +2491,9 @@ var INTEGRATIONS = {
|
|
|
2507
2491
|
}
|
|
2508
2492
|
};
|
|
2509
2493
|
var SUBAGENTS = {
|
|
2510
|
-
"
|
|
2511
|
-
role: "
|
|
2512
|
-
name: "
|
|
2494
|
+
"browser-automation": {
|
|
2495
|
+
role: "browser-automation",
|
|
2496
|
+
name: "Browser Automation",
|
|
2513
2497
|
description: "Execute automated browser tests (always included)",
|
|
2514
2498
|
icon: "play",
|
|
2515
2499
|
integrations: [INTEGRATIONS.playwright],
|
|
@@ -2566,7 +2550,7 @@ var SUBAGENTS = {
|
|
|
2566
2550
|
"test-code-generator": {
|
|
2567
2551
|
role: "test-code-generator",
|
|
2568
2552
|
name: "Test Code Generator",
|
|
2569
|
-
description: "Generate automated
|
|
2553
|
+
description: "Generate automated test scripts and page objects",
|
|
2570
2554
|
icon: "code",
|
|
2571
2555
|
integrations: [INTEGRATIONS.playwright],
|
|
2572
2556
|
model: "sonnet",
|
|
@@ -2781,7 +2765,7 @@ init_esm_shims();
|
|
|
2781
2765
|
// src/subagents/templates/index.ts
|
|
2782
2766
|
init_esm_shims();
|
|
2783
2767
|
|
|
2784
|
-
// src/subagents/templates/
|
|
2768
|
+
// src/subagents/templates/browser-automation/playwright.ts
|
|
2785
2769
|
init_esm_shims();
|
|
2786
2770
|
|
|
2787
2771
|
// src/subagents/templates/memory-template.ts
|
|
@@ -2828,16 +2812,16 @@ After completing your work, update your memory file with relevant insights.
|
|
|
2828
2812
|
**Remember:** Every entry should answer "How does this change what I do?"
|
|
2829
2813
|
`;
|
|
2830
2814
|
|
|
2831
|
-
// src/subagents/templates/
|
|
2815
|
+
// src/subagents/templates/browser-automation/playwright.ts
|
|
2832
2816
|
var FRONTMATTER = {
|
|
2833
|
-
name: "
|
|
2834
|
-
description: `Execute test cases using
|
|
2817
|
+
name: "browser-automation",
|
|
2818
|
+
description: `Execute test cases using browser automation with comprehensive logging and evidence capture. Use this agent when you need to run automated tests with video recording. Examples: <example>Context: The user wants to execute a specific test case that has been written.
|
|
2835
2819
|
user: "Run the login test case located at ./test-cases/TC-001-login.md"
|
|
2836
|
-
assistant: "I'll use the
|
|
2837
|
-
<commentary>Since the user wants to execute a test case file, use the Task tool to launch the
|
|
2820
|
+
assistant: "I'll use the browser-automation agent to execute this test case and capture all the results with video evidence."
|
|
2821
|
+
<commentary>Since the user wants to execute a test case file, use the Task tool to launch the browser-automation agent with the test case file path.</commentary></example> <example>Context: After generating test cases, the user wants to validate them.
|
|
2838
2822
|
user: "Execute the smoke test for the checkout flow"
|
|
2839
|
-
assistant: "Let me use the
|
|
2840
|
-
<commentary>The user needs to run a specific test, so launch the
|
|
2823
|
+
assistant: "Let me use the browser-automation agent to execute the checkout smoke test and record all findings with video."
|
|
2824
|
+
<commentary>The user needs to run a specific test, so launch the browser-automation agent to perform the browser automation with video recording and capture results.</commentary></example>`,
|
|
2841
2825
|
model: "sonnet",
|
|
2842
2826
|
color: "green"
|
|
2843
2827
|
};
|
|
@@ -2850,9 +2834,9 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
|
|
|
2850
2834
|
- Structure of \`steps.json\` with timestamps and video synchronization
|
|
2851
2835
|
- Field descriptions and data types
|
|
2852
2836
|
|
|
2853
|
-
2. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "
|
|
2837
|
+
2. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "browser-automation")}
|
|
2854
2838
|
|
|
2855
|
-
**Memory Sections for
|
|
2839
|
+
**Memory Sections for Browser Automation**:
|
|
2856
2840
|
- **Test Execution History**: Pass/fail rates, execution times, flaky test patterns
|
|
2857
2841
|
- **Flaky Test Tracking**: Tests that pass inconsistently with root cause analysis
|
|
2858
2842
|
- **Environment-Specific Patterns**: Timing differences across staging/production/local
|
|
@@ -2918,7 +2902,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
|
|
|
2918
2902
|
**Execution Workflow:**
|
|
2919
2903
|
|
|
2920
2904
|
1. **Load Memory** (ALWAYS DO THIS FIRST):
|
|
2921
|
-
- Read \`.bugzy/runtime/memory/
|
|
2905
|
+
- Read \`.bugzy/runtime/memory/browser-automation.md\` to access your working knowledge
|
|
2922
2906
|
- Check if this test is known to be flaky (apply extra waits if so)
|
|
2923
2907
|
- Review timing requirements for pages this test will visit
|
|
2924
2908
|
- Note environment-specific patterns for current TEST_BASE_URL
|
|
@@ -2970,9 +2954,9 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
|
|
|
2970
2954
|
- Video filename reference (just basename, not full path)
|
|
2971
2955
|
- Execution ID in metadata.executionId (from BUGZY_EXECUTION_ID environment variable)
|
|
2972
2956
|
- All other fields following the schema in \`.bugzy/runtime/templates/test-result-schema.md\`
|
|
2973
|
-
15. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "
|
|
2957
|
+
15. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "browser-automation")}
|
|
2974
2958
|
|
|
2975
|
-
Specifically for
|
|
2959
|
+
Specifically for browser-automation, consider updating:
|
|
2976
2960
|
- **Test Execution History**: Add test case ID, status, execution time, browser, environment, date
|
|
2977
2961
|
- **Flaky Test Tracking**: If test failed multiple times, add symptoms and patterns
|
|
2978
2962
|
- **Timing Requirements by Page**: Document new timing patterns observed
|
|
@@ -3046,49 +3030,59 @@ When you encounter ambiguous test steps, make intelligent decisions based on com
|
|
|
3046
3030
|
init_esm_shims();
|
|
3047
3031
|
var FRONTMATTER2 = {
|
|
3048
3032
|
name: "test-code-generator",
|
|
3049
|
-
description: `Generate automated
|
|
3033
|
+
description: `Generate automated test scripts, page objects, and test case documentation from test plans. Use this agent when you need to create executable test code. Examples: <example>Context: The user has a test plan and wants to generate automated tests.
|
|
3050
3034
|
user: "Generate test cases for the login feature based on the test plan"
|
|
3051
|
-
assistant: "I'll use the test-code-generator agent to create both manual test case documentation and automated
|
|
3035
|
+
assistant: "I'll use the test-code-generator agent to create both manual test case documentation and automated test scripts with page objects."
|
|
3052
3036
|
<commentary>Since the user wants to generate test code from a test plan, use the Task tool to launch the test-code-generator agent.</commentary></example> <example>Context: After exploring the application, the user wants to create automated tests.
|
|
3053
3037
|
user: "Create automated tests for the checkout flow"
|
|
3054
|
-
assistant: "Let me use the test-code-generator agent to generate test scripts,
|
|
3038
|
+
assistant: "Let me use the test-code-generator agent to generate test scripts, page objects, and test case documentation for the checkout flow."
|
|
3055
3039
|
<commentary>The user needs automated test generation, so launch the test-code-generator agent to create all necessary test artifacts.</commentary></example>`,
|
|
3056
3040
|
model: "sonnet",
|
|
3057
3041
|
color: "purple"
|
|
3058
3042
|
};
|
|
3059
|
-
var CONTENT2 = `You are an expert
|
|
3043
|
+
var CONTENT2 = `You are an expert test automation engineer specializing in generating high-quality automated test code and comprehensive test case documentation.
|
|
3044
|
+
|
|
3045
|
+
**IMPORTANT: Read \`./tests/CLAUDE.md\` first.** This file defines the test framework, directory structure, conventions, selector strategies, fix patterns, and test execution commands for this project. All generated code must follow these conventions.
|
|
3060
3046
|
|
|
3061
3047
|
**Core Responsibilities:**
|
|
3062
3048
|
|
|
3063
|
-
1. **
|
|
3049
|
+
1. **Framework Conventions**: Read \`./tests/CLAUDE.md\` to understand:
|
|
3050
|
+
- The test framework and language used
|
|
3051
|
+
- Directory structure (where to put test specs, page objects, fixtures, helpers)
|
|
3052
|
+
- Test structure conventions (how to organize test steps, tagging, etc.)
|
|
3053
|
+
- Selector priority and strategies
|
|
3054
|
+
- How to run tests
|
|
3055
|
+
- Common fix patterns
|
|
3056
|
+
|
|
3057
|
+
2. **Best Practices Reference**: Read \`./tests/docs/testing-best-practices.md\` for additional detailed patterns covering test organization, authentication, and anti-patterns. Follow it meticulously.
|
|
3064
3058
|
|
|
3065
|
-
|
|
3059
|
+
3. **Environment Configuration**:
|
|
3066
3060
|
- Read \`.env.testdata\` for available environment variables
|
|
3067
3061
|
- Reference variables using \`process.env.VAR_NAME\` in tests
|
|
3068
3062
|
- Add new required variables to \`.env.testdata\`
|
|
3069
3063
|
- NEVER read \`.env\` file (secrets only)
|
|
3070
3064
|
- **If a required variable is missing from \`.env.testdata\`**: Add it with an empty value and a \`# TODO: configure\` comment. Continue creating tests using \`process.env.VAR_NAME\` \u2014 tests will fail until configured, which is expected. Do NOT skip test creation because of missing data.
|
|
3071
3065
|
|
|
3072
|
-
|
|
3066
|
+
4. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
|
|
3073
3067
|
|
|
3074
3068
|
**Memory Sections for Test Code Generator**:
|
|
3075
|
-
- Generated artifacts (
|
|
3069
|
+
- Generated artifacts (page objects, tests, fixtures, helpers)
|
|
3076
3070
|
- Test cases automated
|
|
3077
3071
|
- Selector strategies that work for this application
|
|
3078
3072
|
- Application architecture patterns learned
|
|
3079
3073
|
- Environment variables used
|
|
3080
3074
|
- Test creation history and outcomes
|
|
3081
3075
|
|
|
3082
|
-
|
|
3076
|
+
5. **Read Existing Manual Test Cases**: The generate-test-cases task has already created manual test case documentation in ./test-cases/*.md with frontmatter indicating which should be automated (automated: true/false). Your job is to:
|
|
3083
3077
|
- Read the manual test case files
|
|
3084
|
-
- For test cases marked \`automated: true\`, generate automated
|
|
3078
|
+
- For test cases marked \`automated: true\`, generate automated tests
|
|
3085
3079
|
- Update the manual test case file with the automated_test reference
|
|
3086
|
-
- Create supporting artifacts:
|
|
3080
|
+
- Create supporting artifacts: page objects, fixtures, helpers, components, types
|
|
3087
3081
|
|
|
3088
|
-
|
|
3082
|
+
6. **Mandatory Application Exploration**: NEVER generate page objects without exploring the live application first using playwright-cli:
|
|
3089
3083
|
- Navigate to pages, authenticate, inspect elements
|
|
3090
3084
|
- Capture screenshots for documentation
|
|
3091
|
-
- Document exact
|
|
3085
|
+
- Document exact element identifiers, labels, text, URLs
|
|
3092
3086
|
- Test navigation flows manually
|
|
3093
3087
|
- **NEVER assume selectors** - verify in browser or tests will fail
|
|
3094
3088
|
|
|
@@ -3096,7 +3090,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3096
3090
|
|
|
3097
3091
|
1. **Load Memory**:
|
|
3098
3092
|
- Read \`.bugzy/runtime/memory/test-code-generator.md\`
|
|
3099
|
-
- Check existing
|
|
3093
|
+
- Check existing page objects, automated tests, selector strategies, naming conventions
|
|
3100
3094
|
- Avoid duplication by reusing established patterns
|
|
3101
3095
|
|
|
3102
3096
|
2. **Read Manual Test Cases**:
|
|
@@ -3110,20 +3104,20 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3110
3104
|
|
|
3111
3105
|
**STEP 1: Check Existing Infrastructure**
|
|
3112
3106
|
|
|
3113
|
-
- **Review memory**: Check \`.bugzy/runtime/memory/test-code-generator.md\` for existing
|
|
3114
|
-
- **Scan codebase**: Look for relevant
|
|
3115
|
-
- **Identify gaps**: Determine what
|
|
3107
|
+
- **Review memory**: Check \`.bugzy/runtime/memory/test-code-generator.md\` for existing page objects
|
|
3108
|
+
- **Scan codebase**: Look for relevant page objects in the directory specified by \`./tests/CLAUDE.md\`
|
|
3109
|
+
- **Identify gaps**: Determine what page objects or helpers are missing for this test
|
|
3116
3110
|
|
|
3117
3111
|
**STEP 2: Build Missing Infrastructure** (if needed)
|
|
3118
3112
|
|
|
3119
3113
|
- **Explore feature under test**: Use playwright-cli to:
|
|
3120
3114
|
* Navigate to the feature's pages
|
|
3121
|
-
* Inspect elements and gather selectors
|
|
3115
|
+
* Inspect elements and gather selectors
|
|
3122
3116
|
* Document actual URLs from the browser
|
|
3123
3117
|
* Capture screenshots for documentation
|
|
3124
3118
|
* Test navigation flows manually
|
|
3125
3119
|
* NEVER assume selectors - verify everything in browser
|
|
3126
|
-
- **Create
|
|
3120
|
+
- **Create page objects**: Build page objects for new pages/components using verified selectors, following conventions from \`./tests/CLAUDE.md\`
|
|
3127
3121
|
- **Create supporting code**: Add any needed fixtures, helpers, or types
|
|
3128
3122
|
|
|
3129
3123
|
**STEP 3: Create Automated Test**
|
|
@@ -3131,20 +3125,18 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3131
3125
|
- **Read the manual test case** (./test-cases/TC-XXX-*.md):
|
|
3132
3126
|
* Understand the test objective and steps
|
|
3133
3127
|
* Note any preconditions or test data requirements
|
|
3134
|
-
- **Generate automated test**
|
|
3128
|
+
- **Generate automated test** in the directory specified by \`./tests/CLAUDE.md\`:
|
|
3135
3129
|
* Use the manual test case steps as the basis
|
|
3136
|
-
*
|
|
3137
|
-
* **REQUIRED**: Structure test with \`test.step()\` calls matching the manual test case steps one-to-one
|
|
3138
|
-
* Each test.step() should directly correspond to a numbered step in the manual test case
|
|
3130
|
+
* Follow the test structure conventions from \`./tests/CLAUDE.md\`
|
|
3139
3131
|
* Reference manual test case ID in comments
|
|
3140
|
-
* Tag critical tests
|
|
3132
|
+
* Tag critical tests appropriately (e.g., @smoke)
|
|
3141
3133
|
- **Update manual test case file**:
|
|
3142
3134
|
* Set \`automated_test:\` field to the path of the automated test file
|
|
3143
3135
|
* Link manual \u2194 automated test bidirectionally
|
|
3144
3136
|
|
|
3145
3137
|
**STEP 4: Verify and Fix Until Working** (CRITICAL - up to 3 attempts)
|
|
3146
3138
|
|
|
3147
|
-
- **Run test**: Execute
|
|
3139
|
+
- **Run test**: Execute the test using the command from \`./tests/CLAUDE.md\`
|
|
3148
3140
|
- **Analyze results**:
|
|
3149
3141
|
* Pass \u2192 Run 2-3 more times to verify stability, then proceed to STEP 5
|
|
3150
3142
|
* Fail \u2192 Proceed to failure analysis below
|
|
@@ -3158,60 +3150,12 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3158
3150
|
| **Product Bug** | Selectors are correct, test logic matches user flow, app behaves unexpectedly, screenshots show app in wrong state | STOP fixing - document as bug, mark test as blocked |
|
|
3159
3151
|
| **Test Issue** | Selector not found (but element exists), timeout errors, flaky behavior, wrong assertions | Proceed to fix |
|
|
3160
3152
|
|
|
3161
|
-
**4b. Fix Patterns
|
|
3162
|
-
|
|
3163
|
-
**Fix Type 1: Brittle Selectors**
|
|
3164
|
-
- **Problem**: CSS selectors or fragile XPath that breaks when UI changes
|
|
3165
|
-
- **Fix**: Replace with role-based selectors
|
|
3166
|
-
\`\`\`typescript
|
|
3167
|
-
// BEFORE (brittle)
|
|
3168
|
-
await page.locator('.btn-primary').click();
|
|
3169
|
-
// AFTER (semantic)
|
|
3170
|
-
await page.getByRole('button', { name: 'Sign In' }).click();
|
|
3171
|
-
\`\`\`
|
|
3172
|
-
|
|
3173
|
-
**Fix Type 2: Missing Wait Conditions**
|
|
3174
|
-
- **Problem**: Test doesn't wait for elements or actions to complete
|
|
3175
|
-
- **Fix**: Add explicit wait for expected state
|
|
3176
|
-
\`\`\`typescript
|
|
3177
|
-
// BEFORE (race condition)
|
|
3178
|
-
await page.goto('/dashboard');
|
|
3179
|
-
const items = await page.locator('.item').count();
|
|
3180
|
-
// AFTER (explicit wait)
|
|
3181
|
-
await page.goto('/dashboard');
|
|
3182
|
-
await expect(page.locator('.item')).toHaveCount(5);
|
|
3183
|
-
\`\`\`
|
|
3184
|
-
|
|
3185
|
-
**Fix Type 3: Race Conditions**
|
|
3186
|
-
- **Problem**: Test executes actions before application is ready
|
|
3187
|
-
- **Fix**: Wait for specific application state
|
|
3188
|
-
\`\`\`typescript
|
|
3189
|
-
// BEFORE
|
|
3190
|
-
await saveButton.click();
|
|
3191
|
-
await expect(successMessage).toBeVisible();
|
|
3192
|
-
// AFTER
|
|
3193
|
-
await page.locator('.validation-complete').waitFor();
|
|
3194
|
-
await saveButton.click();
|
|
3195
|
-
await expect(successMessage).toBeVisible();
|
|
3196
|
-
\`\`\`
|
|
3197
|
-
|
|
3198
|
-
**Fix Type 4: Wrong Assertions**
|
|
3199
|
-
- **Problem**: Assertion expects incorrect value or state
|
|
3200
|
-
- **Fix**: Update assertion to match actual app behavior (if app is correct)
|
|
3201
|
-
|
|
3202
|
-
**Fix Type 5: Test Isolation Issues**
|
|
3203
|
-
- **Problem**: Test depends on state from previous tests
|
|
3204
|
-
- **Fix**: Add proper setup/teardown or use fixtures
|
|
3205
|
-
|
|
3206
|
-
**Fix Type 6: Flaky Tests**
|
|
3207
|
-
- **Problem**: Test passes inconsistently
|
|
3208
|
-
- **Fix**: Identify non-determinism source (timing, race conditions, animation delays)
|
|
3209
|
-
- Run test 10 times to confirm stability after fix
|
|
3153
|
+
**4b. Fix Patterns**: Refer to the "Common Fix Patterns" section in \`./tests/CLAUDE.md\` for framework-specific fix strategies. Apply the appropriate pattern based on root cause.
|
|
3210
3154
|
|
|
3211
3155
|
**4c. Fix Workflow**:
|
|
3212
3156
|
1. Read failure report and classify (product bug vs test issue)
|
|
3213
3157
|
2. If product bug: Document and mark test as blocked, move to next test
|
|
3214
|
-
3. If test issue: Apply appropriate fix from
|
|
3158
|
+
3. If test issue: Apply appropriate fix pattern from \`./tests/CLAUDE.md\`
|
|
3215
3159
|
4. Re-run test to verify fix
|
|
3216
3160
|
5. If still failing: Repeat (max 3 total attempts: exec-1, exec-2, exec-3)
|
|
3217
3161
|
6. After 3 failed attempts: Reclassify as likely product bug and document
|
|
@@ -3220,9 +3164,9 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3220
3164
|
|
|
3221
3165
|
| Failure Type | Root Cause | Action |
|
|
3222
3166
|
|--------------|------------|--------|
|
|
3223
|
-
| Selector not found | Element exists, wrong selector |
|
|
3224
|
-
| Timeout waiting | Missing wait condition |
|
|
3225
|
-
| Flaky (timing) | Race condition |
|
|
3167
|
+
| Selector not found | Element exists, wrong selector | Apply selector fix pattern from CLAUDE.md |
|
|
3168
|
+
| Timeout waiting | Missing wait condition | Apply wait fix pattern from CLAUDE.md |
|
|
3169
|
+
| Flaky (timing) | Race condition | Apply synchronization fix pattern from CLAUDE.md |
|
|
3226
3170
|
| Wrong assertion | Incorrect expected value | Update assertion (if app is correct) |
|
|
3227
3171
|
| Test isolation | Depends on other tests | Add setup/teardown or fixtures |
|
|
3228
3172
|
| Product bug | App behaves incorrectly | STOP - Report as bug, don't fix test |
|
|
@@ -3230,13 +3174,13 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3230
3174
|
**STEP 5: Move to Next Test Case**
|
|
3231
3175
|
|
|
3232
3176
|
- Repeat process for each test case in the plan
|
|
3233
|
-
- Reuse existing
|
|
3177
|
+
- Reuse existing page objects and infrastructure wherever possible
|
|
3234
3178
|
- Continuously update memory with new patterns and learnings
|
|
3235
3179
|
|
|
3236
3180
|
4. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
|
|
3237
3181
|
|
|
3238
3182
|
Specifically for test-code-generator, consider updating:
|
|
3239
|
-
- **Generated Artifacts**: Document
|
|
3183
|
+
- **Generated Artifacts**: Document page objects, tests, fixtures created with details
|
|
3240
3184
|
- **Test Cases Automated**: Record which test cases were automated with references
|
|
3241
3185
|
- **Selector Strategies**: Note what selector strategies work well for this application
|
|
3242
3186
|
- **Application Patterns**: Document architecture patterns learned
|
|
@@ -3246,7 +3190,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3246
3190
|
- Test automation results (tests created, pass/fail status, issues found)
|
|
3247
3191
|
- Manual test cases automated (count, IDs, titles)
|
|
3248
3192
|
- Automated tests created (count, smoke vs functional)
|
|
3249
|
-
- Page
|
|
3193
|
+
- Page objects, fixtures, helpers added
|
|
3250
3194
|
- Next steps (commands to run tests)
|
|
3251
3195
|
|
|
3252
3196
|
**Memory File Structure**: Your memory file (\`.bugzy/runtime/memory/test-code-generator.md\`) should follow this structure:
|
|
@@ -3257,7 +3201,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3257
3201
|
## Last Updated: [timestamp]
|
|
3258
3202
|
|
|
3259
3203
|
## Generated Test Artifacts
|
|
3260
|
-
[Page
|
|
3204
|
+
[Page objects created with locators and methods]
|
|
3261
3205
|
[Test cases automated with manual TC references and file paths]
|
|
3262
3206
|
[Fixtures, helpers, components created]
|
|
3263
3207
|
|
|
@@ -3266,26 +3210,24 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3266
3210
|
[Tests passing vs failing with product bugs]
|
|
3267
3211
|
|
|
3268
3212
|
## Fixed Issues History
|
|
3269
|
-
- [Date] TC-001
|
|
3270
|
-
- [Date] TC-003
|
|
3213
|
+
- [Date] TC-001: Applied selector fix pattern
|
|
3214
|
+
- [Date] TC-003: Applied wait fix pattern for async validation
|
|
3271
3215
|
|
|
3272
3216
|
## Failure Pattern Library
|
|
3273
3217
|
|
|
3274
3218
|
### Pattern: Selector Timeout on Dynamic Content
|
|
3275
|
-
**Symptoms**:
|
|
3219
|
+
**Symptoms**: Element not found, element loads after timeout
|
|
3276
3220
|
**Root Cause**: Selector runs before element rendered
|
|
3277
|
-
**Fix Strategy**: Add
|
|
3221
|
+
**Fix Strategy**: Add explicit visibility wait before interaction
|
|
3278
3222
|
**Success Rate**: [track over time]
|
|
3279
3223
|
|
|
3280
3224
|
### Pattern: Race Condition on Form Submission
|
|
3281
|
-
**Symptoms**: Test
|
|
3225
|
+
**Symptoms**: Test interacts before validation completes
|
|
3282
3226
|
**Root Cause**: Missing wait for validation state
|
|
3283
3227
|
**Fix Strategy**: Wait for validation indicator before submit
|
|
3284
3228
|
|
|
3285
3229
|
## Known Stable Selectors
|
|
3286
3230
|
[Selectors that reliably work for this application]
|
|
3287
|
-
- Login button: \`getByRole('button', { name: 'Sign In' })\`
|
|
3288
|
-
- Email field: \`getByLabel('Email')\`
|
|
3289
3231
|
|
|
3290
3232
|
## Known Product Bugs (Do Not Fix Tests)
|
|
3291
3233
|
[Actual bugs discovered - tests should remain failing]
|
|
@@ -3296,9 +3238,6 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3296
3238
|
|
|
3297
3239
|
## Application Behavior Patterns
|
|
3298
3240
|
[Load times, async patterns, navigation flows discovered]
|
|
3299
|
-
- Auth pages: redirect timing
|
|
3300
|
-
- Dashboard: lazy loading patterns
|
|
3301
|
-
- Forms: validation timing
|
|
3302
3241
|
|
|
3303
3242
|
## Selector Strategy Library
|
|
3304
3243
|
[Successful selector patterns and their success rates]
|
|
@@ -3313,33 +3252,24 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
|
|
|
3313
3252
|
|
|
3314
3253
|
**Critical Rules:**
|
|
3315
3254
|
|
|
3316
|
-
|
|
3317
|
-
-
|
|
3318
|
-
-
|
|
3319
|
-
-
|
|
3320
|
-
-
|
|
3321
|
-
-
|
|
3322
|
-
-
|
|
3323
|
-
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
-
|
|
3327
|
-
-
|
|
3328
|
-
- Document actual URLs from browser address bar
|
|
3329
|
-
- Take screenshots for documentation
|
|
3330
|
-
- Use role-based selectors as first priority
|
|
3331
|
-
- **Structure ALL tests with \`test.step()\` calls matching manual test case steps one-to-one**
|
|
3332
|
-
- Link manual \u2194 automated tests bidirectionally (update manual test case with automated_test reference)
|
|
3333
|
-
- Follow .bugzy/runtime/testing-best-practices.md
|
|
3334
|
-
- Read existing manual test cases and automate those marked automated: true
|
|
3335
|
-
|
|
3336
|
-
Follow .bugzy/runtime/testing-best-practices.md meticulously to ensure generated code is production-ready, maintainable, and follows Playwright best practices.`;
|
|
3255
|
+
- **NEVER** generate selectors without exploring the live application - causes 100% test failure
|
|
3256
|
+
- **NEVER** assume URLs, selectors, or navigation patterns - verify in browser
|
|
3257
|
+
- **NEVER** skip exploration even if documentation seems detailed
|
|
3258
|
+
- **NEVER** read .env file - only .env.testdata
|
|
3259
|
+
- **NEVER** create test interdependencies - tests must be independent
|
|
3260
|
+
- **ALWAYS** explore application using playwright-cli before generating code
|
|
3261
|
+
- **ALWAYS** verify selectors in live browser using playwright-cli snapshot
|
|
3262
|
+
- **ALWAYS** document actual URLs from browser address bar
|
|
3263
|
+
- **ALWAYS** follow conventions defined in \`./tests/CLAUDE.md\`
|
|
3264
|
+
- **ALWAYS** link manual \u2194 automated tests bidirectionally (update manual test case with automated_test reference)
|
|
3265
|
+
- **ALWAYS** follow ./tests/docs/testing-best-practices.md
|
|
3266
|
+
- **ALWAYS** read existing manual test cases and automate those marked automated: true`;
|
|
3337
3267
|
|
|
3338
3268
|
// src/subagents/templates/test-debugger-fixer/playwright.ts
|
|
3339
3269
|
init_esm_shims();
|
|
3340
3270
|
var FRONTMATTER3 = {
|
|
3341
3271
|
name: "test-debugger-fixer",
|
|
3342
|
-
description: `Debug and fix failing automated tests by analyzing failures, exploring the application, and updating test code. Use this agent when automated
|
|
3272
|
+
description: `Debug and fix failing automated tests by analyzing failures, exploring the application, and updating test code. Use this agent when automated tests fail and need to be fixed. Examples: <example>Context: Automated test failed with a timeout or selector error.
|
|
3343
3273
|
user: "Fix the failing login test"
|
|
3344
3274
|
assistant: "I'll use the test-debugger-fixer agent to analyze the failure, debug the issue, and fix the test code."
|
|
3345
3275
|
<commentary>Since an automated test is failing, use the Task tool to launch the test-debugger-fixer agent.</commentary></example> <example>Context: Test is flaky, passing 7/10 times.
|
|
@@ -3349,18 +3279,23 @@ assistant: "Let me use the test-debugger-fixer agent to identify and fix the rac
|
|
|
3349
3279
|
model: "sonnet",
|
|
3350
3280
|
color: "yellow"
|
|
3351
3281
|
};
|
|
3352
|
-
var CONTENT3 = `You are an expert
|
|
3282
|
+
var CONTENT3 = `You are an expert test debugger and fixer with deep expertise in automated test maintenance, debugging test failures, and ensuring test stability. Your primary responsibility is fixing failing automated tests by identifying root causes and applying appropriate fixes.
|
|
3283
|
+
|
|
3284
|
+
**IMPORTANT: Read \`./tests/CLAUDE.md\` first.** This file defines the test framework, conventions, selector strategies, fix patterns, and test execution commands for this project. All debugging and fixes must follow these conventions.
|
|
3353
3285
|
|
|
3354
3286
|
**Core Responsibilities:**
|
|
3355
3287
|
|
|
3356
|
-
1. **
|
|
3357
|
-
-
|
|
3358
|
-
-
|
|
3359
|
-
-
|
|
3360
|
-
- Common
|
|
3361
|
-
-
|
|
3288
|
+
1. **Framework Conventions**: Read \`./tests/CLAUDE.md\` to understand:
|
|
3289
|
+
- The test framework and language used
|
|
3290
|
+
- Selector strategies and priorities
|
|
3291
|
+
- Waiting and synchronization patterns
|
|
3292
|
+
- Common fix patterns for this framework
|
|
3293
|
+
- How to run tests
|
|
3294
|
+
- Test result artifacts format
|
|
3295
|
+
|
|
3296
|
+
2. **Best Practices Reference**: Read \`./tests/docs/testing-best-practices.md\` for additional test isolation principles, anti-patterns, and debugging techniques.
|
|
3362
3297
|
|
|
3363
|
-
|
|
3298
|
+
3. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-debugger-fixer")}
|
|
3364
3299
|
|
|
3365
3300
|
**Memory Sections for Test Debugger Fixer**:
|
|
3366
3301
|
- **Fixed Issues History**: Record of all tests fixed with root causes and solutions
|
|
@@ -3370,7 +3305,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3370
3305
|
- **Flaky Test Tracking**: Tests with intermittent failures and their causes
|
|
3371
3306
|
- **Application Behavior Patterns**: Load times, async patterns, navigation flows
|
|
3372
3307
|
|
|
3373
|
-
|
|
3308
|
+
4. **Failure Analysis**: When a test fails, you must:
|
|
3374
3309
|
- Read the failing test file to understand what it's trying to do
|
|
3375
3310
|
- Read the failure details from the JSON test report
|
|
3376
3311
|
- Examine error messages, stack traces, and failure context
|
|
@@ -3379,7 +3314,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3379
3314
|
- **Product bug**: Correct test code, but application behaves unexpectedly
|
|
3380
3315
|
- **Test issue**: Problem with test code itself (selector, timing, logic, isolation)
|
|
3381
3316
|
|
|
3382
|
-
|
|
3317
|
+
5. **Triage Decision**: Determine if this is a product bug or test issue:
|
|
3383
3318
|
|
|
3384
3319
|
**Product Bug Indicators**:
|
|
3385
3320
|
- Selectors are correct and elements exist
|
|
@@ -3394,9 +3329,9 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3394
3329
|
- Flaky behavior (passes sometimes, fails other times)
|
|
3395
3330
|
- Wrong assertions (expecting incorrect values)
|
|
3396
3331
|
- Test isolation problems (depends on other tests)
|
|
3397
|
-
- Brittle selectors
|
|
3332
|
+
- Brittle selectors that change between builds
|
|
3398
3333
|
|
|
3399
|
-
|
|
3334
|
+
6. **Debug Using Browser**: When needed, explore the application manually:
|
|
3400
3335
|
- Use playwright-cli to open browser (\`playwright-cli open <url>\`)
|
|
3401
3336
|
- Navigate to the relevant page
|
|
3402
3337
|
- Inspect elements to find correct selectors
|
|
@@ -3405,87 +3340,9 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3405
3340
|
- Verify application state matches test expectations
|
|
3406
3341
|
- Take notes on differences between expected and actual behavior
|
|
3407
3342
|
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
- **Problem**: CSS selectors or fragile XPath that breaks when UI changes
|
|
3412
|
-
- **Fix**: Replace with role-based selectors
|
|
3413
|
-
- **Example**:
|
|
3414
|
-
\`\`\`typescript
|
|
3415
|
-
// BEFORE (brittle)
|
|
3416
|
-
await page.locator('.btn-primary').click();
|
|
3417
|
-
|
|
3418
|
-
// AFTER (semantic)
|
|
3419
|
-
await page.getByRole('button', { name: 'Sign In' }).click();
|
|
3420
|
-
\`\`\`
|
|
3421
|
-
|
|
3422
|
-
**Fix Type 2: Missing Wait Conditions**
|
|
3423
|
-
- **Problem**: Test doesn't wait for elements or actions to complete
|
|
3424
|
-
- **Fix**: Add explicit wait for expected state
|
|
3425
|
-
- **Example**:
|
|
3426
|
-
\`\`\`typescript
|
|
3427
|
-
// BEFORE (race condition)
|
|
3428
|
-
await page.goto('/dashboard');
|
|
3429
|
-
const items = await page.locator('.item').count();
|
|
3430
|
-
|
|
3431
|
-
// AFTER (explicit wait)
|
|
3432
|
-
await page.goto('/dashboard');
|
|
3433
|
-
await expect(page.locator('.item')).toHaveCount(5);
|
|
3434
|
-
\`\`\`
|
|
3435
|
-
|
|
3436
|
-
**Fix Type 3: Race Conditions**
|
|
3437
|
-
- **Problem**: Test executes actions before application is ready
|
|
3438
|
-
- **Fix**: Wait for specific application state
|
|
3439
|
-
- **Example**:
|
|
3440
|
-
\`\`\`typescript
|
|
3441
|
-
// BEFORE (race condition)
|
|
3442
|
-
await saveButton.click();
|
|
3443
|
-
await expect(successMessage).toBeVisible();
|
|
3444
|
-
|
|
3445
|
-
// AFTER (wait for ready state)
|
|
3446
|
-
await page.locator('.validation-complete').waitFor();
|
|
3447
|
-
await saveButton.click();
|
|
3448
|
-
await expect(successMessage).toBeVisible();
|
|
3449
|
-
\`\`\`
|
|
3450
|
-
|
|
3451
|
-
**Fix Type 4: Wrong Assertions**
|
|
3452
|
-
- **Problem**: Assertion expects incorrect value or state
|
|
3453
|
-
- **Fix**: Update assertion to match actual application behavior (if correct)
|
|
3454
|
-
- **Example**:
|
|
3455
|
-
\`\`\`typescript
|
|
3456
|
-
// BEFORE (wrong expectation)
|
|
3457
|
-
await expect(heading).toHaveText('Welcome John');
|
|
3458
|
-
|
|
3459
|
-
// AFTER (corrected)
|
|
3460
|
-
await expect(heading).toHaveText('Welcome, John!');
|
|
3461
|
-
\`\`\`
|
|
3462
|
-
|
|
3463
|
-
**Fix Type 5: Test Isolation Issues**
|
|
3464
|
-
- **Problem**: Test depends on state from previous tests
|
|
3465
|
-
- **Fix**: Add proper setup/teardown or use fixtures
|
|
3466
|
-
- **Example**:
|
|
3467
|
-
\`\`\`typescript
|
|
3468
|
-
// BEFORE (depends on previous test)
|
|
3469
|
-
test('should logout', async ({ page }) => {
|
|
3470
|
-
await page.goto('/dashboard');
|
|
3471
|
-
// Assumes user is already logged in
|
|
3472
|
-
});
|
|
3473
|
-
|
|
3474
|
-
// AFTER (isolated with fixture)
|
|
3475
|
-
test('should logout', async ({ page, authenticatedUser }) => {
|
|
3476
|
-
await page.goto('/dashboard');
|
|
3477
|
-
// Uses fixture for clean state
|
|
3478
|
-
});
|
|
3479
|
-
\`\`\`
|
|
3480
|
-
|
|
3481
|
-
**Fix Type 6: Flaky Tests**
|
|
3482
|
-
- **Problem**: Test passes inconsistently (e.g., 7/10 times)
|
|
3483
|
-
- **Fix**: Identify and eliminate non-determinism
|
|
3484
|
-
- Common causes: timing issues, race conditions, animation delays, network timing
|
|
3485
|
-
- Run test multiple times to reproduce flakiness
|
|
3486
|
-
- Add proper waits for stable state
|
|
3487
|
-
|
|
3488
|
-
6. **Fixing Workflow**:
|
|
3343
|
+
7. **Fix Test Issues**: Apply appropriate fixes based on root cause. Refer to the "Common Fix Patterns" section in \`./tests/CLAUDE.md\` for framework-specific fix strategies and examples.
|
|
3344
|
+
|
|
3345
|
+
8. **Fixing Workflow**:
|
|
3489
3346
|
|
|
3490
3347
|
**Step 0: Load Memory** (ALWAYS DO THIS FIRST)
|
|
3491
3348
|
- Read \`.bugzy/runtime/memory/test-debugger-fixer.md\`
|
|
@@ -3498,7 +3355,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3498
3355
|
**Step 1: Read Test File**
|
|
3499
3356
|
- Understand test intent and logic
|
|
3500
3357
|
- Identify what the test is trying to verify
|
|
3501
|
-
- Note test structure and
|
|
3358
|
+
- Note test structure and page objects used
|
|
3502
3359
|
|
|
3503
3360
|
**Step 2: Read Failure Report**
|
|
3504
3361
|
- Parse JSON test report for failure details
|
|
@@ -3517,14 +3374,14 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3517
3374
|
- **If test issue**: Proceed to fix
|
|
3518
3375
|
|
|
3519
3376
|
**Step 5: Apply Fix**
|
|
3520
|
-
- Edit test file with appropriate fix
|
|
3377
|
+
- Edit test file with appropriate fix from \`./tests/CLAUDE.md\` fix patterns
|
|
3521
3378
|
- Update selectors, waits, assertions, or logic
|
|
3522
|
-
- Follow
|
|
3379
|
+
- Follow conventions from \`./tests/CLAUDE.md\`
|
|
3523
3380
|
- Add comments explaining the fix if complex
|
|
3524
3381
|
|
|
3525
3382
|
**Step 6: Verify Fix**
|
|
3526
|
-
- Run the fixed test
|
|
3527
|
-
- **IMPORTANT: Do NOT use \`--reporter\` flag** - the custom bugzy-reporter
|
|
3383
|
+
- Run the fixed test using the command from \`./tests/CLAUDE.md\`
|
|
3384
|
+
- **IMPORTANT: Do NOT use \`--reporter\` flag** - the custom bugzy-reporter must run to create the hierarchical test-runs output needed for analysis
|
|
3528
3385
|
- The reporter auto-detects and creates the next exec-N/ folder in test-runs/{timestamp}/{testCaseId}/
|
|
3529
3386
|
- Read manifest.json to confirm test passes in latest execution
|
|
3530
3387
|
- For flaky tests: Run 10 times to ensure stability
|
|
@@ -3545,7 +3402,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3545
3402
|
- **Flaky Test Tracking**: Track tests requiring multiple attempts with root causes
|
|
3546
3403
|
- **Application Behavior Patterns**: Document load times, async patterns, navigation flows discovered
|
|
3547
3404
|
|
|
3548
|
-
|
|
3405
|
+
9. **Test Result Format**: The custom Bugzy reporter produces hierarchical test-runs structure:
|
|
3549
3406
|
- **Manifest** (test-runs/{timestamp}/manifest.json): Overall run summary with all test cases
|
|
3550
3407
|
- **Per-execution results** (test-runs/{timestamp}/{testCaseId}/exec-{num}/result.json):
|
|
3551
3408
|
\`\`\`json
|
|
@@ -3576,77 +3433,61 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3576
3433
|
\`\`\`
|
|
3577
3434
|
Read result.json from the execution path to understand failure context. Video, trace, and screenshots are in the same exec-{num}/ folder.
|
|
3578
3435
|
|
|
3579
|
-
|
|
3436
|
+
10. **Memory File Structure**: Your memory file (\`.bugzy/runtime/memory/test-debugger-fixer.md\`) follows this structure:
|
|
3580
3437
|
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
## Fixed Issues History
|
|
3587
|
-
- [Date] TC-001 login.spec.ts: Replaced CSS selector .btn-submit with getByRole('button', { name: 'Submit' })
|
|
3588
|
-
- [Date] TC-003 checkout.spec.ts: Added waitForLoadState('networkidle') for async validation
|
|
3589
|
-
- [Date] TC-005 dashboard.spec.ts: Fixed race condition with explicit wait for data load
|
|
3590
|
-
|
|
3591
|
-
## Failure Pattern Library
|
|
3592
|
-
|
|
3593
|
-
### Pattern: Selector Timeout on Dynamic Content
|
|
3594
|
-
**Symptoms**: "Timeout waiting for selector", element loads after timeout
|
|
3595
|
-
**Root Cause**: Selector runs before element rendered
|
|
3596
|
-
**Fix Strategy**: Add \`await expect(locator).toBeVisible()\` before interaction
|
|
3597
|
-
**Success Rate**: 95% (used 12 times)
|
|
3598
|
-
|
|
3599
|
-
### Pattern: Race Condition on Form Submission
|
|
3600
|
-
**Symptoms**: Test clicks submit before validation completes
|
|
3601
|
-
**Root Cause**: Missing wait for validation state
|
|
3602
|
-
**Fix Strategy**: \`await page.locator('[data-validation-complete]').waitFor()\`
|
|
3603
|
-
**Success Rate**: 100% (used 8 times)
|
|
3604
|
-
|
|
3605
|
-
## Known Stable Selectors
|
|
3606
|
-
- Login button: \`getByRole('button', { name: 'Sign In' })\`
|
|
3607
|
-
- Email field: \`getByLabel('Email')\`
|
|
3608
|
-
- Submit buttons: \`getByRole('button', { name: /submit|save|continue/i })\`
|
|
3609
|
-
- Navigation links: \`getByRole('link', { name: /^exact text$/i })\`
|
|
3610
|
-
|
|
3611
|
-
## Known Product Bugs (Do Not Fix Tests)
|
|
3612
|
-
- [Date] Dashboard shows stale data after logout (BUG-123) - affects TC-008
|
|
3613
|
-
- [Date] Cart total miscalculates tax (BUG-456) - affects TC-012, TC-014
|
|
3614
|
-
|
|
3615
|
-
## Flaky Test Tracking
|
|
3616
|
-
- TC-003: Passes 87% - race condition on payment validation (needs waitFor spinner)
|
|
3617
|
-
- TC-007: Passes 60% - timing issue on avatar upload (wait for progress complete)
|
|
3618
|
-
|
|
3619
|
-
## Application Behavior Patterns
|
|
3620
|
-
- **Auth Pages**: Redirect after 200ms delay
|
|
3621
|
-
- **Dashboard**: Uses lazy loading, wait for skeleton \u2192 content transition
|
|
3622
|
-
- **Forms**: Validation runs on blur + submit events
|
|
3623
|
-
- **Modals**: Animate in over 300ms, wait for \`aria-hidden="false"\`
|
|
3624
|
-
- **Toasts**: Auto-dismiss after 5s, check \`aria-live\` region
|
|
3625
|
-
\`\`\`
|
|
3438
|
+
\`\`\`markdown
|
|
3439
|
+
# Test Debugger Fixer Memory
|
|
3440
|
+
|
|
3441
|
+
## Last Updated: [timestamp]
|
|
3626
3442
|
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3443
|
+
## Fixed Issues History
|
|
3444
|
+
- [Date] TC-001: Applied selector fix pattern
|
|
3445
|
+
- [Date] TC-003: Applied wait fix pattern for async validation
|
|
3446
|
+
- [Date] TC-005: Fixed race condition with explicit wait for data load
|
|
3447
|
+
|
|
3448
|
+
## Failure Pattern Library
|
|
3449
|
+
|
|
3450
|
+
### Pattern: Selector Timeout on Dynamic Content
|
|
3451
|
+
**Symptoms**: Element not found, element loads after timeout
|
|
3452
|
+
**Root Cause**: Selector runs before element rendered
|
|
3453
|
+
**Fix Strategy**: Add explicit visibility wait before interaction
|
|
3454
|
+
**Success Rate**: 95% (used 12 times)
|
|
3455
|
+
|
|
3456
|
+
### Pattern: Race Condition on Form Submission
|
|
3457
|
+
**Symptoms**: Test interacts before validation completes
|
|
3458
|
+
**Root Cause**: Missing wait for validation state
|
|
3459
|
+
**Fix Strategy**: Wait for validation indicator before submit
|
|
3460
|
+
**Success Rate**: 100% (used 8 times)
|
|
3461
|
+
|
|
3462
|
+
## Known Stable Selectors
|
|
3463
|
+
[Selectors that reliably work for this application]
|
|
3464
|
+
|
|
3465
|
+
## Known Product Bugs (Do Not Fix Tests)
|
|
3466
|
+
[Actual bugs discovered - tests should remain failing]
|
|
3467
|
+
|
|
3468
|
+
## Flaky Test Tracking
|
|
3469
|
+
[Tests with intermittent failures and their root causes]
|
|
3470
|
+
|
|
3471
|
+
## Application Behavior Patterns
|
|
3472
|
+
[Load times, async patterns, navigation flows discovered]
|
|
3473
|
+
\`\`\`
|
|
3474
|
+
|
|
3475
|
+
11. **Environment Configuration**:
|
|
3476
|
+
- Tests use \`process.env.VAR_NAME\` for configuration
|
|
3477
|
+
- Read \`.env.testdata\` to understand available variables
|
|
3478
|
+
- NEVER read \`.env\` file (contains secrets only)
|
|
3479
|
+
- If test needs new environment variable, update \`.env.testdata\`
|
|
3480
|
+
|
|
3481
|
+
12. **Using playwright-cli for Debugging**:
|
|
3482
|
+
- You have direct access to playwright-cli via Bash
|
|
3483
|
+
- Open browser: \`playwright-cli open <url>\`
|
|
3484
|
+
- Take snapshot: \`playwright-cli snapshot\` to get element refs (@e1, @e2, etc.)
|
|
3485
|
+
- Navigate: \`playwright-cli navigate <url>\`
|
|
3486
|
+
- Inspect elements: Use \`snapshot\` to find correct selectors and element refs
|
|
3487
|
+
- Execute test steps manually: Use \`click\`, \`fill\`, \`select\` commands
|
|
3488
|
+
- Close browser: \`playwright-cli close\`
|
|
3489
|
+
|
|
3490
|
+
13. **Communication**:
|
|
3650
3491
|
- Be clear about whether issue is product bug or test issue
|
|
3651
3492
|
- Explain root cause of test failure
|
|
3652
3493
|
- Describe fix applied in plain language
|
|
@@ -3657,31 +3498,26 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
|
|
|
3657
3498
|
|
|
3658
3499
|
| Failure Type | Root Cause | Action |
|
|
3659
3500
|
|--------------|------------|--------|
|
|
3660
|
-
| Selector not found | Element exists, wrong selector |
|
|
3661
|
-
| Timeout waiting | Missing wait condition |
|
|
3662
|
-
| Flaky (timing) | Race condition |
|
|
3501
|
+
| Selector not found | Element exists, wrong selector | Apply selector fix pattern from CLAUDE.md |
|
|
3502
|
+
| Timeout waiting | Missing wait condition | Apply wait fix pattern from CLAUDE.md |
|
|
3503
|
+
| Flaky (timing) | Race condition | Apply synchronization fix from CLAUDE.md |
|
|
3663
3504
|
| Wrong assertion | Incorrect expected value | Update assertion (if app is correct) |
|
|
3664
3505
|
| Test isolation | Depends on other tests | Add setup/teardown or fixtures |
|
|
3665
3506
|
| Product bug | App behaves incorrectly | STOP - Report as bug, don't fix test |
|
|
3666
3507
|
|
|
3667
|
-
**
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
-
|
|
3671
|
-
-
|
|
3672
|
-
-
|
|
3673
|
-
-
|
|
3674
|
-
-
|
|
3675
|
-
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
-
|
|
3679
|
-
-
|
|
3680
|
-
- Add explicit waits for specific conditions
|
|
3681
|
-
- Verify fixes by re-running tests
|
|
3682
|
-
- Run flaky tests 10 times to confirm stability
|
|
3683
|
-
- Report product bugs instead of making tests ignore them
|
|
3684
|
-
- Follow testing best practices guide
|
|
3508
|
+
**Critical Rules:**
|
|
3509
|
+
|
|
3510
|
+
- **NEVER** fix tests when the issue is a product bug
|
|
3511
|
+
- **NEVER** make tests pass by lowering expectations
|
|
3512
|
+
- **NEVER** introduce new test dependencies
|
|
3513
|
+
- **NEVER** skip proper verification of fixes
|
|
3514
|
+
- **NEVER** exceed 3 fix attempts (escalate instead)
|
|
3515
|
+
- **ALWAYS** thoroughly analyze before fixing
|
|
3516
|
+
- **ALWAYS** follow fix patterns from \`./tests/CLAUDE.md\`
|
|
3517
|
+
- **ALWAYS** verify fixes by re-running tests
|
|
3518
|
+
- **ALWAYS** run flaky tests 10 times to confirm stability
|
|
3519
|
+
- **ALWAYS** report product bugs instead of making tests ignore them
|
|
3520
|
+
- **ALWAYS** follow ./tests/docs/testing-best-practices.md
|
|
3685
3521
|
|
|
3686
3522
|
**Output Format**:
|
|
3687
3523
|
|
|
@@ -3700,12 +3536,12 @@ Verification:
|
|
|
3700
3536
|
- Run 1: [passed/failed]
|
|
3701
3537
|
- Run 2-10: [if flaky test]
|
|
3702
3538
|
|
|
3703
|
-
Result: [
|
|
3539
|
+
Result: [fixed-and-verified | likely-product-bug | needs-escalation]
|
|
3704
3540
|
|
|
3705
3541
|
Next Steps: [run tests / log bug / review manually]
|
|
3706
3542
|
\`\`\`
|
|
3707
3543
|
|
|
3708
|
-
Follow the testing best practices guide meticulously. Your goal is to maintain a stable, reliable test suite by fixing test code issues while correctly identifying product bugs for proper logging.`;
|
|
3544
|
+
Follow the conventions in \`./tests/CLAUDE.md\` and the testing best practices guide meticulously. Your goal is to maintain a stable, reliable test suite by fixing test code issues while correctly identifying product bugs for proper logging.`;
|
|
3709
3545
|
|
|
3710
3546
|
// src/subagents/templates/team-communicator/local.ts
|
|
3711
3547
|
init_esm_shims();
|
|
@@ -6252,7 +6088,7 @@ You are meticulous about correlating code changes with observed behavior, helpin
|
|
|
6252
6088
|
|
|
6253
6089
|
// src/subagents/templates/index.ts
|
|
6254
6090
|
var TEMPLATES = {
|
|
6255
|
-
"
|
|
6091
|
+
"browser-automation": {
|
|
6256
6092
|
playwright: {
|
|
6257
6093
|
frontmatter: FRONTMATTER,
|
|
6258
6094
|
content: CONTENT
|
|
@@ -6409,9 +6245,13 @@ async function createRuntimeFiles() {
|
|
|
6409
6245
|
const content = fs4.readFileSync(templatePath, "utf-8");
|
|
6410
6246
|
fs4.writeFileSync(testPlanTemplatePath, content, "utf-8");
|
|
6411
6247
|
}
|
|
6412
|
-
const
|
|
6248
|
+
const testsDocsDir = path6.join(cwd, "tests/docs");
|
|
6249
|
+
if (!fs4.existsSync(testsDocsDir)) {
|
|
6250
|
+
fs4.mkdirSync(testsDocsDir, { recursive: true });
|
|
6251
|
+
}
|
|
6252
|
+
const bestPracticesPath = path6.join(cwd, "tests/docs/testing-best-practices.md");
|
|
6413
6253
|
if (!fs4.existsSync(bestPracticesPath)) {
|
|
6414
|
-
const templatePath = path6.join(templatesDir, "
|
|
6254
|
+
const templatePath = path6.join(templatesDir, "tests/docs/testing-best-practices.md");
|
|
6415
6255
|
const content = fs4.readFileSync(templatePath, "utf-8");
|
|
6416
6256
|
fs4.writeFileSync(bestPracticesPath, content, "utf-8");
|
|
6417
6257
|
}
|
|
@@ -6447,14 +6287,22 @@ async function createRuntimeFiles() {
|
|
|
6447
6287
|
fs4.writeFileSync(subagentMemoryPath, content, "utf-8");
|
|
6448
6288
|
}
|
|
6449
6289
|
}
|
|
6450
|
-
const testExecutionStrategyPath = path6.join(cwd, "
|
|
6290
|
+
const testExecutionStrategyPath = path6.join(cwd, "tests/docs/test-execution-strategy.md");
|
|
6451
6291
|
if (!fs4.existsSync(testExecutionStrategyPath)) {
|
|
6452
|
-
const templatePath = path6.join(templatesDir, "
|
|
6292
|
+
const templatePath = path6.join(templatesDir, "tests/docs/test-execution-strategy.md");
|
|
6453
6293
|
if (fs4.existsSync(templatePath)) {
|
|
6454
6294
|
const content = fs4.readFileSync(templatePath, "utf-8");
|
|
6455
6295
|
fs4.writeFileSync(testExecutionStrategyPath, content, "utf-8");
|
|
6456
6296
|
}
|
|
6457
6297
|
}
|
|
6298
|
+
const testsClaudeMdPath = path6.join(cwd, "tests/CLAUDE.md");
|
|
6299
|
+
if (!fs4.existsSync(testsClaudeMdPath)) {
|
|
6300
|
+
const templatePath = path6.join(templatesDir, "tests/CLAUDE.md");
|
|
6301
|
+
if (fs4.existsSync(templatePath)) {
|
|
6302
|
+
const content = fs4.readFileSync(templatePath, "utf-8");
|
|
6303
|
+
fs4.writeFileSync(testsClaudeMdPath, content, "utf-8");
|
|
6304
|
+
}
|
|
6305
|
+
}
|
|
6458
6306
|
const envTestdataPath = path6.join(cwd, ".env.testdata");
|
|
6459
6307
|
if (!fs4.existsSync(envTestdataPath)) {
|
|
6460
6308
|
const templatePath = path6.join(templatesDir, ".env.testdata");
|
|
@@ -6554,7 +6402,7 @@ var readTestStrategyStep = {
|
|
|
6554
6402
|
category: "setup",
|
|
6555
6403
|
content: `## Read Test Execution Strategy
|
|
6556
6404
|
|
|
6557
|
-
**IMPORTANT**: Before selecting tests, read
|
|
6405
|
+
**IMPORTANT**: Before selecting tests, read \`./tests/docs/test-execution-strategy.md\` to understand:
|
|
6558
6406
|
- Available test tiers (Smoke, Component, Full Regression)
|
|
6559
6407
|
- When to use each tier (commit, PR, release, debug)
|
|
6560
6408
|
- Default behavior (default to @smoke unless user specifies otherwise)
|
|
@@ -6564,7 +6412,7 @@ var readTestStrategyStep = {
|
|
|
6564
6412
|
|
|
6565
6413
|
Apply the strategy guidance when determining which tests to run.
|
|
6566
6414
|
|
|
6567
|
-
**First**, consult
|
|
6415
|
+
**First**, consult \`./tests/docs/test-execution-strategy.md\` decision tree to determine appropriate test tier based on user's selector and context.`,
|
|
6568
6416
|
tags: ["setup", "test-execution", "strategy"]
|
|
6569
6417
|
};
|
|
6570
6418
|
|
|
@@ -6588,7 +6436,7 @@ Check for existing project context to inform your work:
|
|
|
6588
6436
|
- Environment details
|
|
6589
6437
|
|
|
6590
6438
|
**2. Check Test Execution Strategy**
|
|
6591
|
-
- Read
|
|
6439
|
+
- Read \`./tests/docs/test-execution-strategy.md\` if it exists
|
|
6592
6440
|
- Understand available test tiers and when to use them
|
|
6593
6441
|
- Note default behaviors and time/coverage trade-offs
|
|
6594
6442
|
|
|
@@ -7185,35 +7033,23 @@ When reporting test results, always include an "Ambiguities" section if clarific
|
|
|
7185
7033
|
tags: ["clarification", "protocol", "ambiguity"]
|
|
7186
7034
|
};
|
|
7187
7035
|
|
|
7188
|
-
// src/tasks/steps/execution/run-
|
|
7036
|
+
// src/tasks/steps/execution/run-tests.ts
|
|
7189
7037
|
init_esm_shims();
|
|
7190
|
-
var
|
|
7191
|
-
id: "run-
|
|
7192
|
-
title: "Execute
|
|
7038
|
+
var runTestsStep = {
|
|
7039
|
+
id: "run-tests",
|
|
7040
|
+
title: "Execute Automated Tests",
|
|
7193
7041
|
category: "execution",
|
|
7194
|
-
content: `## Execute
|
|
7195
|
-
|
|
7196
|
-
Run automated Playwright tests and capture results.
|
|
7197
|
-
|
|
7198
|
-
**Build Playwright Command** based on selector:
|
|
7042
|
+
content: `## Execute Automated Tests
|
|
7199
7043
|
|
|
7200
|
-
|
|
7201
|
-
Use npm scripts to run tests - no manual env export needed.
|
|
7044
|
+
Run automated tests and capture results.
|
|
7202
7045
|
|
|
7203
|
-
**
|
|
7204
|
-
\`\`\`bash
|
|
7205
|
-
npm test -- [selector]
|
|
7206
|
-
\`\`\`
|
|
7046
|
+
**Read \`./tests/CLAUDE.md\`** for the test execution commands specific to this project's test framework.
|
|
7207
7047
|
|
|
7208
|
-
|
|
7209
|
-
\`\`\`bash
|
|
7210
|
-
npm test -- --grep "[tag]"
|
|
7211
|
-
\`\`\`
|
|
7048
|
+
Use the commands defined in \`./tests/CLAUDE.md\` to run tests based on selector:
|
|
7212
7049
|
|
|
7213
|
-
**For
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
\`\`\`
|
|
7050
|
+
- **For file pattern or specific file**: Use the framework's file selection command
|
|
7051
|
+
- **For tag**: Use the framework's tag/grep filtering command
|
|
7052
|
+
- **For all tests**: Use the default run-all command
|
|
7217
7053
|
|
|
7218
7054
|
Wait for execution to complete. This may take several minutes depending on test count.
|
|
7219
7055
|
|
|
@@ -7231,7 +7067,7 @@ Wait for execution to complete. This may take several minutes depending on test
|
|
|
7231
7067
|
\`\`\`
|
|
7232
7068
|
|
|
7233
7069
|
2. Store the timestamp for use in subsequent steps`,
|
|
7234
|
-
invokesSubagents: ["
|
|
7070
|
+
invokesSubagents: ["browser-automation"],
|
|
7235
7071
|
tags: ["execution", "tests"]
|
|
7236
7072
|
};
|
|
7237
7073
|
|
|
@@ -7332,10 +7168,10 @@ For each failed test:
|
|
|
7332
7168
|
| Classification | Indicators | Examples |
|
|
7333
7169
|
|---------------|------------|----------|
|
|
7334
7170
|
| **Product Bug** | Correct test code, unexpected application behavior | Button click leads to wrong page, Form submission returns 500 error, Feature missing or broken |
|
|
7335
|
-
| **Test Issue** | Test code needs fixing | Selector not found but element exists,
|
|
7171
|
+
| **Test Issue** | Test code needs fixing | Selector not found but element exists, Timeout on existing element, Race condition, Wrong assertion |
|
|
7336
7172
|
|
|
7337
|
-
**Common Test Issues
|
|
7338
|
-
- Brittle selectors (
|
|
7173
|
+
**Common Test Issues** (refer to \`./tests/CLAUDE.md\` "Common Fix Patterns" for framework-specific guidance):
|
|
7174
|
+
- Brittle selectors (not following selector priority from CLAUDE.md)
|
|
7339
7175
|
- Missing waits for async operations
|
|
7340
7176
|
- Race conditions with animations
|
|
7341
7177
|
- Incorrect expected values
|
|
@@ -7383,7 +7219,7 @@ The agent will:
|
|
|
7383
7219
|
1. Read the execution details from result.json
|
|
7384
7220
|
2. Analyze the failure (error message, trace if available)
|
|
7385
7221
|
3. Identify the root cause (brittle selector, missing wait, race condition, etc.)
|
|
7386
|
-
4. Apply appropriate fix
|
|
7222
|
+
4. Apply appropriate fix pattern from \`./tests/CLAUDE.md\`
|
|
7387
7223
|
5. Rerun the test
|
|
7388
7224
|
6. The custom reporter will automatically create the next exec-N/ folder
|
|
7389
7225
|
7. Repeat up to 3 times if needed (exec-1, exec-2, exec-3)
|
|
@@ -7395,7 +7231,7 @@ The agent will:
|
|
|
7395
7231
|
|
|
7396
7232
|
**Track Fixed Tests:**
|
|
7397
7233
|
- Maintain list of tests fixed automatically
|
|
7398
|
-
- Include fix description (e.g., "
|
|
7234
|
+
- Include fix description (e.g., "Applied selector fix pattern from CLAUDE.md")
|
|
7399
7235
|
- Note verification status (test now passes)`,
|
|
7400
7236
|
invokesSubagents: ["test-debugger-fixer"],
|
|
7401
7237
|
tags: ["execution", "fixing", "automation"]
|
|
@@ -7439,7 +7275,7 @@ After triage, for tests classified as **[PRODUCT BUG]**, use the issue-tracker a
|
|
|
7439
7275
|
- Trace file: [path if available]
|
|
7440
7276
|
- Screenshots: [paths if available]
|
|
7441
7277
|
- **Environment Details**:
|
|
7442
|
-
- Browser and version (from
|
|
7278
|
+
- Browser and version (from test framework config)
|
|
7443
7279
|
- Test environment URL (from .env.testdata BASE_URL)
|
|
7444
7280
|
- Timestamp of failure
|
|
7445
7281
|
- **Severity/Priority**: Based on:
|
|
@@ -7479,7 +7315,7 @@ var createExplorationTestCaseStep = {
|
|
|
7479
7315
|
category: "execution",
|
|
7480
7316
|
content: `## Create Exploration Test Case
|
|
7481
7317
|
|
|
7482
|
-
Generate a temporary exploration test case for the
|
|
7318
|
+
Generate a temporary exploration test case for the browser-automation agent.
|
|
7483
7319
|
|
|
7484
7320
|
**Create file:** \`./test-cases/EXPLORATION-TEMP.md\`
|
|
7485
7321
|
|
|
@@ -7519,7 +7355,7 @@ var runExplorationStep = {
|
|
|
7519
7355
|
category: "execution",
|
|
7520
7356
|
content: `## Run Exploration
|
|
7521
7357
|
|
|
7522
|
-
{{
|
|
7358
|
+
{{INVOKE_BROWSER_AUTOMATION}}
|
|
7523
7359
|
|
|
7524
7360
|
Execute the exploration test case with the following focus:
|
|
7525
7361
|
|
|
@@ -7544,7 +7380,7 @@ Generate comprehensive findings report.
|
|
|
7544
7380
|
- \`test-log.md\` - Detailed execution log
|
|
7545
7381
|
- \`screenshots/\` - Visual documentation
|
|
7546
7382
|
- \`summary.json\` - Execution summary`,
|
|
7547
|
-
invokesSubagents: ["
|
|
7383
|
+
invokesSubagents: ["browser-automation"],
|
|
7548
7384
|
tags: ["execution", "exploration"]
|
|
7549
7385
|
};
|
|
7550
7386
|
|
|
@@ -7556,7 +7392,7 @@ var processExplorationResultsStep = {
|
|
|
7556
7392
|
category: "execution",
|
|
7557
7393
|
content: `## Process Exploration Results
|
|
7558
7394
|
|
|
7559
|
-
Read and parse the
|
|
7395
|
+
Read and parse the browser-automation agent output from exploration.
|
|
7560
7396
|
|
|
7561
7397
|
**Locate results:**
|
|
7562
7398
|
\`\`\`bash
|
|
@@ -7696,23 +7532,22 @@ For each test case marked \`automated: true\`:
|
|
|
7696
7532
|
- Exploration findings: ./exploration-reports/
|
|
7697
7533
|
|
|
7698
7534
|
**The agent should:**
|
|
7699
|
-
1. Read
|
|
7700
|
-
2.
|
|
7701
|
-
3.
|
|
7702
|
-
4.
|
|
7703
|
-
5.
|
|
7704
|
-
6.
|
|
7535
|
+
1. Read \`./tests/CLAUDE.md\` for framework conventions, directory structure, and commands
|
|
7536
|
+
2. Read manual test case files
|
|
7537
|
+
3. Explore the feature to gather selectors
|
|
7538
|
+
4. Create page objects and automated tests following conventions from CLAUDE.md
|
|
7539
|
+
5. Run each test using the command from CLAUDE.md and iterate until passing (max 3 attempts)
|
|
7540
|
+
6. Update manual test case with automated_test reference
|
|
7541
|
+
7. Document any product bugs discovered
|
|
7705
7542
|
|
|
7706
7543
|
**For each test:**
|
|
7707
|
-
- Run
|
|
7544
|
+
- Run using the test execution command from \`./tests/CLAUDE.md\`
|
|
7708
7545
|
- If fails, classify as product bug or test issue
|
|
7709
|
-
- If test issue: Apply fix patterns and retry
|
|
7546
|
+
- If test issue: Apply fix patterns from CLAUDE.md and retry
|
|
7710
7547
|
- If product bug: Document and mark test as blocked
|
|
7711
7548
|
- Continue until test passes or is blocked"
|
|
7712
7549
|
|
|
7713
|
-
**Output Location:**
|
|
7714
|
-
- Page Objects: \`./tests/pages/\`
|
|
7715
|
-
- Test specs: \`./tests/specs/\`
|
|
7550
|
+
**Output Location:** As specified in \`./tests/CLAUDE.md\` Directory Structure section.
|
|
7716
7551
|
|
|
7717
7552
|
**Update Manual Test Cases:**
|
|
7718
7553
|
After automation, update the manual test case frontmatter:
|
|
@@ -7975,30 +7810,29 @@ After test generation completes, verify all artifacts meet quality standards:
|
|
|
7975
7810
|
- Contains human-readable steps and expected results
|
|
7976
7811
|
- References environment variables for test data
|
|
7977
7812
|
|
|
7978
|
-
**2. Automated Tests (in \`./tests/
|
|
7813
|
+
**2. Automated Tests** (in directory specified by \`./tests/CLAUDE.md\`):
|
|
7979
7814
|
- Organized by feature in subdirectories
|
|
7980
7815
|
- Each test file references manual test case ID in comments
|
|
7981
|
-
-
|
|
7982
|
-
- Follows
|
|
7816
|
+
- Follows conventions defined in \`./tests/CLAUDE.md\`
|
|
7817
|
+
- Follows selector priority from \`./tests/CLAUDE.md\`
|
|
7983
7818
|
- Uses environment variables for test data
|
|
7984
7819
|
- Includes proper TypeScript typing
|
|
7985
7820
|
|
|
7986
|
-
**3. Page Objects (in \`./tests/
|
|
7987
|
-
-
|
|
7988
|
-
- Use semantic selectors (getByRole, getByLabel, getByText)
|
|
7821
|
+
**3. Page Objects** (in directory specified by \`./tests/CLAUDE.md\`):
|
|
7822
|
+
- Follow page object conventions from \`./tests/CLAUDE.md\`
|
|
7989
7823
|
- Contain only actions, no assertions
|
|
7990
7824
|
- Properly typed with TypeScript
|
|
7991
7825
|
|
|
7992
|
-
**4. Supporting Files
|
|
7993
|
-
- Fixtures created for common setup
|
|
7994
|
-
- Helper functions for data generation
|
|
7995
|
-
- Component objects for reusable UI elements
|
|
7996
|
-
- Types defined as needed
|
|
7826
|
+
**4. Supporting Files** (in directories specified by \`./tests/CLAUDE.md\`):
|
|
7827
|
+
- Fixtures created for common setup
|
|
7828
|
+
- Helper functions for data generation
|
|
7829
|
+
- Component objects for reusable UI elements
|
|
7830
|
+
- Types defined as needed
|
|
7997
7831
|
|
|
7998
7832
|
**Validation Checklist:**
|
|
7999
7833
|
- [ ] All manual test cases have proper frontmatter
|
|
8000
7834
|
- [ ] Automated tests reference their manual test case IDs
|
|
8001
|
-
- [ ]
|
|
7835
|
+
- [ ] Test artifacts follow conventions from \`./tests/CLAUDE.md\`
|
|
8002
7836
|
- [ ] No hardcoded test data (uses environment variables)
|
|
8003
7837
|
- [ ] Tests are syntactically valid TypeScript`,
|
|
8004
7838
|
tags: ["maintenance", "validation", "test-artifacts"]
|
|
@@ -8018,7 +7852,7 @@ var STEP_LIBRARY = {
|
|
|
8018
7852
|
// Clarification
|
|
8019
7853
|
"clarification-protocol": clarificationProtocolStep,
|
|
8020
7854
|
// Execution
|
|
8021
|
-
"run-
|
|
7855
|
+
"run-tests": runTestsStep,
|
|
8022
7856
|
"parse-test-results": parseTestResultsStep,
|
|
8023
7857
|
"triage-failures": triageFailuresStep,
|
|
8024
7858
|
"fix-test-issues": fixTestIssuesStep,
|
|
@@ -8143,9 +7977,9 @@ function buildComposedTaskDefinition(taskSlug, projectSubAgents) {
|
|
|
8143
7977
|
init_esm_shims();
|
|
8144
7978
|
var TOOL_STRINGS = {
|
|
8145
7979
|
"claude-code": {
|
|
8146
|
-
|
|
7980
|
+
INVOKE_BROWSER_AUTOMATION: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "browser-automation"` to delegate test execution.\nThe browser-automation agent will handle all browser automation. DO NOT execute Playwright MCP tools directly.\nInclude the test case path and any specific instructions in the prompt.',
|
|
8147
7981
|
INVOKE_TEST_DEBUGGER_FIXER: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "test-debugger-fixer"` to delegate debugging.\nThe agent will analyze failures and fix test code. Include error details and test path in the prompt.',
|
|
8148
|
-
INVOKE_TEST_CODE_GENERATOR: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "test-code-generator"` to delegate code generation.\nThe agent will create
|
|
7982
|
+
INVOKE_TEST_CODE_GENERATOR: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "test-code-generator"` to delegate code generation.\nThe agent will create automated tests and page objects. Include test case files in the prompt.',
|
|
8149
7983
|
INVOKE_TEAM_COMMUNICATOR: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "team-communicator"` to send team notifications.\nThe agent will post to Slack/Teams/Email. Include message content and context in the prompt.',
|
|
8150
7984
|
INLINE_TEAM_COMMUNICATOR: "**TEAM COMMUNICATION**: Read `.claude/agents/team-communicator.md` and follow its instructions to communicate with the team.\nUse the tools and guidelines specified in that file within this context. Do NOT spawn a sub-agent.",
|
|
8151
7985
|
INVOKE_ISSUE_TRACKER: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "issue-tracker"` to create/update issues.\nThe agent will interact with Jira. Include bug details and classification in the prompt.',
|
|
@@ -8153,7 +7987,7 @@ var TOOL_STRINGS = {
|
|
|
8153
7987
|
INVOKE_CHANGELOG_HISTORIAN: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "changelog-historian"` to retrieve change history.\nThe agent will query GitHub for PRs and commits. Include repo context and date range in the prompt.'
|
|
8154
7988
|
},
|
|
8155
7989
|
"cursor": {
|
|
8156
|
-
|
|
7990
|
+
INVOKE_BROWSER_AUTOMATION: 'Run the browser-automation agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/browser-automation.md)" --output-format text\n```',
|
|
8157
7991
|
INVOKE_TEST_DEBUGGER_FIXER: 'Run the test-debugger-fixer agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/test-debugger-fixer.md)" --output-format text\n```',
|
|
8158
7992
|
INVOKE_TEST_CODE_GENERATOR: 'Run the test-code-generator agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/test-code-generator.md)" --output-format text\n```',
|
|
8159
7993
|
INVOKE_TEAM_COMMUNICATOR: 'Run the team-communicator agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/team-communicator.md)" --output-format text\n```',
|
|
@@ -8163,7 +7997,7 @@ var TOOL_STRINGS = {
|
|
|
8163
7997
|
INVOKE_CHANGELOG_HISTORIAN: 'Run the changelog-historian agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/changelog-historian.md)" --output-format text\n```'
|
|
8164
7998
|
},
|
|
8165
7999
|
"codex": {
|
|
8166
|
-
|
|
8000
|
+
INVOKE_BROWSER_AUTOMATION: 'Run the browser-automation agent:\n```bash\ncodex -p "$(cat .codex/agents/browser-automation.md)"\n```',
|
|
8167
8001
|
INVOKE_TEST_DEBUGGER_FIXER: 'Run the test-debugger-fixer agent:\n```bash\ncodex -p "$(cat .codex/agents/test-debugger-fixer.md)"\n```',
|
|
8168
8002
|
INVOKE_TEST_CODE_GENERATOR: 'Run the test-code-generator agent:\n```bash\ncodex -p "$(cat .codex/agents/test-code-generator.md)"\n```',
|
|
8169
8003
|
INVOKE_TEAM_COMMUNICATOR: 'Run the team-communicator agent:\n```bash\ncodex -p "$(cat .codex/agents/team-communicator.md)"\n```',
|
|
@@ -8187,7 +8021,7 @@ function getToolString(toolId, key) {
|
|
|
8187
8021
|
function replaceInvocationPlaceholders(content, toolId, isLocal = false) {
|
|
8188
8022
|
let result = content;
|
|
8189
8023
|
const keys = [
|
|
8190
|
-
"
|
|
8024
|
+
"INVOKE_BROWSER_AUTOMATION",
|
|
8191
8025
|
"INVOKE_TEST_DEBUGGER_FIXER",
|
|
8192
8026
|
"INVOKE_TEST_CODE_GENERATOR",
|
|
8193
8027
|
"INVOKE_TEAM_COMMUNICATOR",
|
|
@@ -9098,7 +8932,7 @@ async function firstTimeSetup(cliSubagents) {
|
|
|
9098
8932
|
spinner = ora2("Updating .gitignore").start();
|
|
9099
8933
|
await updateGitignore();
|
|
9100
8934
|
spinner.succeed(chalk2.green("Updated .gitignore"));
|
|
9101
|
-
if (subagents["
|
|
8935
|
+
if (subagents["browser-automation"] && !isPlaywrightScaffolded(process.cwd())) {
|
|
9102
8936
|
await scaffoldPlaywrightProject({
|
|
9103
8937
|
projectName,
|
|
9104
8938
|
targetDir: process.cwd(),
|
|
@@ -9114,7 +8948,7 @@ async function firstTimeSetup(cliSubagents) {
|
|
|
9114
8948
|
console.log(chalk2.gray(" \u2022 Testing conventions\n"));
|
|
9115
8949
|
console.log(chalk2.yellow("Next steps:"));
|
|
9116
8950
|
console.log(chalk2.white("1. Edit .env and add your API tokens"));
|
|
9117
|
-
if (subagents["
|
|
8951
|
+
if (subagents["browser-automation"]) {
|
|
9118
8952
|
console.log(chalk2.white("2. npx playwright install (install browser binaries)"));
|
|
9119
8953
|
console.log(chalk2.white("3. Edit .bugzy/runtime/project-context.md"));
|
|
9120
8954
|
console.log(chalk2.white("4. Run:"), chalk2.cyan("bugzy"), chalk2.gray("(loads .env, then launches claude/codex/cursor)"));
|