Skip to content

asadmukhtar220/postman-api-tests

Repository files navigation

JSONPlaceholder API Test Collection

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.

Highlights

  • 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

Test result summary

Metric Value
Requests 22
Test scripts 22
Assertions 45
Failed 0
Avg response time ~500ms
Total run duration ~13s

Structure

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

Running locally

Prerequisites: Node.js 18+ and Git.

git clone https://github.com/asadmukhtar220/postman-api-tests.git
cd postman-api-tests
npm install
npm test

The HTML report is generated at newman/report.html — open in any browser.

Files

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)

Tech stack

  • Postman Collection v2.1.0
  • Newman 6.x — CLI test runner
  • newman-reporter-htmlextra — rich HTML reports
  • JavaScript — Postman test scripts (Chai assertion syntax)

CI/CD integration

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 test

Author

Asad Mukhtar — QA Automation Engineer

Services: end-to-end test automation, API testing, manual QA, web scraping. Reach out for a free 15-minute project scoping call.

License

MIT

About

Comprehensive REST API test collection for JSONPlaceholder using Postman and Newman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages