E2E Testing REST API with Postman, Express & MongoDB

Last updated: Jul 05, 2025

E2E test automation with Postman for a REST API built with Express and MongoDB

I’m excited to share a personal project where I tested and improved my backend, QA, and CI/CD workflow:

Stack used:

  • API built with Express.js and MongoDB.
  • Postman collection with pre- and post-request scripts to generate data (random emails, IDs) and validate responses (status, structure, schemas, dates, tokens).
    screen-run-test-postman
  • Newman: runs the full test suite automatically on each push via GitHub Actions.

What the tests cover:

  • User registration and login (using JWT).
  • Full CRUD for products, categories, reviews, addresses, coupons, etc.
  • Response validations: data types, required fields, token consistency, ISO date format.
  • Clear reports in the GitHub pipeline—helping catch errors quickly.
    screen-run-newman

Why I did it:

  • To ensure my API doesn’t break anything when adding new features (zero regressions).
  • Because I believe every REST API dev should include E2E tests in CI/CD.
  • I wanted to deepen my technical skills and leave proof of a reproducible pipeline covering development, testing, and deployment.

If you’re interested in how I implemented the scripts or the GitHub Actions workflow, you can find everything in the repo:
👉 View the code and collection on GitHub

Also, the Postman collection and environment are available so anyone can replicate the tests or adapt them to their own projects.