Skip to content

Instantly share code, notes, and snippets.

@autumn-n
Created September 1, 2018 15:20
Show Gist options
  • Save autumn-n/3f0bb87a43d28d536462e3491770eb5e to your computer and use it in GitHub Desktop.
Save autumn-n/3f0bb87a43d28d536462e3491770eb5e to your computer and use it in GitHub Desktop.
Configuration of .gitlab-ci.yml for newman (without docker)
variables:
POSTMAN_COLLECTION: https://api.getpostman.com/collections/${c_uid}?apikey=${apiKey}
POSTMAN_ENVIRONMENT: https://api.getpostman.com/environments/${e_uid}?apikey=${apiKey}
stages:
- some_stages
- postman
postman_job:
stage: postman
before_script:
- apt-get update -qq && apt-get install -y -qq curl
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- apt-get install -y nodejs
- npm install newman -g
script:
- newman run ${POSTMAN_COLLECTION} -e ${POSTMAN_ENVIRONMENT}
@fellwell5
Copy link

Don't you need to start the server before you can run newman tests?

@autumn-n
Copy link
Author

@fellwell5 No, you don't. Newman just invoke Postman to run test of collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment