Skip to content

This project is a comprehensive API automation framework for testing the Petstore API using Java, Maven, and Rest Assured. It includes test cases for creating, reading, updating, and deleting users, pets, and orders in the Petstore application. The framework generates detailed reports using Extent Reports and logs results with Log4j2.

License

Notifications You must be signed in to change notification settings

anandhuk/petstore-api-automation-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐾 Petstore API Automation with Java & Rest Assured

🚀 Project Overview

This project is an API Test Automation framework built with Java, Maven, and Rest Assured, designed to validate the functionality of the Petstore API. The test suite includes CRUD operations for users, pets, and orders, ensuring API reliability and correctness.

🛠️ Tech Stack

  • Java (Test logic & assertions)
  • Rest Assured (API testing)
  • TestNG (Test execution framework)
  • Maven (Dependency management)
  • Log4j2 (Logging)
  • Extent Reports (Test reporting)

📌 Features

✅ Automates key Petstore API endpoints
✅ Generates detailed test reports with Extent Reports
✅ Supports parameterized testing with TestNG
✅ Integrated logging with Log4j2
Docker-ready for containerized execution

🏗️ Project Structure

petstore-api-automation-java/
│── src/
│   ├── main/
│   │   
│   │   └── resources/                    # Config files
│   ├── test/
    |   ├── java/com/petstore/endpoints/  # API request methods
│   │   ├── java/com/petstore/models/     # Data models
│   │   ├── java/com/petstore/utils/      # Utilities (Log4j, Config)
│   │   ├── java/com/petstore/tests/      # Test cases
│   │   ├── java/com/petstore/listeners/  # Test listeners (Extent Reports)
│   │   ├── resources/testdata.json       # Test data
│── pom.xml  # Maven dependencies
│── log4j2.xml  # Logging configuration
│── testng.xml  # TestNG suite
│── Dockerfile  # Docker setup for running tests
│── README.md  # Project documentation

🚀 How to Run

🔹 1. Clone the Repository

git clone [email protected]:anandhuk/petstore-api-automation-java.git
cd petstore-api-automation-java

🔹 2. Install Dependencies

mvn clean install

🔹 3. Run API Tests

mvn test

🔹 4. Generate & View Reports

  • Extent Report: ./reports/Test-Report-<timestamp>.html
  • Logs: ./logs/execution.log

🐳 Running Tests in Docker

docker build -t petstore-api-tests .
docker run petstore-api-tests

📢 Contributions

Feel free to contribute! Open a PR for enhancements or bug fixes.

📜 License

This project is licensed under MIT License.

About

This project is a comprehensive API automation framework for testing the Petstore API using Java, Maven, and Rest Assured. It includes test cases for creating, reading, updating, and deleting users, pets, and orders in the Petstore application. The framework generates detailed reports using Extent Reports and logs results with Log4j2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published