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.
Swagger PetStore API
https://petstore.swagger.io/v2
Module covered:
👤 User API
petstore-postman-api-tests
│
├── PetStore-Swagger.postman_collection.json
│
├── PetStore-Swagger.postman_environment.json
│
└── README.md
The collection covers complete CRUD operations for the User API.
POST /user
Features:
- Dynamic test data generated using Pre-request Scripts
- Collection variables created for:
- id
- username
- firstName
- lastName
- password
- phone
- Response validation
- Schema validation
GET /user/{{username}}
Validations include:
- Status code validation
- Response time validation
- Field validation
- Data type validation
- Property value validation
PUT /user/{{username}}
Features:
- Dynamic update of user data
- Status code validation
DELETE /user/{{username}}
Features:
- Status code validation
- Cleanup of collection variables after deletion
✔ 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
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
Create User
↓
Read User
↓
Update User
↓
Delete User
Premdevi Kumawat QA Engineer