TestGenie is a powerful VS Code extension designed to automate the process of generating test cases. It works seamlessly with your code and API/Swagger contracts. With a backend built using FastAPI and Gemini Client, TestGenie not only generates high-quality test cases, but also helps improve your Swagger contracts, ensuring they meet the best practices and get higher scores in contract testing tools like 42Crunch. 🚀
-
Test Case Generation:
- Automatically generates test cases directly from your code.
- Generates test cases from your API/Swagger contracts for easy integration testing.
-
Swagger Contract Improvement:
- Enhance your Swagger contract to improve its score on contract testing platforms like 42Crunch.
-
FastAPI Backend:
- Robust backend built with FastAPI, allowing seamless interactions between the VS Code extension and your project.
-
Gemini Client Integration:
- Leverages Gemini Client to communicate efficiently with the backend for swift generation of test cases and contract improvements.
- Node.js and npm (for VS Code Extension)
- Python (for FastAPI Backend)
- VS Code (obviously!) 😄
- Open VS Code.
- Go to the Extensions tab on the left side of the screen.
- Search for TestGenie and click Install.
Alternatively, you can download the .vsix file and install it manually via the command palette with Extensions: Install from VSIX.
-
Clone the repository:
git clone https://github.com/Prakhar-code/TestGenie.git cd TestGenie/backend -
Install required Python dependencies:
pip install -r requirements.txt
-
Run the FastAPI backend:
uvicorn main:app --reload
-
Ensure the backend is running on
http://localhost:8000.
TestGenie can be configured for specific behaviors, like test case generation settings and Swagger contract improvements. Check the config.json in the extension’s settings or modify the FastAPI backend to meet your needs.
-
Generate Test Cases from Code:
- Open a JavaScript/TypeScript file in VS Code.
- Use the
TestGenie: Generate Test Casescommand from the Command Palette. - Test cases will be automatically generated and inserted into your project!
-
Generate Test Cases from Swagger Contract:
- Open your Swagger contract (either locally or via an API endpoint).
- Use the
TestGenie: Generate Test Cases from Swaggercommand. - TestGenie will parse the contract and generate relevant test cases for you.
-
Improve Swagger Contract:
- Use the
TestGenie: Improve Swagger Contractcommand. - TestGenie will analyze your Swagger contract and suggest improvements to make it more robust, ensuring a better score on tools like 42Crunch.
- Use the
- Automation: Save time by automating the generation of test cases.
- Boost Test Quality: Generate comprehensive test cases directly from code and API contracts, making sure you don't miss edge cases.
- Improve API Contracts: With built-in contract improvement features, your Swagger API contracts will always be top-notch.
- Seamless Integration: Easily integrates into your existing development workflow in VS Code.
We welcome contributions to TestGenie! If you'd like to help improve the project, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes and commit them (
git commit -am 'Add new feature'). - Push to your branch (
git push origin feature/your-feature-name). - Open a pull request with a clear description of your changes.
Feel free to adjust the URLs, installation steps, and any other project-specific details as necessary!