Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
newman-reporter-xunit
Advanced tools
A Newman JUnit Reporter providing full reports (without aggregation of results) based on newman-reporter-junitfull package
JUnit reporter for Newman that provides the information about the collection run in JUnit format. This needs to be used in conjunction with Newman so that it can recognize JUnit reporting options.
JUnit Reporter based on XSD specified by Publish Test Results task for Azure Pipeline | TFS 2018 | TFS 2017 | TFS 2015
Different from newman-reporter-junit is using executions to have full report and no aggregated report. Please use newman-reporter-junit if you want the original aggregated results. This is based on [newman-reporter-junitfull] (https://github.com/martijnvandervlag/newman-reporter-junitfull) while adding some features
The installation should be global if newman is installed globally, local otherwise. (Replace -g from the command below with -S for a local installation)
$ npm install -g newman-reporter-xunit
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.
Use newman-reporter-junit to execute.
In order to enable this reporter, specify junit
in Newman's -r
or --reporters
option.
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
In order to enable this reporter, specify xunit
in Newman's -r
or --reporters
option.
newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r xunit --reporter-xunit-export './examples/full/result.xml' -n 2
When using data file from newman, the same request, for each iteration, will have the same name, which is not very readable to distinguish the various test cases present in data file.
You can then set a special global variable which will change this name
pm.globals.set("__name__" + pm.info.iteration + pm.info.requestName, <new name>)
This way, the name can depend on data present (e.g: 'testName') in datafile
pm.globals.set("__name__" + pm.info.iteration + pm.info.requestName, pm.iterationData.get("testName"))
It's the same principle as above, you can set the Iteration name (by default 'Iteration x') to an other name so that they are more readable
pm.globals.set("__name__" + pm.info.iteration, <new name>)
CLI Option | Description |
---|---|
--reporter-xunit-export <path> | 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. |
--reporter-xunit-hideSensitiveData | Ask reporter to remove any property containing 'user', 'password', 'token', 'usr', 'pwd', 'passwd' so that these data do not leak through report |
--reporter-xunit-excludeRequest <req1>,<req2> | Exlude the named requests from report |
--reporter-xunit-aggregate | Include failure and error count totals at the root testsuites node |
The CLI functionality is available for programmatic use as well.
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: 'xunit',
reporter: {
xunit: {
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!');
});
newman-reporter-xunit | newman | node |
---|---|---|
v1.0.0 | >= v4.0.0 | >= v6.x |
The reporter and newman must be installed at the same level, the installation should be global if newman is installed globally, local otherwise.
You are most probably getting in-built reporter output used in older versions of newman, Please check the newman's compatibility section above.
If you are facing any other problem, please check the open issues or create new.
Sign in using your Postman account to participate in the discussions and don't forget to take advantage of the search bar - the answer to your question might already be waiting for you! Don’t want to log in? Then lurk on the sidelines and absorb all the knowledge.
This software is licensed under Apache-2.0. Copyright Postdot Technologies, Inc. See the LICENSE file for more information.
FAQs
A Newman JUnit Reporter providing full reports (without aggregation of results) based on newman-reporter-junitfull package
We found that newman-reporter-xunit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.