[英]Newman Docker error: unknown option `--url'
I found the option was created to run newman with docker image and postman collection on MAC by running the following我发现该选项被创建为通过运行以下命令在 MAC 上运行带有 docker 图像和邮递员集合的 newman
docker pull postman/newman_ubuntu1404
docker run -t postman/newman_ubuntu1404 --url="https://www.getpostman.com/collections/8a0c9bc08f062d12dcda"
When running newman on the image with the postman collection the following error is returned.在带有邮递员集合的图像上运行 newman 时,将返回以下错误。
error: unknown option `--url'
Docker version is Docker version 18.06.1-ce, build e68fc7a Docker 版本为 Docker 版本 18.06.1-ce,构建 e68fc7a
Is this supported?这是支持的吗?
I've found this github issue where it says to replace --url=
with run
:我发现了这个github 问题,它说用run
替换--url=
:
docker run -t postman/newman_ubuntu1404 run "https://www.getpostman.com/collections/8a0c9bc08f062d12dcda"
It seems to work...它似乎工作...
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 │
└───────────────────────────────────────────────┘
The docker image used in the question is now obsolete and the new official image comes along a working example that does not use "--url"问题中使用的 docker 映像现已过时,新的官方映像附带了一个不使用“--url”的工作示例
docker pull postman/newman码头工人拉邮递员/纽曼
docker run -t postman/newman run " https://www.getpostman.com/collections/8a0c9bc08f062d12dcda " docker run -t postman/newman run " https://www.getpostman.com/collections/8a0c9bc08f062d12dcda "
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.