Running postman scripts in bamboo CI server

时间:2019-03-06 11:44:22

标签: continuous-integration postman bamboo newman

my requirement is to run postman scripts in bamboo. We have a repository for the collection.json, however, as my environment file has some sensitive data like client_id, secret_id, username, password etc I can't push it to my repo.

Please advise me how can I run my collections in bamboo using Newman.

1 个答案:

答案 0 :(得分:0)

如果您拥有邮递员帐户,则可以利用环境变量:

  1. 您需要为Postman项目获取X-Api-Key(在Postman帐户上),然后才能使用Postman API调用来获取集合和环境ID。 Here's the link with Postman API documentation.
  2. 将Newman安装到您的npm。 Here are the details about Newman
  3. 从竹子上运行命令行,这将触发Postman测试运行。 该命令将如下所示:

    newman运行https://api.getpostman.com/collections/ {{collectionId}}?apikey = {{ApiKey}} -e https://api.getpostman.com/environments/ {{EnvironmentId}}?apikey = {{{ApiKey}}