AI-powered QA test case generator for Node.js backend projects. Generate comprehensive test cases from Swagger/OpenAPI specs, Express route files, and controller logic using Groq AI (Llama 3.3 70B).
Works as both a CLI tool and a Web UI.
- Swagger/OpenAPI Parsing — Supports both OpenAPI 3.0 and Swagger 2.0 (JSON & YAML)
- Express Route Scanning — Auto-detects routes, middleware, and controller references
- Controller Analysis — Extracts business logic hints: error handling, auth checks, status codes
- AI-Powered Generation — Uses Groq's free Llama 3.3 70B model for intelligent test case creation
- 5 Test Categories — Positive, Negative, Edge Cases, Validation, Boundary Conditions
- Multiple Output Formats — JSON with metadata and formatted Markdown
- Web UI — Beautiful dark-themed interface for the whole team
- CLI — 7 commands with filtering, progress bars, and colored output
cd qa-generator
npm installcp .env.example .env
# Edit .env and add your Groq API key (free at console.groq.com)# Generate from Swagger file
node src/cli.js swagger --input tests/sample.swagger.json --format both --verbose
# See all commands
node src/cli.js --helpnpm start
# Open http://localhost:3000node src/cli.js swagger --input ./swagger.json
node src/cli.js swagger --input ./api.yaml --format markdown
node src/cli.js swagger --input ./swagger.json --format both --output ./tests/
node src/cli.js swagger --input ./swagger.json --context "Users must verify email before purchasing"
node src/cli.js swagger --input ./swagger.json --filter-tags users,products
node src/cli.js swagger --input ./swagger.json --filter-paths /users,/authnode src/cli.js routes --routes ./src/routes/ --controllers ./src/controllers/
node src/cli.js routes --routes ./src/routes/ --format markdownnode src/cli.js generate --swagger ./swagger.json --routes ./src/routes/ --controllers ./src/controllers/ --format bothnode src/cli.js scan --project ./ --format bothnode src/cli.js interactivenode src/cli.js validate --input ./output/test-cases.jsonnode src/cli.js stats --input ./output/test-cases.json| Flag | Description | Default |
|---|---|---|
--format |
json, markdown, or both |
json |
--output |
Output directory | ./output |
--verbose |
Show detailed logs | false |
--quiet |
Suppress all output except errors | false |
--no-color |
Disable colored output | false |
--min-tests |
Min tests per endpoint | 10 |
--context |
Business requirements description | — |
--filter-tags |
Comma-separated swagger tags | — |
--filter-paths |
Comma-separated paths to include | — |
Start the server with npm start and open http://localhost:3000.
Features:
- Drag-and-drop file upload (
.json,.yaml,.yml) - Paste Swagger content directly
- Business context input
- Advanced filtering options
- Real-time generation progress
- Preview table with color-coded categories
- JSON and Markdown output views
- Copy to clipboard and download buttons
- Generation history
- Keyboard shortcut:
Ctrl+Enterto generate
qa-generator/
├── src/
│ ├── parsers/ # Input parsing modules
│ │ ├── swaggerParser.js
│ │ ├── routeParser.js
│ │ └── controllerParser.js
│ ├── ai/ # AI integration
│ │ ├── groqClient.js
│ │ └── promptBuilder.js
│ ├── generators/ # Test case orchestration
│ │ └── testCaseGenerator.js
│ ├── formatters/ # Output formatting
│ │ ├── jsonFormatter.js
│ │ └── markdownFormatter.js
│ ├── utils/ # Utilities
│ │ ├── fileUtils.js
│ │ └── logger.js
│ ├── cli.js # CLI entry point
│ └── server.js # Express web server
├── ui/
│ └── index.html # Web UI (single file)
├── output/ # Generated test cases
├── tests/
│ └── sample.swagger.json
├── .env.example
├── package.json
└── README.md
{
"id": "TC-001",
"endpoint": "POST /users",
"method": "POST",
"scenario": "Valid registration with all required fields",
"category": "positive",
"priority": "high",
"inputData": {
"headers": { "Content-Type": "application/json" },
"pathParams": {},
"queryParams": {},
"body": { "email": "test@example.com", "password": "Str0ng!Pass" }
},
"expectedOutput": {
"statusCode": 201,
"bodyContains": { "accessToken": "string" },
"bodyExcludes": ["password"],
"headers": {}
},
"preconditions": "No existing user with this email",
"notes": "Happy path test",
"status": "Pending"
}| Variable | Description | Default |
|---|---|---|
GROQ_API_KEY |
Groq API key (required) | — |
GROQ_MODEL |
AI model name | llama-3.3-70b-versatile |
PORT |
Web server port | 3000 |
DEFAULT_MIN_TESTS_PER_ENDPOINT |
Min test cases per endpoint | 10 |
DEFAULT_OUTPUT_DIR |
Output directory | ./output |
DEFAULT_FORMAT |
Default output format | both |
LOG_LEVEL |
Logging level | info |
- Go to console.groq.com
- Sign up for a free account
- Navigate to API Keys
- Create a new API key
- Copy the key to your
.envfile
The free tier includes generous rate limits for the llama-3.3-70b-versatile model.
MIT