aboutsummaryrefslogtreecommitdiffstats
path: root/test/postman/05_Onboard_VF.postman_collection.json
diff options
context:
space:
mode:
authorRene Robert <rene.robert@orange.com>2019-01-25 15:36:40 +0100
committerRene Robert <rene.robert@orange.com>2019-01-25 15:38:23 +0100
commit6edc789ad4d624fe974ef1252be08f054acf67b4 (patch)
tree4d206e55a1c0e884c8a4ad12677f19bf150de563 /test/postman/05_Onboard_VF.postman_collection.json
parent53ef77f254223e19e8185ffd9de85f101ad187a6 (diff)
add README and corrections
Issue-ID: INT-825 Change-Id: Iac316a6a17aff5acfc9061634232351c4ef305e2 Signed-off-by: Rene Robert <rene.robert@orange.com>
Diffstat (limited to 'test/postman/05_Onboard_VF.postman_collection.json')
-rw-r--r--test/postman/05_Onboard_VF.postman_collection.json36
1 files changed, 21 insertions, 15 deletions
diff --git a/test/postman/05_Onboard_VF.postman_collection.json b/test/postman/05_Onboard_VF.postman_collection.json
index 9b49aa4c8..19a83a0d3 100644
--- a/test/postman/05_Onboard_VF.postman_collection.json
+++ b/test/postman/05_Onboard_VF.postman_collection.json
@@ -15,24 +15,30 @@
"script": {
"type": "text/javascript",
"exec": [
- "tests[\"Status code is 200\"] = responseCode.code === 200;",
- "",
- "var jsonData = JSON.parse(responseBody);",
"var vf_found = false;",
- "for (var i = 0; i < jsonData.length; i++) { ",
- " if (jsonData[i][\"name\"] === postman.getGlobalVariable(\"vf_name\")) {",
- " vf_found = true;",
- " postman.setGlobalVariable(\"auto_vf_uuid\", \"\"+jsonData[i][\"uuid\"]+\"\");",
- " postman.setGlobalVariable(\"auto_vf_invariant_uuid\", \"\"+jsonData[i][\"invariantUUID\"]+\"\");",
- " }",
+ "if (responseCode.code === 404) {",
+ " tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists\"] = true;",
"}",
- "if (vf_found === false) {",
- " tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists, we continue the run\"] = true;",
- "}",
- "",
"else {",
- " tests[postman.getGlobalVariable(\"vf_name\")+\" already exists, stop the run\"] = true;",
- " postman.setNextRequest(null);",
+ " if (responseCode.code === 200) {",
+ " tests[\"Status code is 200\"] = responseCode.code === 200;",
+ " }",
+ " var jsonData = JSON.parse(responseBody);",
+ " for (var i = 0; i < jsonData.length; i++) { ",
+ " if (jsonData[i][\"name\"] === postman.getGlobalVariable(\"vf_name\")) {",
+ " vf_found = true;",
+ " postman.setGlobalVariable(\"auto_vf_uuid\", \"\"+jsonData[i][\"uuid\"]+\"\");",
+ " postman.setGlobalVariable(\"auto_vf_invariant_uuid\", \"\"+jsonData[i][\"invariantUUID\"]+\"\");",
+ " }",
+ " }",
+ " if (vf_found === false) {",
+ " tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists, we continue the run\"] = true;",
+ " }",
+ " ",
+ " else {",
+ " tests[postman.getGlobalVariable(\"vf_name\")+\" already exists, stop the run\"] = true;",
+ " postman.setNextRequest(null);",
+ " }",
"}"
]
}