jeudi 27 juin 2019

Pass custom API key in command line with Cypress

I am testing with Cypress, connecting to an external API that requires a key, however I am conscious about not pushing a private key publicly on GitHub.

Is there a way in which I can pass my API key through the command line or in another safe way at the time of running the Cypress app?

"run-cypress": "cypress run --browser chrome --reporter-options configFile=cypress.json"

Could I append something such as

apiKey=abcdefg...

after configFile...? And how would I access this in the code?

Aucun commentaire:

Enregistrer un commentaire