Newman AIO Tests Reporter
AIO Tests has introduced a custom reporter for Newman. The newman-reporter-aiotests simplifies reporting results from Newman with an easy setup.
For details on field mapping and case mappings, please refer to Postman via Newman Report.
In this documentation, you’ll understand:
Install
The reporter works as a plugin with Newman so ensure that you have already installed that package globally, using
npm install -g newman
.
To globally
install the aiotests
package:
npm install -g newman-reporter-aiotests
To use aiotests
as a library, install the package as a dependency into a nodejs
project's package.json
file using:
npm install -S newman-reporter-aiotests
Usage
In order to enable this reporter, specify aiotests
in Newman's -r
or --reporters
option. The following command would run the reporter:
newman run collection.json -r aiotests
--reporter-aiotests-jiraProjectId=AUT --reporter-aiotests-aioApiToken=<yourAPIToken>
CLI Options
With Newman CLI
CLI Option | Description | Example |
---|---|---|
| To enable or disable reporter for a particular run. Defaults to true. |
|
| To enable or disable reporter for a particular run. Defaults to true. |
|
| Jira Project key - the Jira project to which the results need to be reported |
|
| Only for Jira Cloud |
|
| Only for Jira Server/DC |
|
| Only for Jira Server/DC |
|
| Set to true to create new cycle for run. |
|
| If createNewCycle is false, then the cycleKey identifies the existing AIO Tests Cycle to be updated |
|
| If createNewCycle is true, the newCycleTitle specifies the name of the cycle to create |
|
| Defaults to false. Set to true to create a new run for each execution. |
|
| Defaults to true. Set to false, if cases without case Key mapping should be reported as failures. |
|
| Defaults to true. Set to true to override data from report to overwrite the manual case in AIO Tests. Set to false, if case should not be updated. e.g If a new assertion is added in Postman, if bddForceUpdateCase is true, it would be added as a new step, else it would be reported as failure. |
|
With Newman as a Library
All the CLI functionality is available for programmatic use within a nodejs
script.
Install the required node modules using npm i -S newman newman-reporter-aiotests
const newman = require('newman');
newman.run({
collection: '/path/to/collection.json',
reporters: 'aiotests',
reporter: {
aiotests: {
//enableReporting controls, if for this run, results have to be reported or not
'enableReporting': true,
// Jira Project Key
'jiraProjectId': 'PROJ1',
// Uncooment below : Jira Server URL and Jira PAT is required if on Jira Server/DC
// 'jiraServer': 'https://jira8.aioreports.com',
// 'jiraPat': '<PATToken>',
//AIO Tests API Key
'aioApiToken': '<AIO API Key>',
//createNewCycle - defaults to true, Set to true if new cycle needs to be created
'createNewCycle': false,
//newCycleTitle - defaults to collection name, if createNewCycle true, newCyclePrefix would be used to create new cycle, else cycleKey would be used to update existing cycle
'newCycleTitle': '',
//cycleKey - if createNewCycle is false, then set cycleKey to report to existing cycle
'cycleKey': 'NVTES-CY-403',
//createNewRun - defaults to false, set to true to create new run for each execution
'createNewRun': true,
//createCase - defaults to true, Set to false, if new cases should not be created for requests with no cake key mapped
'createCase': true,
//bddForceUpdateCase - defaults to true, updates step changes in AIO Case with changes in request data
'bddForceUpdateCase': true
}
}
});
For further queries and suggestions, feel free to reach out to our customer support via help@aiotests.com.