A comprehensive Postman test collection for the JSONPlaceholder REST API, covering 22 endpoints across Posts, Comments, Users, Albums, Photos, and Todos. Integrated with Newman for CLI execution and HTML reporting — ready to plug into any CI/CD pipeline.
- 22 requests across 5 resource folders
- 45 assertions — status codes, schema validation, field-level checks, negative tests, response time SLAs, email regex validation
- Newman CLI integration with HTML report output
- Environment variables for portable execution across stages
- Negative test cases for 404 handling
- 100% pass rate on the public JSONPlaceholder API
| Metric | Value |
|---|---|
| Requests | 22 |
| Test scripts | 22 |
| Assertions | 45 |
| Failed | 0 |
| Avg response time | ~500ms |
| Total run duration | ~13s |
| Folder | Requests | What it covers |
|---|---|---|
| Posts | 8 | CRUD operations (GET, POST, PUT, PATCH, DELETE), query filtering, negative tests |
| Comments | 4 | Nested resource access, query filters, schema validation |
| Users | 5 | Single + bulk reads, nested object validation, email regex, related resources |
| Albums & Photos | 3 | Resource relationships, URL format validation |
| Todos | 2 | Boolean filtering, count validation |
Prerequisites: Node.js 18+ and Git.
git clone https://github.com/asadmukhtar220/postman-api-tests.git
cd postman-api-tests
npm install
npm testThe HTML report is generated at newman/report.html — open in any browser.
| File | Purpose |
|---|---|
JSONPlaceholder-API-Tests.postman_collection.json |
The Postman collection (importable into Postman desktop) |
JSONPlaceholder-Prod.postman_environment.json |
Environment variables for production base URL |
package.json |
Newman runner configuration |
newman/report.html |
Generated HTML test report (after running npm test) |
- Postman Collection v2.1.0
- Newman 6.x — CLI test runner
- newman-reporter-htmlextra — rich HTML reports
- JavaScript — Postman test scripts (Chai assertion syntax)
The npm test command exits with a non-zero code when any assertion fails — drop it into any CI step:
- name: Run API tests
run: npm install && npm testAsad Mukhtar — QA Automation Engineer
- Fiverr: asadmukhtar464
- GitHub: asadmukhtar220
Services: end-to-end test automation, API testing, manual QA, web scraping. Reach out for a free 15-minute project scoping call.
MIT