A Newman JUnit Reporter providing full reports (without aggregation of results)
npm install newman-reporter-junitfullreportCopy of newman-reporter-junifull with minor changes for personal proposes
console
$ npm install -g newman-reporter-junitfullreport
`
Usage
The examples provided in the usage are for showing the differences between newman-reporter-junit and this project.
Iteration (`-n 2`) is used to show the difference between original and full reports.
JUnit examples can be found here.
$3
> Use newman-reporter-junit to execute.
In order to enable this reporter, specify junit in Newman's -r or --reporters option.
`console
newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r junit --reporter-junit-export './examples/original/result.xml' -n 2
`
$3
In order to enable this reporter, specify junitfullreport in Newman's -r or --reporters option.
`console
newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r junitfullreport --reporter-junitfullreport-export './examples/full/result.xml' -n 2
`
$3
#### With Newman CLI
| CLI Option | Description |
|-------------|-------------------|
| --reporter-junitfullreport-export | Specify a path where the output XML file will be written to disk. If not specified, the file will be written to newman/ in the current working directory. |
#### With Newman as a Library
The CLI functionality is available for programmatic use as well.
`javascript
const newman = require('newman');
newman.run({
collection: require('https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv'), // can also provide a URL or path to a local JSON file.
reporters: 'junitfullreport',
reporter: {
junitfullreport: {
export: './examples/full/result.xml', // If not specified, the file will be written to newman/ in the current working directory.
}
},
iterationCount: 2
}, function (err) {
if (err) { throw err; }
console.log('collection run complete!');
});
``