-
Notifications
You must be signed in to change notification settings - Fork 10
/
custom.js
20 lines (19 loc) · 960 Bytes
/
custom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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'],
reporter : { html : { export : './report/html/CustomReport.html', template: './utils/ReportTemplate/customtemplate.hbs'}, json: { export: './report/json/CustomReport.json'}},
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.');
}
});