I faced the problem when contributing to Postman collection created by different people long time ago. JSON created before has a different structure and format from what I get when I export collection in Postman (regardless of the collection version I choose when exporting) - even if I import and export the same file.
The problem is, that the Newman we have on our server does not execute tests that are wrapped in events in exported collection - like this test scripts in events format(it is just an example to show the format):
**"event": [
{ "listen": "test", "script": { "type": "text/javascript", "exec": [ "tests[\"Status code is 200\"] = responseCode.code === 200;", "" ] } } ],**
- it "wants" the "name-value" pairs - like this test scripts in "name-value" format:
"tests":"tests[\"First test\"] = responseBody.has(\"first\");\ntests[\"Second test\"] = responseBody.has(\"second\");",
How can I get such a format (the LAST example) (without rewriting my tests manually in JSON file which is not the way out for a big amount of new tests)?
Aucun commentaire:
Enregistrer un commentaire