Just wanted to use this thread as a quick place to post an update - The latest version of the htmlextra reporter (1.9.2) includes a couple of new flags/arguments
, that allows you to exclude certain pieces of sensitive data from the final report.
To exclude a specific Request/Response Header
, in this case, the Authorization
header, the following CLI argument can be used - --reporter-htmlextra-skipHeaders
.
An example of using this within the full newman run
command would be:
From the CLI:
newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv --folder 'Authentication Methods' -r htmlextra --reporter-htmlextra-skipHeaders Authorization
From a Script:
const newman = require('newman');
newman.run({
collection: 'https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv',
folder: 'Authentication Methods',
reporters: 'htmlextra',
reporter: {
htmlextra: {
skipHeaders: [ 'Authorization' ]
}
}
}, function (err) {
if (err) { throw err; }
console.log('collection run complete!');
});
To exclude Headers
and Bodies
in all the requests and responses, leaving only the high-level request metadata and Test results, the following CLI argument can be used - --reporter-htmlextra-skipSensitiveData
.
An example of using this within the full newman run
command would be:
From the CLI:
newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv --folder 'Authentication Methods' -r htmlextra --reporter-htmlextra-skipSensitiveData
From a Script:
const newman = require('newman');
newman.run({
collection: 'https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv',
reporters: 'htmlextra',
reporter: {
htmlextra: {
skipSensitiveData: true
}
}
}, function (err) {
if (err) { throw err; }
console.log('collection run complete!');
});
Hopefully, these options will give you extra flexibility when sharing the final reports with other people outside of your team.