vendredi 8 juin 2018

Can the Postman collection be exported in json format with tests not wrapped in events?

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;", "" ] } } ],**

"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