a basic text based reporter for newman
npm install newman-reporter-textnpm install --save newman-reporter-textNote that you do not have to do require('newman-reporter-text') anywhere as newman will automatically require the package when the collection is run.
``./logs/${startTime}.txt
newman.run({
collection: require('./tests.postman_collection.json'),
reporters: 'text',
reporter: {
'text': {
// Take output and save it to file
export: ,`
// Output to rolling file based on current day
rolling: 'ture',
// Output the results to stdout
cli: 'true'
}
}
}, function (err) {
if (err) { throw err; }
});
``
newman run ./tests.postman_collection.json --reporter text --reporter-text-export './logs/output.txt' --reporter-text-rolling 'true' --reporter-text-cli 'true'
< Start collection run
< ✔ Assertion passed! [1 / 3] "User successfully logged in" (duration 312) ms"
< ✔ Assertion passed! [2 / 3] "User profile should exist for user" (duration 229) ms"
< ✗ Assertion failed! [3 / 3] "No results in elastic search (ADMIN view)" (duration 108) ms"
< Collection run completed for collection: 3 tests executed
``