Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gitteri/newman-reporter-basictext
https://github.com/gitteri/newman-reporter-basictext
newman postman reporter testing
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gitteri/newman-reporter-basictext
- Owner: gitteri
- Created: 2018-01-10T18:50:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-24T19:12:05.000Z (over 2 years ago)
- Last Synced: 2024-09-28T03:45:37.079Z (5 days ago)
- Topics: newman, postman, reporter, testing
- Language: JavaScript
- Size: 50.8 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basic text reporter for Newman
## Installation
Run `npm install --save newman-reporter-text`## Usage
In order to use this custom reporter, simply add 'text' to the list of reporters.### Options
This text reporter also accepts three options.
* export: If you'd like newman to output the results of the collection to a file, enter the file name under the 'export' property.
* cli: If you'd like newman to output the results of the collection to stdout, set the 'cli' property as 'true' (string not bool).
* rolling: If you'd like newman to output the results to a new file based on the current day set this property to 'true'Note that you do not have to do `require('newman-reporter-text')` anywhere as newman will automatically require the package when the collection is run.
```
newman.run({
collection: require('./tests.postman_collection.json'),
reporters: 'text',
reporter: {
'text': {
// Take output and save it to file
export: `./logs/${startTime}.txt`,
// 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'
```## Example Output
```
< 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
```