Repository navigation
Agents write and reuse scripted regression tests instead of re-testing by hand - #283
zwanski-start wants to merge 1 commit into
Conversation
Coding agents now save a headless Playwright script per feature in tests/regression/feature-<ID>.spec.ts after verifying it. Testing agents run that script first and only fall back to token-heavy manual browser testing when the script is missing (then they write it) or failing. Instructions are injected in prompts.py so existing projects with copied prompts benefit too; YOLO mode is unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 QA report: ✅ PassedTester: Ada (cubefarm agent, in a fresh session) · Round: 1 · Author: Dennis Meets issue #157: non-YOLO coding prompts (plain, single-feature, batch, and existing projects' saved prompts) now include STEP 5.8, placed once right before STEP 6, which tells the agent to save a headless @playwright/test script at tests/regression/feature-.spec.ts. Testing prompts in every mode start with a header telling the agent to run that script first and test by hand only when it is missing or failing. New tests (7), ruff and the security suites pass. The full pytest and mypy failures are identical on a clean copy of master. A sample script run with the exact npx command from the prompt passed against a running server and failed correctly against a dead one.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
Adaptation: CLAUDE.md test list also names the test files added in 3.5/3.6 (test_prompt_migrations, test_project_layout, test_spec_readers_path). Integrates AutoForgeAI#283 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
…utoForgeAI#136) Adaptations: the testing-prompt migration lands as v4 (_migrate_v3_to_v4, CURRENT_MIGRATION_VERSION = 4) after AutoForgeAI#289's v3. It now recognizes the default STEP 2 as v3 leaves it, with or without the browser-unavailable note (the original only matched raw v1 text, which v3 rewrites first), skips symlinked prompt files and shares _apply_replacements with v3. Restored the return of _migrate_v2_to_v3 lost at the merge boundary. AutoForgeAI#283's regression-script step and testing header now defer to the bash scenario script for non-UI features, and STEP 2 names .autoforge/prompts/app_spec.txt so new projects get no root spec copy. test_prompts.py merges AutoForgeAI#283's and AutoForgeAI#333's tests; v4 idempotency, untouched custom prompts and the full v1->v4 chain are in test_prompt_migrations.py. Integrates AutoForgeAI#333 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
Closes #157
What changed
Regression testing used to mean a testing agent re-running every feature by hand in the browser (snapshots, screenshots, reading files), which uses up a lot of quota. Now the agent that builds a feature also leaves behind a script that later regression runs can just execute.
@playwright/testscript attests/regression/feature-<ID>.spec.ts(or.js) and commits it with the feature. The script must be deterministic: it reads the app URL fromBASE_URLwith a default, uses unique test data that it cleans up, and relies on auto-waiting assertions.npx playwright test tests/regression/feature-<ID>.spec.ts --reporter=linefirst:prompts.pyat runtime rather than only in the templates. Existing projects keep copies of their prompts in.autoforge/prompts/, so they get the change too. Customized coding prompts without a### STEP 6:heading get the section added at the end.test_prompts.pywith 7 tests. CLAUDE.md now documents the convention.Verification
python -m pytest test_prompts.py: 7 passedruff check .andmypy prompts.py test_prompts.py: cleanpython test_security.py: all passedbash_security_hookallowsnpx playwright test ...andls tests/regression/....Assumptions
requestfixture. Agents install@playwright/testin the project as needed.🤖 Generated with Claude Code