Problem Authenticating requests with NEWMAN while building on TRAVIS CI

229 Views Asked by At

I have made a POSTMAN COLLECTION that tests GOOGLE BOOKS API responses to POST requests.
I run this collection with NEWMAN and 2 environment variables : apiKey and dynamicToken.
I then push the project on github using TRAVIS CI to run the tests.

I am encountering remote authentification issues.

While locally (postman or newman cli) authentification works fine : responses status code 200

Once deployed and ran with TRAVIS authentification fails : responses status code 401

I have tried several ways to set the variables that handles authentification.

And finally to isolate the issue I ran the command with hard scripted apyKey and Token.

Here is the command that works locally but not on TRAVIS:

newman run gbook_test.postman_collection.json --env-var "apiKey=<apikeyValue>" --env-var "dynamicToken=<tokenValue>" -d gbook_test.postman_datas.json

Where

  • <apikeyValue>: is the valid value of my apikey,
  • <tokenValue>: is the valid value of my token.

What am I missing ?

Thanks.

0

There are 0 best solutions below