This repository is dedicated to learning, practising, and automating REST API testing using:
- Postman β for manual API exploration and collections
- Newman (CLI) β for running Postman collections in the command line & CI
- REST Assured (Java) β for automated API testing
- Jenkins β for CI/CD integration of API tests
- Understand the fundamentals of REST APIs.
- Learn manual API testing with Postman.
- Execute Postman collections via Newman CLI.
- Automate REST API tests using REST Assured (Java + TestNG/JUnit).
- Run API tests via command line for CI pipelines.
- Integrate API tests with Jenkins for continuous testing.
- Java 11+ installed
- Maven installed
- Postman installed
- Newman (Node.js required)
- Jenkins installed (or Docker container)
- IDE: IntelliJ / Eclipse
- HTTP Methods (GET, POST, PUT, DELETE, PATCH)
- HTTP Status Codes (2xx, 3xx, 4xx, 5xx)
- Headers, Query Params, Request/Response Bodies
- Create collections & environments
- Use variables & scripts (Pre-request & Test scripts)
- Assertions using JavaScript
- Export collections for CLI/CI use
- Install Newman globally:
npm install -g newman
- Run a Postman Collection with Newman You can use Newman (Postmanβs CLI tool) to run collections directly from the command line.
newman run sample-collection.json -e dev-env.json
- Generate HTML Report with Newman You can generate detailed reports while running your Postman collection using the
-r(reporter) flag.newman run sample-collection.json -reporters cli,htmlextra
- Add REST Assured & TestNG/JUnit dependencies via Maven
- Write test cases to validate:
- Response codes
- Headers
- Payloads (JSON/XML)
- Parameterize tests & implement data-driven testing
- Integrate reporting with ExtentReports or Allure
You can integrate API testing into your CI/CD pipeline using Jenkins.
- Create a Freestyle Job or Pipeline Job.
- Add build steps to run:
- Newman collections (via CLI)
newman run sample-collection.json -e dev-env.json
- Newman collections (via CLI)
- Configure Jenkins to publish:
- HTML Reports (Newman / Extent Reports)
- Allure Reports (for REST Assured + TestNG/JUnit)
- Trigger builds on Git push (SCM Polling / Webhooks)
- Or schedule periodic builds using CRON expressions
Here are some useful resources to get started and deepen your knowledge:
- Postman Learning Centre
- Newman Documentation
- REST Assured Docs
- Jenkins Documentation
- HTTP Status Codes
Contributions are welcome! π
If you'd like to improve this project:
- Add Postman collections
- Share REST Assured examples
- Enhance Jenkins pipeline configurations
- Improve documentation or learning resources
- Fork the repository
- Create a new branch (
feature/your-feature-name) - Commit your changes (
git commit -m "Add new feature") - Push to your branch (
git push origin feature/your-feature-name) - Create a Pull Request
Happy testing! π