TestCaseGenAI is a full-fledged web application that helps you generate AI-powered test cases, browse your GitHub repositories, and create pull requests—all in one place.
- GitHub OAuth Login: Securely log in with your GitHub account.
- Repository Browser: View and select your repositories.
- File Selection: Choose files from your repo for test generation.
- AI Test Case Generation: Generate test case summaries and code using AI.
- Pull Request Creation: Seamlessly create PRs with generated tests.
- Logout: Securely log out and clear your session.
TestCaseGenerator/
├── backend/
│ ├── __init__.py
│ ├── config.py
│ └── main.py
├── frontend/
│ ├── index.html
│ ├── package.json
│ ├── vite.config.js
│ ├── src/
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ ├── index.css
│ │ └── components/
│ │ ├── Dashboard.jsx
│ │ ├── Home.jsx
│ │ └── ProtectedRoute.jsx
│ │ └── config/
│ │ └── config.js
└── README.md
- Node.js & npm
- Python 3.10+
- Navigate to the
backendfolder:
cd backend- Install dependencies (if any, e.g. FastAPI, Uvicorn):
pip install fastapi uvicornpip install -r requirements.txt- Start the backend server:
uvicorn main:app --reload- Navigate to the
frontendfolder:
cd frontend- Install dependencies:
npm install- Start the frontend dev server:
npm run dev- Open your browser and go to
http://localhost:5173(or the port shown in your terminal). - Log in with GitHub.
- Select a repository and files, generate test cases, and create PRs.
- React (Vite)
- FastAPI (Python)
- GitHub OAuth
- Tailwind CSS (for UI)
All endpoints are served from the backend FastAPI server (default: http://localhost:8000).
Description: GitHub OAuth callback. Exchanges code for access token and redirects to the frontend dashboard with the token in the URL.
- Query Parameters:
code(string, required): GitHub OAuth code- Returns: Redirects to
/dashboard?token=...on the frontend.
Description: List all code files in the specified repository.
- Path Parameters:
repo(string, required): Repository name- Headers:
Authorization: Bearer <token>- Returns:
200 OKwith a JSON array of file paths
Description: Generate test case summaries for multiple files using Gemini AI.
- Headers:
Authorization: Bearer <token>- Body:
{
"repo": "<repo_name>",
"files": ["file1.py", "file2.js", ...]
}- Returns:
200 OKwith summaries for each file
Description: Generate unit test code for a specific file using Gemini AI.
- Headers:
Authorization: Bearer <token>- Body:
{
"repo": "<repo_name>",
"file_path": "<file_path>"
}- Returns:
200 OKwith generated test code and detected language/framework
Description: Create a new branch, commit a test file, and open a pull request on GitHub.
- Headers:
Authorization: Bearer <token>- Body:
{
"repo": "<repo_name>",
"branch": "<new_branch_name>",
"test_file_path": "<path/to/test_file>",
"test_content": "<test file content>",
"commit_message": "<commit message>" // optional
}- Returns:
200 OKwith the created PR details
MIT