Newman実行サンプル

newmanコマンド実行したときの備忘録です。

複数回一気に実行したい場合はこちらの記事に備忘録を残しています。

前提条件

[Software]

  • Node.js インストール済であること(検証Ver: v12.18.2)

[npm]

  • newman インストール済であること (検証Ver:5.1.0)
  • newman-reporter-htmlextra インストール済であること(検証Ver:1.17.2)

入力ファイル

環境設定ファイル

C:\workdir\Environment\wether_env.postman_environment.json

{
"id": "bbe20c04-bf30-4507-9b59-f3b43fc0344a",
"name": "wether_env",
"values": [
{
"key": "city-code",
"value": "130010",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2020-06-19T09:22:59.537Z",
"_postman_exported_using": "Postman/7.22.1"
}

コレクションファイル

C:\workdir\Request\Wether.postman_collection.json

Wether.postman_collection.json

データファイル

C:\workdir\DataFiles\wether-data.json

[
{
"TestCaseId": "TestCaseId-001",
"city-code": "130010",
"city-name": "東京",
"expected-telop": "晴れ"
},
{
"TestCaseId": "TestCaseId-002",
"city-code": "270000",
"city-name": "大阪",
"expected-telop": "曇り"
},
{
"TestCaseId": "TestCaseId-003",
"city-code": "471010",
"city-name": "那覇",
"expected-telop": "雨"
}
]


実行コマンド

newman run Request/Wether.postman_collection.json -e Environment/wether_env.postman_environment.json -d DataFiles/wether-data.json -n 3 -r "json,htmlextra" --disable-unicode --reporter-json-export LOGDIR/result_Wether.json --reporter-htmlextra-export LOGDIR/result_Wether.html

実行結果

JSONファイル

C:\workdir\LOGDIR\result_Wether.json

内容は割愛

HTMLファイル

C:\workdir\LOGDIR\result_Wether.html

内容は割愛

タイトルとURLをコピーしました