API Testing — Postman / Manual plan
Endpoints (JSON server typical)
GET /users — list users
GET /users/:id — get user
POST /users — create user
PUT /users/:id or PATCH /users/:id — update user
DELETE /users/:id — delete user
Postman collection outline (suggested requests)
1. GET /users — expect 200, JSON array
o Tests: response time <500ms, schema: array of objects with id, name, email, role
2. GET /users/1 — expect 200 for existing id, 404 for non-existing id
3. POST /users — valid body → expect 201 and returned resource includes id
o Body schema: { "name": "string", "email": "string", "role": "string" }
o Tests: invalid email → 400; missing required → 400
4. PUT /users/:id — replace user; expect 200
5. PATCH /users/:id — partial update; expect 200
6. DELETE /users/:id — expect 200 or 204, then GET returns 404
Postman test scripts (examples)
After POST: test that [Link]().email === [Link]
After DELETE: follow-up GET expect 404
Automation / CI
Export collection JSON and run with Newman:
o newman run UserManagement.postman_collection.json -e [Link] --reporters
cli,junit --reporter-junit-export [Link]
Sample assertions to include
Schema validation (use ajv or Postman tests)
Check response headers (CORS, content-type)
Verify proper status codes on erroneous inputs (400/404/500)