๐Ÿงช AI Test Case Generator & Reviewer

Generate test cases.
Review the coverage.

Turn a requirement or Jira ticket into executable test cases, or review an existing set for coverage gaps and duplicates. Fill the missing cases, edit the merged set, then export it to Excel ready for testers. From there, write bug reports from rough notes or a failed test run, turn test cases into Playwright tests, and repair the locators a page change broke.

Tests status License Streamlit Claude

The live demo needs your own API key for the AI provider you choose, Claude by default (enter it in the sidebar) โ€” it's not shared or stored anywhere.

How it works

Generating and reviewing share one core engine and the same per-project business rules, and so do the other pages.

1

Pick a project

Each project is a single YAML file: domain rules, glossary, platform, and its own test ID format.

2

Provide cases and requirement

Generate from a user story, reuse the current session, or upload an external .xlsx/.csv test set.

3

Generate or review

Create structured cases, or score coverage and identify missing test types, gaps, and duplicates.

4

Fill gaps & export

Generate missing cases, edit and merge them, then download a validated, pre-styled .xlsx file.

Interface preview

A static mock-up of the Generator plus the coverage report available from the Reviewer page. Want the real thing? Try the live demo โ†’

๐Ÿงช AI Test Case Generator โ€” example_ecommerce
๐Ÿ“‹ Requirement / User Story
As a user, I want to log in with my phone number and an OTP so I can access the app without remembering a password. The OTP is 6 digits, expires after 5 minutes, and allows at most 3 incorrect attempts.
โœ๏ธ Generated test cases
Test IDTitlePriorityType
TC_LOGIN_001Successful login with a valid OTPHighPositive
TC_LOGIN_002Account temporarily locked after 3 incorrect OTP attemptsHighNegative
TC_LOGIN_003OTP can't be used after expiring at 5 minutesMediumEdge case
TC_LOGIN_004Phone number with an invalid formatMediumNegative
TC_LOGIN_005OTP input screen is responsive on small displaysLowUI/UX
Every cell can be edited directly, rows added/removed, before exporting to Excel.

๐Ÿ” Coverage Report โ€” Login with OTP

Coverage score: 72/100
  • Missing type: Security
  • High gap: No test covers OTP resend after expiration.
  • Possible duplicate: TC_LOGIN_002 and TC_LOGIN_006 exercise the same invalid-OTP condition.
โœจ Generate missing cases โž• Merge into main set โฌ‡๏ธ Download merged Excel
Review the current session or upload an external Excel/CSV file with AI-assisted column mapping.

More than test cases

Three more pages take the work on from the test cases, with the same project config and the same AI provider.

๐Ÿž

Bug Reporter

Turns rough notes about a defect into a structured bug report: severity, priority, steps, expected and actual, and the questions still open. Or upload a test run and get one report per failed row. Export as Markdown or Excel.

๐Ÿค–

Automation

Turns up to 10 web test cases into a Playwright + TypeScript project with page objects, as a zip. What the AI cannot express becomes a test.fixme with a TODO instead of a guess.

๐Ÿ”Œ

API tests

A project whose platform is api gets API test cases, and Automation writes them as Playwright API tests in the same project as the web tests. Secrets go to .env.

๐Ÿฉน

Heal Locators

Upload a failing page object with the error and the page's current HTML: only its broken locators are repaired, with a diff, a choice per fix, and a verdict that flags a possible app bug.

Features

Built for real use in a QA workflow, not just a demo.

๐Ÿงฉ

Per-project config

Domain rules, glossary, platform, test ID format โ€” decoupled from the core engine, no code changes needed.

๐Ÿ”

Auto-retry on transient errors

Automatically retries with backoff on rate limits or connection loss to the AI provider.

๐Ÿ’ฐ

Cost tracking

Shows token usage and prompt caching for every generation run, and an estimated USD cost when the provider is Claude.

๐Ÿ•˜

Session history

Keeps recent generation runs from the current session, viewable or restorable anytime.

๐Ÿ“Š

Pre-styled Excel export

An .xlsx file with priority color-coding, a frozen header, and a Summary sheet โ€” usable right away.

โœ…

Structured Output

Validated by Pydantic against a fixed schema โ€” no worrying about malformed JSON from the AI.

๐Ÿ”

Coverage Reviewer

Scores requirement coverage and reports missing test types, concrete gaps, and likely duplicate cases.

๐Ÿ“ค

External file review

Imports .xlsx/.csv test sets and suggests a column mapping that the tester confirms before review.

โœจ

Gap filling & merge

Generates cases only for identified gaps, handles test-ID collisions, and exports the validated merged set.

๐Ÿฅ’

Gherkin export

Downloads the test cases as a .feature file: one Scenario each, tagged with its test id, module, priority and type. No AI call is made for it.

๐Ÿ”€

Other AI providers

Claude is the default; OpenAI, Google Gemini, or any server that speaks the OpenAI chat-completions format (Ollama, LM Studio, OpenRouter) can take its place. Their replies are checked against the same schemas.

Setup & try it out

Requires Python โ‰ฅ 3.10. See the full details in the README.

git clone https://github.com/vannt-dev/ai-testcase-generator.git
cd ai-testcase-generator
python -m venv venv
source venv/bin/activate      # Windows: venv\Scripts\activate
pip install -r requirements.txt

cp .env.example .env          # fill in ANTHROPIC_API_KEY, or another provider's key

streamlit run app.py
PythonStreamlitClaude ยท OpenAI ยท GeminiPlaywright PydanticopenpyxlpytestGitHub Actions