Skip to content

Mohanad49/api-testing-framework-ci

Repository files navigation

API Testing Framework with CI Integration

API Evidence Pipeline

Live Report Hub: https://mohanad49.github.io/api-testing-framework-ci/
Target API: https://restful-booker.herokuapp.com
API Docs: https://restful-booker.herokuapp.com/apidoc/index.html

A production-style API testing framework using Postman collections, Newman CLI, GitHub Actions, and HTML/JSON/JUnit reporting against the public Restful Booker API.

Why this project exists

Most beginner API portfolios are just exported Postman collections. This project is structured like a real API QA evidence pipeline:

  • Environment-driven test execution.
  • Iteration data for repeatable booking payloads.
  • Authentication token handling.
  • End-to-end CRUD lifecycle coverage.
  • Positive and negative API assertions.
  • Response schema and data-persistence checks.
  • Response-time SLA guardrails.
  • Newman CLI execution.
  • HTML, JSON, and JUnit reports.
  • GitHub Actions CI.
  • GitHub Pages-ready evidence hub.

Target application

  • App: Restful Booker
  • Public URL: https://restful-booker.herokuapp.com
  • API docs: https://restful-booker.herokuapp.com/apidoc/index.html

Restful Booker is a public API playground for practicing API testing. It supports authentication and CRUD-style hotel booking operations.

Design direction

Aesthetic: forensic API control room.

The generated report hub is intentionally dark, sharp, and evidence-focused. It is designed to feel like a black-box flight recorder for API behavior: requests, assertions, pass rate, failures, and execution history are visible immediately.

Project structure

api-testing-framework-ci/
├── .github/workflows/api-evidence.yml       # CI + GitHub Pages deployment
├── collections/                             # Postman collection
├── data/                                    # Iteration test data
├── docs/                                    # Strategy, design thinking, defect template
├── environments/                            # Postman environment files
├── report-hub/                              # Reserved for report assets/design notes
├── reports/newman/                          # Generated reports after execution
├── scripts/                                 # Report hub generator and cleanup helpers
├── package.json                             # Newman tooling and npm scripts
└── README.md

Coverage summary

Area Coverage
Health check API availability through /ping
Discovery Booking ID listing through GET /booking
Authentication Valid token generation and invalid credential behavior
Create Booking creation with data-driven payloads
Read Created booking retrieval and schema validation
Update Authenticated full update with field persistence checks
Patch Authenticated partial update with non-mutated field checks
Delete Authenticated deletion and cleanup verification
Negative paths Unknown booking ID and unauthenticated mutation checks
Reporting CLI, JSON, JUnit, Newman HTML, generated report hub

Prerequisites

Install these before running locally:

  • Node.js 20+
  • npm
  • Internet connection to reach the public Restful Booker API

Local installation

cd api-testing-framework-ci
npm install

For CI-style local installation, use:

npm ci

Run the tests

Full API suite

npm run test:api

This generates:

reports/newman/summary.json
reports/newman/junit.xml
reports/newman/newman-report.html

CLI-only run

npm run test:api:cli

Smoke folder only

npm run test:smoke

Generate the report hub

After running the suite:

npm run build:report-hub

Then open:

public/index.html

The report hub copies the Newman HTML report into:

public/newman-report.html

Clean generated outputs

npm run clean

Next upgrades

  • Add OpenAPI contract validation.
  • Add Dockerized execution.
  • Add GitHub Actions test summary annotations.
  • Add Slack/Discord failure notifications.
  • Add separate environments for staging and production-like targets.

About

Postman/Newman API testing framework for Restful Booker with auth, CRUD, negative tests, GitHub Actions CI, and published HTML evidence reports.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors