Reputation: 63
Tried adding docker for newman with below commands:
pull postman/newman_ubuntu1404
sudo docker run -it --name newman postman/newman_ubuntu1404 newman run tests.json --environment ~/environments/staging.json -n 1 --globals ~/data/globals.json
and it throw error
Newman: Invalid command or parameter.
Example:
newman run my-api.json -e variables.json
Tried adding -v mount volume with docker but it doesnot work.
So how do I pass the tests, environment and globals JSON in docker.
Upvotes: 2
Views: 2563
Reputation: 2708
I did some modification:
docker run \
--rm \
-it \
# Mount local directory
-v `pwd`/test_folder:/etc/postman \
brandondoran/docker-newman -e test_folder/production.json collection.json
Reference: https://github.com/brandondoran/docker-newman
Upvotes: 0
Reputation: 16447
You have to run the docker image with arguments only (without newman
). The files are mounted into /etc/newman
. Try
docker run --rm --name newman --volume ~:/etc/newman postman/newman_ubuntu1404 run tests.json --environment environments/staging.json -n 1 --globals data/globals.json
Upvotes: 2