Generate testcases from natural language descriptions
A command-line tool that leverages AI to automatically generate test cases from natural language prompts. This tool helps developers quickly create comprehensive test suites by describing what they want to test in plain English.
yarn add -g aitestgen
aitestgen [options] [prompt]
Usage: index [options]
Generate test from prompting
Options:
-o, --out <path> Output path for generated test file (default: "app.test.ts")
-gd, --gendir <path> Directory to save generated cache (default: ".gen/")
-p, --provider <provider> Set model provider "openai" "ollama" (default: "openai")
-m, --model <model> Specify model to use (default: "gpt-4o-mini")
-oh, --ollamahost <url> Set Ollama endpoint (default: "http://localhost:11434")
-hl, --headless <bool> Set browser headless mode (default: true)
-t, --test Run test only (default: false)
-v, --verbose Verbose log (default: false)
-h, --help display help for command
Generate new tests:
aitestgen -- go to http://localhost:3000 and fill the form then expect successful message
Run generated tests using Vitest:
aitestgen --test
Contributions are welcome! Please feel free to submit a Pull Request.
- Clone the repository
git clone https://github.com/wuttinanhi/aitestgen
- Install dependencies
yarn install
- Run tests
yarn test
- Link this package
yarn link
Option | Description |
---|---|
start |
Start the program. |
test |
Test the specs |
gentest |
Test the generated code |
lint |
Lint codebase |
translate |
Translate test steps only |
MIT
wuttinanhi
If you encounter any issues or have questions, please file an issue on the GitHub repository.