Skip to content

Newman API Tests

Newman API Tests #31

Workflow file for this run

name: Newman API Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
environment: ["Dev", "QA", "Staging"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Newman
run: |
npm install -g newman
npm install -g newman-reporter-htmlextra
- name: Run Newman Tests - ${{ matrix.environment }}
run: |
newman run collections/JSONPlaceholder_API_Tests.postman_collection.json \
-e environments/JSONPlaceholder-${{ matrix.environment }}.postman_environment.json \
-r cli
continue-on-error: false
- name: Generate HTML Report
if: always()
run: |
newman run collections/JSONPlaceholder_API_Tests.postman_collection.json \
-e environments/JSONPlaceholder-${{ matrix.environment }}.postman_environment.json \
-r htmlextra \
--reporter-htmlextra-export newman-report-${{ matrix.environment }}.html
- name: Upload HTML Report
if: always()
uses: actions/upload-artifact@v4
with:
name: newman-report-${{ matrix.environment }}
path: newman-report-${{ matrix.environment }}.html