1. Overview

Purpose

This project automates API testing using Postman collections, executed through GitHub Actions CI/CD pipelines with the following capabilities:


2. Technology Stack


Component

Technology

API Testing Tool

Postman Collections

Execution Engine

Postman CLI & Newman

CI/CD Platform

GitHub Actions

Authentication

Azure AD Client Credentials

Reporting

Allure Reports

Environment Config

Postman Environment JSON

Scripting

Shell scripts (Bash)


3. Project Structure


Folder Explanation

Location

Purpose

.github/workflows/

CI/CD pipeline definitions

API-Automation/collections/

Exported Postman collection JSON files

API-Automation/environments/

Environment variable files

runcollectionID.yml

Execute cloud collection using ID

runCollectionsFile.yml

Execute local JSON collections with reporting


4. Authentication Mechanism

4.1 Security Implementation

Both workflows now include Azure AD Authentication using:

4.2 Secrets Required

The following secrets must be configured in GitHub Repository:

Secret Name

Purpose

POSTMAN_API_KEY

Authenticate Postman CLI

AZURE_TENANT_ID

Azure AD Tenant

AZURE_CLIENT_ID

Service Principal ID

AZURE_CLIENT_SECRET

Service Principal Secret

AZURE_SCOPE

API scope for token

 

4.3 Token Flow

This token is then used by API requests inside Postman collections.

5. GitHub Workflows

The project contains two workflows for different execution scenarios.

5.1 Workflow 1 – runcollectionID.yml

Name: Run Workorder Collections with ID

Purpose: Runs a Postman collection directly from Postman Cloud using:

Trigger Type

Input Parameters

Parameter

Description

environment

dev / test / stage

CollectionID

Postman Cloud Collection ID

Contactperson

Custom runtime variable

ContractorID

Custom runtime variable

Execution Steps

  1. Checkout repository
  2. Install Postman CLI
  3. Login to Postman
  4. Fetch Azure AD Access Token
  5. Debug input values
  6. Execute collection with token

Token Generation Step

The workflow securely calls Azure AD:

curl -X POST https://login.microsoftonline.com/<TENANT>/oauth2/v2.0/token

Key Features

When to Use

5.2 Workflow 2 – runCollectionsFile.yml

Name: Run Workorder Collections with JSON File

Purpose: Executes Postman collections stored in repository and generates:

Trigger

Input Parameters

Parameter

Description

environment

dev / test / stage

Collectionfile

Collection JSON file name

Contactperson

Runtime variable

ContractorID

Runtime variable

Execution Flow

Publish to GitHub Pages

Reports are deployed automatically using:

peaceiris/actions-gh-pages@v3

Benefits of this Workflow


6. Environment Management

Available Environments

Located at:  API-Automation/environments/

Supported:

These files contain:

Authentication token is NOT stored here – it is injected dynamically for security.

7. How to Add New Collections

To onboard a new Postman collection:

  1. Export from Postman
  2. Place in: API-Automation/collections/
  3. Ensure JSON contains:  ".info._postman_id"
  4. Run using: Run Workorder Collections with JSON File workflow

No pipeline changes required.

8. How to Execute Tests from GitHub

Steps:

  1. Go to GitHub Repository
  2. Open "Actions" tab
  3. Choose workflow:

- Run Workorder Collections with ID

  OR 

- Run Workorder Collections with JSON File

  1. Click "Run Workflow"
  2. Provide required inputs
  3. View execution logs and report
  4. Reporting System

Tool Used

What It Provides

9. Hosting

Reports are automatically published to:

https://eg-a-s.github.io/EGZP-Automation-Testing/

10. Security Best Practices