CircleCI邮差API自动测试不工作



我在快递上遇到了这个挑战。我的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

当我部署到循环时,我得到了这个错误

❏ 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
请问我做错了什么?

您有两个不同的收集结果,请查看您在git中上传的结果文件,url为

https://stagingauth.herokuapp.com/auth/token/jwt

但是在圆圈CI中url是

https://stagingauth.herokuapp.com/auth/token

所以你试图在一个错误的资源上做post操作,这就是为什么得到415

请确保您使用正确的集合和环境文件和url,并且变量值是正确的

最新更新