【发布时间】:2021-05-30 10:37:04
【问题描述】:
我在 circleci 上遇到邮递员的挑战。我的config.yml 看起来像这样。
version: 2.1
orbs:
newman: postman/newman@0.0.2
jobs:
build:
newman-collection-run-env-timeout:
executor: newman/postman-newman-docker
steps:
- checkout
- newman/newman-run:
collection: ./collection/new_test.postman_collection.json
environment: ./env/New-lamp-staging.postman_environment.json
当我部署到 circleci 时,我得到了这个错误
❏ auth
↳ Register: 201 Created
POST https://stagingauth.herokuapp.com/auth/accounts/register/ [415 Unsupported Media Type, 377B, 109ms]
1. Status code is 201
↳ Register: 400 Bad Request
POST https://stagingauth.herokuapp.com/auth/accounts/register/ [415 Unsupported Media Type, 377B, 19ms]
2. Status code is 400
请问我做错了什么?
【问题讨论】:
-
报错说服务器不接受请求体,在postman中调试看看
-
@PDHide 它在邮递员上运行良好。 Circleci 没有将请求正文识别为 json 对象。
-
这是最新的版本,2019年创建的,如果你有更新的版本,请分享。
-
尝试使用 newman npm 模块运行该 json 文件,可能是您没有正确导出集合和环境
-
我做到了,当我执行 newman run @PDHide 时它起作用了。请检查此要点以获取结果gist.github.com/bhadmus/d55576460920e210594c02e28859bcf8
标签: api continuous-integration postman circleci newman