【发布时间】:2018-09-20 23:32:39
【问题描述】:
我有一个包含一些目录的集合,它们也有子目录。
{
"variables": [],
"info": {
"name": "MyCollection",
"_postman_id": "9d4b89df-4e52-e51b-59d1-4baa2c6a424f",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "D1",
"description": "",
"item": [
{
"name": "D11",
"description": "",
"item": [
{
"name": "my_report",
"request": {
"url": "http://192.168.100.139:1998/api/my_report",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "{\"name\": \"zizi\"}"
},
"description": ""
},
"response": []
}
],
"_postman_isSubFolder": true
}
]
},
{
"name": "D2",
"description": "",
"item": [
{
"name": "D22",
"description": "",
"item": [
{
"name": "my_report",
"request": {
"url": "http://192.168.100.139:1998/api/my_report",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "{\"name\": \"zizi\"}"
},
"description": ""
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "D21",
"description": "",
"item": [
{
"name": "my_report",
"request": {
"url": "http://192.168.100.139:1998/api/my_report",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "{\"name\": \"zizi\"}"
},
"description": ""
},
"response": []
}
],
"_postman_isSubFolder": true
}
]
}
]
}
我只想从整个集合中运行D22;这是我尝试过的:
newman run my-collection.json -e my-environ.json --folder "D22"newman run my-collection.json -e my-environ.json --folder "D2/D22"newman run my-collection.json -e my-environ.json --folder "D2.D22"
他们都没有工作。
顺便说一句 newman run my-collection.json -e my-environ.json --folder "D2" 运行良好;它在D21 和D22 中执行测试。
编辑 1:
newman 版本是3.9.1。
【问题讨论】:
-
您运行的是哪个版本的纽曼?在 3.9.1 中修复了文件夹问题 - 可能是这样吗? github.com/postmanlabs/newman/blob/develop/CHANGELOG.yaml
-
我有 3.9.1 @DannyDainton。
-
只是一个建议,可惜不是那么简单。
-
非常感谢您尝试帮助@DannyDainton。
标签: testing postman web-api-testing newman