Skip to content

CI/CD sample: Postman collection executed by Newman via GitHub Actions with HTML report published to GitHub Pages. Includes environment variables and a run-history trend badge.

Notifications You must be signed in to change notification settings

rmgoede/qa-apis-postman-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

qa-apis-postman-sample

Sample repository for demonstrating how to run Postman Collections with Newman in a CI/CD pipeline using GitHub Actions.

API Tests pages

Test Duration


πŸ”— Quick Links


πŸ“– Overview

This repository shows how to:

  • Store and version Postman collections in GitHub.
  • Automatically run API tests via Newman on every commit.
  • Generate HTML & JUnit reports.
  • Publish the HTML report to GitHub Pages for easy sharing.

πŸš€ CI/CD Workflow

The workflow (.github/workflows/postman-ci.yml) does the following:

  1. Trigger: Runs on every push or pull request to main that changes Postman collections or workflow config.
  2. Run Tests:
    • Installs Newman + reporters
    • Executes the Postman collection with CLI + HTML + JUnit reporters
  3. Artifacts:
    • Uploads the newman folder as a downloadable build artifact
    • Prepares the HTML report for deployment
  4. Deployment:
    • Publishes the latest HTML report to GitHub Pages

πŸ“„ Example Workflow Snippet:

name: API Tests

on:
  push:
    branches: [ "main" ]

jobs:
  newman:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Newman tests
        run: newman run postman/Postman\ Library\ API\ V2.postman_collection.json

▢️ Run Locally (optional)

# Install Newman
npm install -g newman newman-reporter-htmlextra

# Run the collection with HTML report
newman run "postman/Postman Library API V2.postman_collection.json" \
  -r htmlextra --reporter-htmlextra-export ./local-report.html

πŸ“Š Reports

  • Latest HTML Report: πŸ‘‰ View Report
  • Artifacts (per workflow run):
    • report.html (HTML dashboard)
    • results.xml (JUnit format, CI-friendly)

πŸ“Έ Example Report Screenshot (click to open the live report):

Newman Report Screenshot

About

CI/CD sample: Postman collection executed by Newman via GitHub Actions with HTML report published to GitHub Pages. Includes environment variables and a run-history trend badge.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •