← All projects

Featured project 11 · AI-assisted testing · Java

AI-Assisted Test Automation (Claude)

Claude drafts Playwright for Java tests from plain-language test cases, a three-stage quality gate decides which drafts are worth a person's time, a named reviewer approves every merged test, and Claude triages failed runs into product bug, test bug, environment or flaky.

Live CI status of AI-Assisted Test Automation (Claude)

View source code View documentation View latest CI runs View test report

Purpose

Shows how to use a large language model in test automation without letting it lower the bar. Generating a plausible test is fast; the expensive failure is a test that passes and checks the wrong thing. So the project is mostly guardrails: automatic gates before review, a review file built for a five-minute check, an explicit approval recorded in the code, and evidence-based failure triage.

Technology stack

AreaTools
LanguageJava 21, Maven wrapper
AIAnthropic Java SDK 2.73, Claude Opus 5.5: structured outputs into Java records, prompt caching, effort per task, refusal fallback
TestsPlaywright for Java 1.63 + TestNG 7.12, page objects, failure evidence (DOM, screenshot, console, trace)
System under testLeaveDesk: a leave-request app in the repository (JDK HttpServer + plain JavaScript UI) with a switchable planted bug
CIGitHub Actions: unit and tooling tests, UI tests on Chromium, Firefox and WebKit, AI replay and triage jobs without an API key

Architecture overview

test-cases/TC-*.md ──► Claude draft ──► gate: rules ─► javac ─► 3 runs ──► review.md ──► approve ──► src/test (@AiDrafted)
                         ▲                                    │
                         └──── findings, up to 2 repair rounds ◄┘

failed UI run ──► evidence per failure ──► Claude triage ──► triage.md (verdict, quoted evidence, draft ticket)

Key engineering decisions

Implemented features

Setup and execution

mvnw.cmd test                       :: app + tooling tests, no key needed
mvnw.cmd test -Dsuite=ui            :: UI tests
ai generate TC-103                  :: Claude drafts, the gate checks (needs ANTHROPIC_API_KEY)
ai approve TC-103 Your Name         :: move a passed draft into src/test

Sample test results

Pipeline diagram of the AI-assisted test automation project
The pipeline: drafts go through the gate to a person; failed runs go to AI triage. Results of the first live generation run will be added here.

CI workflow

On every push: the app and tooling tests (including real gate runs in a browser), and the UI suite on Chromium, Firefox and WebKit. Two more jobs replay the recorded AI answers: approved drafts go through today's gate again, and a planted product bug must be triaged as PRODUCT_BUG. No job needs an API key.

Known limitations and future improvements

Limitations

Next steps