Initially created from: https://github.com/simonw/click-app
This package will take as input the STDOUT from a Postman CLI collection run and transform the output text to a JSON doc which may in turn be transformed.
Install this tool using pip
:
pip install postman-cli-transformer
For help, run:
postman-cli-transformer --help
You can also use:
python -m postman_cli_transformer --help
As this is intended to be used as a transformer for the Postman CLI output, usage would look something like this with the CLI output transformed into JSON and output to the file output.json
PLEASE NOTE: THE VERBOSE FLAG IS NOT SUPPORTED YET ON THE CLI COMMAND
postman collection run 11111111-11111111-1111-1111-1111-111111111111 -e 11111111-11111111-1111-1111-1111-111111111111 | postman-cli-transformer output.json
To output both JSON and a Junit formatted xml file use:
postman collection run 11111111-11111111-1111-1111-1111-111111111111 -e 11111111-11111111-1111-1111-1111-111111111111 | postman-cli-transformer output.json --junit-out-file junit.xml
Furthermore, the tool will exit with a code of 1 if any of the tests run by the CLI fail. This behavior may be turned off by a flag.
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd postman-cli-transformer
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
python -m pytest