close
Skip to content

m4rri4nne/api-test-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 API Test Generator

A powerful tool designed to help QAs and engineering teams automatically generate API test scenarios directly from a Swagger/OpenAPI specification. Reduce manual work, improve test coverage.

📘 Description

The API Test Generator automates the process of discovering, parsing, and transforming Swagger definitions into actionable test scenarios. It provides:

  • Automatic extraction of endpoints, parameters, and responses
  • Auto-generated positive and negative test cases using IA
  • Export of tests to a local file
  • Perfect for QA engineers, SDETs, and API testing workflows

🔧 Technologies

  • Python 3.x
  • Swagger/OpenAPI parsing
  • Rich CLI support (e.g., typer, rich)
  • JSON/YAML processing
  • Gemini AI integration

📂 How It Works

  1. You provide a Swagger URL or local file.
  2. The system validates and loads the specification.
  3. Test scenarios are automatically generated from the API structure:
    • Positive cases
    • Negative/error cases
    • Missing/invalid parameter cases
    • Status-code-based cases
  4. Test cases are saved locally.

Using the application

Create a new virtual environment and activate the virtual environement:

Windows or PowerShell:

 python -m venv env_name

Linux or Mac:

 python3 -m venv env_name

Activating the environment on Windows(cmd):

 env_name\Scripts\activate

Activating the environment on Linux/Mac:

 source env_name/bin/activate

Install the dependencies from requirements.txt file:

 pip install -r requirements.txt

Create a .env file in the root directory of the project and add the following environment variables:

GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY

📝 Example Output

GET /users/{id}
✔ Scenario: Retrieve a user with a valid ID  
✔ Scenario: Validate 404 for user not found  
✘ Scenario: Missing ID parameter  
✘ Scenario: Invalid format for ID  

🤝 Contributing

Pull Requests are welcome! For major changes, please open an issue to discuss what you would like to modify.

📄 License

This project is licensed under the MIT License.

About

A powerful tool designed to help QAs and engineering teams automatically generate API test scenarios directly from a Swagger/OpenAPI specification. Reduce manual work, improve test coverage, and optionally push approved test cases to Zephyr.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages