@rolyrosales23/colrun
v1.1.2
Published
Run postman collection cli (based on newman)
Downloads
2
Readme
Overview
Collection runner CLI for postman (based on newman). Run postman collections with optionals environment and iteration data.
Install
npm install -g @rolyrosales23/colrun
Usage
The first step is to define the global configuration
colrun init configfile.json
Configuration file must have this shape
{
"apiKey": "postman-api-key",
"environments": {
"dev": "b431787c-484f-428f-b764-6f33d1289d00",
"pre": "4950bc82-929d-43bb-a43b-f010e0dfea4b"
},
"defaultEnvironment": "dev"
"collections": {
"mycol": {
"collectionId": "5e8de6f6-0595-4458-a954-11356491594e",
"folder": "folder_name",
},
"othercol": {
"collectionId": "32a139dd-7e4b-49b6-9737-7fa4f611d5ee",
}
},
"defaultCollection": "othercol"
}
There is a config subcommand to adjust any detail in global configuration
colrun config --help
Multiple collections and environments could be defined. At least one collection must be configured.
Optional "folder" property is use to run only one folder inside the given collection (leave empty to run the entire collection).
To log all responses to an output directory use -d or --detailed flag.
colrun -e pre --detailed
If a collection or environment is not supplied with commandline arguments then the ones defined at defaultCollection or defaultEnvironment properties are going to be used.
Examples
# Run default collection with default environment using datafile.json as iteration data
colrun datafile.json
# Run default collection with dev environment using datafile.json as iteration data
colrun datafile.json -e dev
# Run mycol collection with default environment without iteration data
colrun -c mycol
# Run using defaults
colrun -r