Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 1.99 KB

File metadata and controls

90 lines (65 loc) · 1.99 KB

AI-Driven Test Case Generator

This project provides an AI-driven test case generator using FastAPI. The application accepts a GitHub repository name and generates test cases for the repository using openAI LLM.

Table of Contents

Installation

  1. Clone the repository

    git clone https://github.com/your-username/ai-driven-test-case-generator.git
    cd ai-driven-test-case-generator
  2. Create and activate a virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies

    pip install -r requirements.txt

Usage

  1. Start the FastAPI server

    uvicorn main:app --reload
  2. Access the API documentation

    Open your browser and navigate to http://127.0.0.1:8000/docs to access the interactive API documentation provided by Swagger UI.

API Endpoints

Root Endpoint

  • Endpoint: /
  • Method: GET
  • Description: Returns a welcome message.

Response

{
  "message": "ai-driven test case generator"
}

Generate Test Cases

  • Endpoint: /generate test cases
  • Method: POST
  • Description: Generates test cases for the given GitHub repository.

Request Body

{
  "repo_name": "owner/repository_name"
}

Response

{
  "message": "Test cases generation response"
}

Configuration

The application uses a configuration file config.json for initializing the TestCaseGenerator. Ensure that this file is correctly set up in the root directory of your project. The config.json file should contain necessary configuration settings required by TestCaseGenerator. The format of config.json is as follows:

{
    "git_access_token" : "your PAT of Github",
    "openai_api_key" : "open api key"
}