mirror of
https://github.com/adidas/api-guidelines.git
synced 2025-10-25 15:19:19 +00:00
1.1 KiB
1.1 KiB
API Testing with Dredd
-
Ruby
$ ruby -v ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16] -
Node.js
$ node -v v7.5.0 -
Install Apiary CLI
$ gem install apiaryio$ apiary version 0.8.0 -
Install Dredd
$ npm install -g dredd@stable --no-optional$ dredd --version dredd v2.2.5 (Darwin 16.4.0; x64) -
Fetch API Description (Swagger) from Apiary
https://help.apiary.io/tools/apiary-cli
https://login.apiary.io/tokens
$ APIARY_API_KEY=<APIARY_API_KEY> apiary fetch --api-name="<API_NAME>" --output="swagger.yaml"EXAMPLE:
API_NAME=bomapi3,APIARY_API_KEY=122131212121212112 -
Run Tests
$ dredd swagger.yaml <HOST>EXAMPLE:
HOST=deheremap7336.emea.adsint.biz:8004 -
Run Tests (The preferred alternative connected to Apiary)
NOTE: You have to have a
dredd.ymlgenerated before hand:$ dredd init -r apiary -j apiaryApiKey:<APIARY_API_KEY> -j apiaryApiName:<API_NAME>.$ dredd