Newman Docker错误:未知选项“--url';
我发现创建该选项是为了在MAC上运行newman with docker image和postman collection,方法是运行以下命令Newman Docker错误:未知选项“--url';,docker,collections,postman,newman,Docker,Collections,Postman,Newman,我发现创建该选项是为了在MAC上运行newman with docker image和postman collection,方法是运行以下命令 docker pull postman/newman_ubuntu1404 docker run -t postman/newman_ubuntu1404 --url="https://www.getpostman.com/collections/8a0c9bc08f062d12dcda" 在带有postman集合的图像上运行newman时,返回以下
docker pull postman/newman_ubuntu1404
docker run -t postman/newman_ubuntu1404 --url="https://www.getpostman.com/collections/8a0c9bc08f062d12dcda"
在带有postman集合的图像上运行newman时,返回以下错误
error: unknown option `--url'
Docker版本为Docker版本18.06.1-ce,版本e68fc7a
这是否受支持?我发现它说将--url=
替换为run
:
docker run -t postman/newman_ubuntu1404 run "https://www.getpostman.com/collections/8a0c9bc08f062d12dcda"
它似乎起作用了
docker run -t postman/newman_ubuntu1404 run "https://www.getpostman.com/collections/8a0c9bc08f062d12dcda"
newman: Newman v4 deprecates support for the v1 collection format
Use the Postman Native app to export collections in the v2 format
newman
newmanTest
→ GET with URL Params
GET http://httpbin.org/get?lol=true [200 OK, 542B, 339ms]
✓ Response contains params
→ POST with JSON body
POST http://httpbin.org/post [200 OK, 704B, 158ms]
✓ Check POST param in response
→ DELETE request
DELETE http://httpbin.org/delete [200 OK, 606B, 184ms]
✓ Status code is 200
→ PUT with form data
PUT http://httpbin.org/put [200 OK, 687B, 159ms]
✓ Test form data
┌─────────────────────────┬──────────┬──────────┐
│ │ executed │ failed │
├─────────────────────────┼──────────┼──────────┤
│ iterations │ 1 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ requests │ 4 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ test-scripts │ 4 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ prerequest-scripts │ 0 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ assertions │ 4 │ 0 │
├─────────────────────────┴──────────┴──────────┤
│ total run duration: 1204ms │
├───────────────────────────────────────────────┤
│ total data received: 1.52KB (approx) │
├───────────────────────────────────────────────┤
│ average response time: 210ms │
└───────────────────────────────────────────────┘
问题中使用的docker图像现在已经过时,并且附带了一个不使用“-url”的工作示例 码头工人邮递员/纽曼
docker run-t postman/newman run”“在docker中,我们没有任何参数,比如--url。Run docker Run--有关可用选项的帮助。此外,您还可以使用“docker run-d--name'mynewman'postman/newman_ubuntu1404”直接运行该映像。url参数应该做什么?url标志取自下面的邮递员文档,但这看起来很有效,谢谢。很乐意帮忙!如果你认为它能解决你的问题,别忘了把它作为一个答案。谢谢,我会的。虽然它解决了问题并运行了集合,但有一个问题是,如果集合还需要环境变量作为输入,那么如何将其添加到同一个命令中?例如,当从cmd行使用newman运行时,它将作为-e Dev-Test-1-Env.postman_environment.json的一个选项添加。是否可以检查这些选项是否确实有效?我想他们会帮你办案的。