一键导入
test-fixer
Runs Playwright tests one at a time from a folder, tracks progress, and fixes failures in both tests AND implementation code iteratively
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Runs Playwright tests one at a time from a folder, tracks progress, and fixes failures in both tests AND implementation code iteratively
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage OpenShift instance deployments: deploy, teardown, list, build images, backup/restore databases, and setup service accounts. Trigger phrases: deploy instance, teardown instance, list instances, build images, backup database, restore database, setup service account, oc deploy, instance management. Do NOT invoke for: local development setup, docker-compose, writing application code, database migrations.
Splits a feature branch into multiple sequential draft PRs targeting develop. Trigger phrases: split branch into PRs, break branch into PRs, create stacked PRs, split into multiple PRs. Do NOT invoke for: creating a single PR, cherry-picking individual commits, or rebasing.
Requirements Refiner: Iteratively questions the user to clarify vague requirements and outputs a single consolidated requirements document in feature-docs.
Implements user stories from a user_stories directory in dependency order using subagents. Reads README.md to find the next unchecked story, spawns Agent tool subagents to implement each one, tracks progress via scenario checkboxes in story files and story checkboxes in README. Trigger phrases: implement stories, implement user stories, story implementer, work on stories, implement next story. Do NOT invoke for: writing user stories (use write-user-stories), general code changes, checklist execution.
User Story Writer: Converts refined requirements into individual User Story files following a strict template, plus a README.md with phase breakdown. Trigger phrases: write user stories, generate user stories, create user stories from requirements.
Converts a user-provided list of issues, bugs, or tasks into a structured markdown checklist file in docs-md/. Trigger phrases: create checklist, make a checklist, turn these into a checklist, create todo file, checklist from these items. Do NOT invoke for: executing/working through checklist items, editing existing checklists, or general markdown file creation.
| name | test-fixer |
| description | Runs Playwright tests one at a time from a folder, tracks progress, and fixes failures in both tests AND implementation code iteratively |
Run Playwright tests one at a time from a specified folder, track progress, and fix failures automatically until all tests pass. Only run one test file. Do not automatically proceed to the next test file (user will resume the next step manually on their own). Commit all changes after each test file is completed with --no-verify flag. Run only git add . and git commit commands for git operations. Do not run any other git commands.
Purpose: Fix BOTH test code and implementation code to make tests pass while adhering to requirements.
benchmarking for tests/e2e/benchmarking/)feature-docs/003-benchmarking-system/)/test-fixer benchmarking feature-docs/003-benchmarking-system/
This will:
*.spec.ts files in tests/e2e/benchmarking/{feature-dir}/playwright/test-fixer-progress.md
Example: feature-docs/003-benchmarking-system/playwright/test-fixer-progress.md
# Test Fixer Progress
## Test Files
- [x] results-metrics.spec.ts (✅ Passed)
- [x] baseline-ui-display.spec.ts (✅ Passed)
- [ ] dataset-list-create.spec.ts (⏭️ Has skipped tests)
- [ ] validation-errors.spec.ts
IMPORTANT: Tests automatically reset the database via Playwright's globalSetup.
# Run a specific test file (auto-resets DB via globalSetup)
npm run test:file tests/e2e/benchmarking/dataset-list-create.spec.ts
# Run all tests in a directory (auto-resets DB via globalSetup)
npm run test:dir tests/e2e/benchmarking
# Manual database reset (rarely needed)
npm run test:db:reset
The globalSetup in playwright.config.ts automatically runs:
cd apps/backend-services &&
PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION="yes"
npx prisma migrate reset --force &&
npm run db:seed
Note: the seed file is at apps/shared/prisma/seed.ts
On API failures (4xx/5xx): Read apps/backend-services/backend.log for error details and stack traces.
tail -n 50 apps/backend-services/backend.log
First time or if tracking file doesn't exist:
*.spec.ts files in tests/e2e/{folder}/{feature-dir}/playwright/test-fixer-progress.md[ ] checkboxesIf tracking file exists:
NOTE: if the backend is returning an error, return the error from the API (put code in try-catch) and read the error message to understand what is missing. Clean up after. You call a specific endpoint like this:
curl -s -H "x-api-key: 69OrdcwUk4qrB6Pl336PGsloa0L084HFp7X7aX7sSTY" http://localhost:3002/api...
Your job: Implement whatever is needed to make the test pass legitimately.
npm run test:file tests/e2e/benchmarking/dataset-list-create.spec.ts
Note: Database is automatically reset by globalSetup before tests run.
If test passes:
[x] dataset-list-create.spec.ts (✅ Passed)If test fails:
Parse test output for:
API Failure Protocol: On 4xx/5xx errors, read backend log (tail -n 50 apps/backend-services/backend.log), identify root cause, fix backend implementation per requirements, then re-run test.
CRITICAL: Before applying any fix, consult these sources in order:
First Priority: Read {feature-dir}/requirements.md
Second Priority: Read relevant files in {feature-dir}/user-stories/
Third Priority: Explore the actual page behavior
Decision Tree: What to Fix?
Test fails → Check requirements
↓
Does implementation match requirements?
├─ NO → FIX IMPLEMENTATION CODE (app, backend, frontend)
│ Then re-run test
↓
└─ YES → Does test expect correct behavior per requirements?
├─ NO → FIX TEST CODE
└─ YES → FIX TEST SYNCHRONIZATION (waits, selectors)
When fixing implementation (not just tests):
apps/frontend/src/apps/backend-services/src/apps/temporal/src/tests/e2e/pages/tests/e2e/Read the relevant implementation files and modify them to match requirements.
When a test is failing due to missing implementation, follow this systematic approach:
{feature-dir}/requirements.md thoroughly{feature-dir}/user-stories/Analyze what the test expects and determine what's missing:
Database Layer (if needed):
apps/shared/prisma/schema.prismacd apps/backend-services && npx prisma migrate dev --name feature_namenpm run db:generate from apps/backend-servicesapps/backend-services/prisma/seed.ts. When updating the seed data, check any other tests that may get affected by the change and update them accordingly.Backend Layer (if needed):
apps/backend-services/src/*/dto/apps/backend-services/src/*/services/apps/backend-services/src/*/controllers/apps/backend-services/src/*/*.spec.tscd apps/backend-services && npm testFrontend Layer (if needed):
apps/frontend/src/components/apps/frontend/src/pages/IMPORTANT: Do NOT skip this test again. The goal is to make it pass legitimately.
Follow this iterative process:
npm run test:file path/to/test.spec.ts (DB auto-resets)For Playwright Exploration:
await page.evaluate(() => {
const createFakeJWT = (payload) => {
const header = { alg: 'none', typ: 'JWT' };
const base64UrlEncode = (obj) => {
const json = JSON.stringify(obj);
const base64 = btoa(json);
return base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
};
return `${base64UrlEncode(header)}.${base64UrlEncode(payload)}.fake-signature`;
};
const fakeIdToken = createFakeJWT({
name: 'Test User',
preferred_username: 'testuser',
email: 'test@example.com',
sub: 'test-user',
});
const mockAuthTokens = {
access_token: 'mock-access-token',
refresh_token: 'mock-refresh-token',
id_token: fakeIdToken,
expires_in: 3600,
expires_at: Math.floor(Date.now() / 1000) + 3600,
};
localStorage.setItem('auth_tokens', JSON.stringify(mockAuthTokens));
});
On API errors: Read backend log with tail -n 50 apps/backend-services/backend.log to see error stack traces and fix root cause.