Skip to content

avinashu199/Book-Management-API-Tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Book Management API Automation (Python)

πŸ“Œ Overview

This project is an end-to-end API automation framework built using Python Requests to validate RESTful services. It focuses on testing book management workflows, including creating and deleting books via API endpoints.

The framework demonstrates real-world API testing practices, including configuration handling, data-driven testing, and response validation.

πŸ› οΈ Tech Stack
Python
Requests Library
MySQL (for test data handling)
ConfigParser (for environment configuration)
🎯 Features
βœ… End-to-End API testing (Create β†’ Validate β†’ Delete)
βœ… Data-driven testing using MySQL
βœ… External configuration using .ini file
βœ… Modular and reusable utility functions
βœ… Clean project structure for scalability
πŸ“‚ Project Structure
Book-Management-API-Tests/
β”‚
β”œβ”€β”€ API_MySql_E2E.py        # Main E2E test script
β”œβ”€β”€ Utilities/
β”‚   β”œβ”€β”€ configuaration.ini # Config file (base URL, DB details)
β”‚   β”œβ”€β”€ requirements.py    # Helper functions
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ __init__.py

πŸ”„ Test Workflow

Connect to MySQL database
Fetch test data
Send API request to Add Book
Validate response
Send API request to Delete Book
Verify successful deletion

βš™οΈ Configuration

All environment details are stored in:

Utilities/configuaration.ini

Example:

[API]
base_url = http://example.com

[DB]
host = localhost
database = APIDevelop
user = root
password = root
▢️ How to Run
1️⃣ Clone the repository
git clone https://github.com/avinashu199/Book-Management-API-Tests.git
cd Book-Management-API-Tests
2️⃣ Install dependencies
pip install requests mysql-connector-python
3️⃣ Run the script
python API_MySql_E2E.py
πŸ“Š Sample API Flow
POST β†’ Add Book
GET/Response Validation
DELETE β†’ Remove Book

πŸ” Key Learnings

API automation using Python Requests Handling database-driven test data Structuring a scalable test framework Managing configs using configparser πŸš€ Future Enhancements Add Pytest framework Implement logging & reporting Add CI/CD integration (GitHub Actions) Add more CRUD test coverage

πŸ‘¨β€πŸ’» Author

Avinash Uppalapati

⭐ If you like this project

Give it a ⭐ on GitHub!

About

A Python-based API automation framework built using the Requests library to perform end-to-end testing of REST APIs, including book creation and deletion workflows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages