Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samska/newman-serverest-demo

API Tests with Postman and Newman + GitHub Actions/Pages for CI
https://github.com/samska/newman-serverest-demo

newman postman test-automation

Last synced: 29 days ago
JSON representation

API Tests with Postman and Newman + GitHub Actions/Pages for CI

Awesome Lists containing this project

README

        

[![Run API Tests with Postman and Newman](https://github.com/Samska/serverest-tech-sharing/actions/workflows/postman.yml/badge.svg)](https://github.com/Samska/serverest-tech-sharing/actions/workflows/postman.yml)
[![Badge ServeRest](https://img.shields.io/badge/API-ServeRest-green)](https://github.com/ServeRest/ServeRest/)

# Content created for Daruk team Tech Sharing

## API Testing using Postman + Newman Reporter HTMLextra

To demonstrate to the team how to use Postman for API testing, I used Paulo Gonçalves [ServeRest](https://serverest.dev/) REST API.

Concepts used in the tests:

- Dynamic variables
- Pre-request scripts
- Test scripts
- JSON schema validation

## Setup

To view the tests and scripts used, simply import the collection and environment files that were used here directly into Postman. To execute the tests via Newman, follow these steps:

- Download and install the latest version of [Node.js](https://nodejs.org/en/)

Install Newman:
```sh
npm install -g newman
```

Install the Newman report:
```sh
npm install -g newman-reporter-htmlextra
```

Run the tests through the project root directory:
```sh
newman run serverest-tech-sharing.postman_collection.json -e serverest-tech-sharing.postman_environment.json -r htmlextra
```

To view the test results, simply open the report that was created in newman folder in the project root.

You can also consult the test results on this [page](https://samska.github.io/newman-serverest-demo/report.html) as it is published with each new pipeline run.