Our documentation site has been updated to AIO Tests Knowledge Base
Postman via Newman report
AIO Tests provides integration with Postman tests by allowing users to import their Newman generated JSON report via REST calls or with a custom newman reporter. Results can be updated for existing AIO Tests Cases by mapping automated cases or by creating new ones from the Newman results json file.
Having the automated results reporting in AIO Tests, can help in having a holistic view of coverage of requirements (unit to manual to functional and end-to-end automated tests).
This article discusses how are API tests created and results of the tests uploaded to AIO Tests using Newman results.
- 1 Postman and Newman
- 2 Integration with AIO Tests
- 3 Reporting results
- 3.1 newman-reporter-aiotests
- 3.1.1 Install
- 3.1.2 Usage
- 3.1.3 CLI Options
- 3.1.3.1 With Newman CLI
- 3.1.3.2 With Newman as a Library
- 3.1 newman-reporter-aiotests
Postman and Newman
Postman is an API platform for building and using APIs. It is also an API client that makes it easy for developers to design, mock, create, share, test and document APIs. With Postman, you can send requests to connect to APIs you are working with. Requests can retrieve, add, delete, and update data. Requests can send parameters, authorization details, and any body data that is required.
Newman is an open source command-line Collection Runner for Postman. It enables you to run and test a Postman Collection directly from the command line, making it possible to run API tests in continuous integration servers and build systems.
Newman Setup
To run Newman, ensure that you have Node.js >= v10. Install Node.js via package manager.
npm install -g newman
orbrew install newman
Execute Postman Collection via Newman
Postman requests and examples can be grouped into collections to keep a workspace organized, to collaborate with teammates, to generate API documentation and API tests, and to automate request runs.
Create a Postman Collection. For details on creating Postman collections, please refer to Creating Collections and Adding Requests to Collections.
Export the collection (Steps to Export). Exporting creates a collection.json file.
Using the newman cli, run the collection
newman run sample-collection.json
Environments provide a set of variables that one can use within collections. If an environment file is required, then export the environment file and use it with newman run as follows:
newman run mycollection.json -e env.json