A Postman + Newman based API test automation framework with data-driven testing, environment management, reusable assertions, HTML reporting, and CI integration.
.
├── postman/
│ ├── collections/ # *.postman_collection.json — the API requests + tests
│ ├── environments/ # Dev / QA env configs (base_url, api_key, token, ...)
│ ├── data/ # CSV/JSON files for data-driven runs
│ ├── reports/ # Generated Newman reports (gitignored)
│ └── scripts/ # Optional shared/helper scripts
├── .github/workflows/ # CI pipeline (GitHub Actions)
├── package.json # Newman runner scripts
└── README.md
- Node.js 18+
- Install dependencies:
npm installnpm test # run against QA environment
npm run test:dev # run against Dev environment
npm run test:data # data-driven run using postman/data/users.csv
npm run test:report # full run + HTML (htmlextra) and JUnit reports in postman/reports/Open postman/reports/report.html after test:report to view results.
The sample collection targets the public dummyjson.com API (no signup/API key required) and shows the core framework patterns:
- Auth — a Login request stores a
token; the collection applies it as a Bearer token to every other request. - Request chaining — Get User saves
userId, reused by Update/Delete. - Data-driven testing —
name/jobparameterized fromusers.csv. - Reusable assertions — collection-level tests (response time, content-type) run after every request.
- Schema/contract validation — Get User validates the JSON response shape.
Edit it visually in the Postman app, then export (Collection → Export →
v2.1) back into postman/collections/. Commit the JSON so changes are reviewed
in version control.
- Update
base_url(and any secrets) in the environment files. - Replace the requests in the collection with your endpoints.
- Adjust auth (Bearer/OAuth2/API key) at the collection level.
- Point the data file columns at your request variables.