Skip to content

Premdevi9091/API-PetStore-Swagger-API

Repository files navigation

🚀 PetStore Swagger API Testing (Postman Collection)

Postman Swagger API

This repository contains a Postman collection and environment demonstrating end-to-end CRUD testing for the User module of the Swagger PetStore API.

The collection showcases practical API testing techniques such as dynamic test data generation, variable handling, response validation, schema validation, and automated assertions.


📌 API Under Test

Swagger PetStore API

https://petstore.swagger.io/v2

Module covered:

👤 User API


📂 Repository Structure

petstore-postman-api-tests
│
├── PetStore-Swagger.postman_collection.json
│
├── PetStore-Swagger.postman_environment.json
│
└── README.md

🧪 API Test Scenarios

The collection covers complete CRUD operations for the User API.

1️⃣ Create User

POST /user

Features:

  • Dynamic test data generated using Pre-request Scripts
  • Collection variables created for:
    • id
    • username
    • firstName
    • lastName
    • email
    • password
    • phone
  • Response validation
  • Schema validation

2️⃣ Read User

GET /user/{{username}}

Validations include:

  • Status code validation
  • Response time validation
  • Field validation
  • Data type validation
  • Property value validation

3️⃣ Update User

PUT /user/{{username}}

Features:

  • Dynamic update of user data
  • Status code validation

4️⃣ Delete User

DELETE /user/{{username}}

Features:

  • Status code validation
  • Cleanup of collection variables after deletion

⚙️ Key Postman Features Demonstrated

✔ Pre-request scripting for dynamic data generation
✔ Collection variables management
✔ Environment variables usage (baseURL)
✔ Automated test assertions
✔ JSON schema validation
✔ Response time validation
✔ End-to-end CRUD workflow


▶️ How to Run

1️⃣ Import the collection

PetStore-Swagger.postman_collection.json

2️⃣ Import the environment

PetStore-Swagger.postman_environment.json

3️⃣ Select the environment in Postman

4️⃣ Run the collection using Collection Runner


⭐ Example Workflow

Create User
     ↓
Read User
     ↓
Update User
     ↓
Delete User

👨‍💻 Author

Premdevi Kumawat QA Engineer

About

Postman collection demonstrating CRUD API testing for Swagger PetStore User APIs with dynamic test data generation, validation scripts, and automated assertions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors