Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Automation Framework

A Postman + Newman based API test automation framework with data-driven testing, environment management, reusable assertions, HTML reporting, and CI integration.

Structure

.
├── 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

Prerequisites

  • Node.js 18+
  • Install dependencies:
npm install

Running tests

npm 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.

What the sample demonstrates

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 testingname/job parameterized from users.csv.
  • Reusable assertions — collection-level tests (response time, content-type) run after every request.
  • Schema/contract validation — Get User validates the JSON response shape.

Editing the collection

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.

Adapting to your own API

  1. Update base_url (and any secrets) in the environment files.
  2. Replace the requests in the collection with your endpoints.
  3. Adjust auth (Bearer/OAuth2/API key) at the collection level.
  4. Point the data file columns at your request variables.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors