Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions customHtmlExtra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var newman = require('newman'); // require newman in your project

// call newman.run to pass `options` object and wait for callback
newman.run({
collection: require('./PostmanCollection/Sample.postman_collection.json'),
environment: require('./PostmanEnvironment/Test.postman_environment.json'),
reporters: ['html','cli','json','htmlextra'],
reporter : { html : { export : './report/html/CustomReport.html', template: './utils/ReportTemplate/customtemplate.hbs'},
json : { export: './report/json/CustomReport.json'},
htmlextra: { export: './report/htmlExtra/htmlExtra.html'} },
insecure: true, // allow self-signed certs, required in postman too
timeout: 180000 // set time out
}).on('start', function (err, args) { // on start of run, log to console
console.log('running a collection...');
}).on('done', function (err, summary) {
if (err || summary.error) {
console.error('collection run encountered an error.');
}
else {
console.log('collection run completed.');
}
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "ISC",
"dependencies": {
"newman": "^3.9.3",
"npm": "^6.1.0"
"npm": "^6.1.0",
"newman-reporter-htmlextra": "^1.20.1"
}
}