UNPKG

@apica-io/asm-pm-runner

Version:

Run a postman collection in Apica ASM.

221 lines 4.62 kB
{ "info": { "_postman_id": "cae9dd55-f3ad-4fa2-a0b6-efa9bcab3d30", "name": "Trigger Alerts", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Step1: Change URL to F", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "setTimeout(3000);" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "postman.setNextRequest(\"Step2: Trigger check run\")", "" ], "type": "text/javascript" } } ], "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" }, { "key": "Content-Length", "value": "66", "type": "text" } ], "body": { "mode": "raw", "raw": "{\n \"url\": \"https://cldemo.apicasystem.com/223213Default.aspx\"\n }", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{A-HOST}}/checks/browser/45369?auth_ticket={{auth_ticket}}", "host": [ "{{A-HOST}}" ], "path": [ "checks", "browser", "45369" ], "query": [ { "key": "auth_ticket", "value": "{{auth_ticket}}" } ] } }, "response": [] }, { "name": "Step3: Change URL to I", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "", "pm.sendRequest({", " url: pm.environment.get(\"A-HOST\") + \"/checks/45369/job?auth_ticket=\" + pm.environment.get(\"auth_ticket\"),", " headers: {'Content-Type': 'application/json', 'Content-Length':0 },", " method: \"POST\",", " }, ", " function (err, response) {", " setTimeout(function(){}, 3000)", " }", " );" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "postman.setNextRequest(null)" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disabledSystemHeaders": {} }, "request": { "method": "PUT", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "key": "Content-Length", "type": "text", "value": "60", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n \"url\": \"https://cldemo.apicasystem.com/Default.aspx\"\n }", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{A-HOST}}/checks/browser/45369?auth_ticket={{auth_ticket}}", "host": [ "{{A-HOST}}" ], "path": [ "checks", "browser", "45369" ], "query": [ { "key": "auth_ticket", "value": "{{auth_ticket}}" } ] } }, "response": [] }, { "name": "Step2: Trigger check run", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", "});", "", "setTimeout(3000);" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "postman.setNextRequest(\"Step3: Change URL to I\")" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" }, { "key": "Content-Length", "value": "0", "type": "text" } ], "url": { "raw": "{{A-HOST}}/checks/45369/job?auth_ticket={{auth_ticket}}", "host": [ "{{A-HOST}}" ], "path": [ "checks", "45369", "job" ], "query": [ { "key": "auth_ticket", "value": "{{auth_ticket}}" } ] } }, "response": [] } ] }