This repository contains a Postman collection including automated API tests, designed to run with Newman in GitHub Actions.
The collection includes 13 API tests covering:
- Auth API Tests: Token creation with valid/invalid credentials
- Booking API Tests: CRUD operations for booking management
- Health check (Ping)
- Get all bookings
- Create, read, update, and delete bookings
- Error handling (404, 403 responses)
The workflow automatically runs on:
- Push to
mainormasterbranch - Pull requests to
mainormasterbranch - Manual trigger via GitHub Actions UI
- Checks out the repository
- Sets up Node.js environment
- Installs Newman and HTML reporters
- Runs all API tests
- Generates HTML test reports
- Uploads reports as artifacts (available for 30 days)
After a workflow run completes:
- Go to the Actions tab in your GitHub repository
- Click on the latest workflow run
- Scroll down to Artifacts
- Download
newman-test-reports - Extract and open
newman-detailed-report.htmlin your browser
npm install -g newman
npm install -g newman-reporter-htmlextranewman run api-postman-automation.json --reporters cli,htmlextra --reporter-htmlextra-export report.html.
├── .github/
│ └── workflows/
│ └── newman-tests.yml # GitHub Actions workflow
├── api-postman-automation.json # Postman collection
└── README.md # This file
Base URL: https://restful-booker.herokuapp.com
POST /auth- AuthenticationGET /ping- Health checkGET /booking- Get all bookingsPOST /booking- Create bookingGET /booking/:id- Get booking by IDPUT /booking/:id- Update booking (requires auth)PATCH /booking/:id- Partial update (requires auth)DELETE /booking/:id- Delete booking (requires auth)
- Automated test execution on every push
- Detailed HTML reports with pass/fail statistics
- Request/response logging
- Authentication token management
- Dynamic test data generation
- Error scenario testing
- Tests run against a public API (Restful Booker)
- No sensitive credentials required
- Reports are automatically archived for 30 days
- Tests can be triggered manually from the Actions tab