| { |
| "info": { |
| "_postman_id": "69fb733b-51ec-49b2-aa04-e2330c1d26b6", |
| "name": "WAVE Server REST API Tests copy", |
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" |
| }, |
| "item": [ |
| { |
| "name": "Read Available Tests", |
| "item": [ |
| { |
| "name": "Read Available Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "7c432e7c-d0f9-4583-977a-55ca5d1e42a2", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var availableTests = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(typeof availableTests).to.equal(\"object\");", |
| " for (var api of Object.keys(availableTests)) {", |
| " pm.expect(availableTests[api]).to.be.an.instanceof(Array);", |
| " var apiRegExp = new RegExp(\"^/\" + api, \"i\");", |
| " for (var test of availableTests[api]) {", |
| " pm.expect(test).to.match(apiRegExp);", |
| " }", |
| " }", |
| "});", |
| "", |
| "var includedTests = [];", |
| "var excludedTests = [];", |
| "var specialTimeoutTest = \"\";", |
| "", |
| "var apis = Object.keys(availableTests);", |
| "for(var api of apis) {", |
| " if (availableTests[api].length > 50) {", |
| " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part).join(\"/\").split(\"/\")[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", |
| " if (subDirs.length > 2) {", |
| " includedTests.push(\"/\" + api);", |
| " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", |
| " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", |
| " break;", |
| " }", |
| " ", |
| " }", |
| "}", |
| "", |
| "pm.globals.set(\"available_tests\", availableTests);", |
| "pm.globals.set(\"included_tests\", JSON.stringify(includedTests));", |
| "pm.globals.set(\"excluded_tests\", JSON.stringify(excludedTests));", |
| "pm.globals.set(\"special_timeout_test\", specialTimeoutTest.replace(\".\", \"\"));" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Create and Read Sessions", |
| "item": [ |
| { |
| "name": "Start expiring session remove expiration date", |
| "item": [ |
| { |
| "name": "Create Session With Expiration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "71470bf7-293b-4863-a74e-193d86f2e6ac", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "7d59b7a7-78f8-46fc-a3f1-bd06f7ec31b7", |
| "exec": [ |
| "var expirationDate = Date.now() + 10000;", |
| "pm.globals.set(\"expiration_date\", expirationDate);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n\t\"expiration_date\": {{expiration_date}}\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "daaa5a98-f330-4ca5-afc5-c4051e7a94c1", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure contains expiration date\", function () {", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| "});", |
| "", |
| "var expirationDate = pm.globals.get(\"expiration_date\");", |
| "", |
| "pm.test(\"Expiration date is as specified\", function () {", |
| " pm.expect(Date.parse(jsonData.expiration_date)).to.equal(expirationDate);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "d6e7a096-5bed-44b0-8772-ab80c1f53447", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "66075d71-55ed-4835-b6b5-ada854653d04", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure contains expiration date\", function () {", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| "});", |
| "", |
| "pm.test(\"Expiration date is null\", function () {", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Read Public Sessions", |
| "item": [ |
| { |
| "name": "Read Public Sessions", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "a365eb0b-ba55-490a-8cd9-7286a1d39cd2", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Response is JSON Array\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.be.an.instanceof(Array);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/public", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "public" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Find Session", |
| "item": [ |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "52719d31-ef36-4b74-8c5c-05d554e916c0", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Find Session Token", |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "753a7451-2a92-4de0-a2e2-d0d9c66de134", |
| "exec": [ |
| "const token = pm.globals.get(\"session_token\");", |
| "pm.globals.set(\"session_token_fragment\", token.split(\"-\").shift());" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "2a465de6-f66e-4161-ad7e-7c1c3738befd", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const sessionToken = pm.globals.get(\"session_token\");", |
| "", |
| "pm.test(\"Found token is original token\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.token).to.equal(sessionToken);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token_fragment}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token_fragment}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Find Session Too Short Fragment", |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "0e7ff96f-8c5a-46f3-a1a0-258ad59b96e0", |
| "exec": [ |
| "const token = pm.globals.get(\"session_token\");", |
| "pm.globals.set(\"session_token_fragment\", token.split(\"-\").shift());" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "eb36e017-4cdc-458a-b399-8998df800fa1", |
| "exec": [ |
| "pm.test(\"Status code is 404\", function () {", |
| " pm.response.to.have.status(404);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/1234567", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "1234567" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Read Next Test", |
| "item": [ |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Invalid Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "9c8af59c-8d9b-4264-acb5-a0bdf3af434a", |
| "exec": [ |
| "pm.test(\"Status code is 404\", function () {", |
| " pm.response.to.have.status(404);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session \\w Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c16bf66e-283e-40b9-b98d-8b058ec1575a", |
| "exec": [ |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "66780bc8-88e6-44d2-a6c8-5c649141accd", |
| "exec": [ |
| "var automaticTimeout = 120000;", |
| "var manualTimeout = 1000000;", |
| "var specialTimeout = 2000;", |
| "", |
| "pm.globals.set(\"automatic_timeout\", automaticTimeout);", |
| "pm.globals.set(\"manual_timeout\", manualTimeout);", |
| "pm.globals.set(\"special_timeout\", specialTimeout);", |
| "", |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const test1 = availableTests[Object.keys(availableTests)[0]][0];", |
| "", |
| "pm.globals.set(\"single_test_1\", test1);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\"]\n },\n \"types\": [\n \"automatic\"\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Pending Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "82ca12ad-3be5-419a-9a45-14164b0eaf60", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const nextTest = jsonData.next_test;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "", |
| "const web_root = pm.environment.get(\"web_root\");", |
| "", |
| "pm.test(\"Returned test is new session page\", function () {", |
| " pm.expect(test).to.equal(\"/\" + web_root + \"/newsession.html\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "135d7d9e-1869-4c02-9c6a-7c0ea522e140", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Running Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "1bfe8c41-2144-46de-824d-2d1e3c88205b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const nextTest = jsonData.next_test;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "const api = test.split(\"/\").filter(part => !!part)[0]", |
| "const availableTests = pm.globals.get(\"available_tests\")", |
| "", |
| "pm.test(\"Returned test is valid test\", function () {", |
| " pm.expect(availableTests).to.have.property(api);", |
| " pm.expect(availableTests[api]).to.contain(test)", |
| "});", |
| "", |
| "", |
| "setTimeout(function () {}, 1000);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Result", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "02cfcc68-43ed-4533-a80c-699954900390", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Completed Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c8f3d89b-34ca-4d39-977e-638d3630ee5b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const nextTest = jsonData.next_test;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "", |
| "const web_root = pm.environment.get(\"web_root\");", |
| "", |
| "pm.test(\"Returned test is new session page\", function () {", |
| " pm.expect(test).to.equal(\"/\" + web_root + \"/finish.html\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session \\w Configuration Copy", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "bcde140e-51cf-4d7c-b745-5e56f9b59034", |
| "exec": [ |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "c4354118-88ff-4b5a-9252-dac19264c262", |
| "exec": [ |
| "var automaticTimeout = 120000;", |
| "var manualTimeout = 1000000;", |
| "var specialTimeout = 2000;", |
| "", |
| "pm.globals.set(\"automatic_timeout\", automaticTimeout);", |
| "pm.globals.set(\"manual_timeout\", manualTimeout);", |
| "pm.globals.set(\"special_timeout\", specialTimeout);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\"\n ],\n \"timeouts\": {\n \"automatic\": 1000\n },\n \"labels\": [\"label1\", \"label2\"]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "737fc854-7901-4819-96eb-4883f5b15bc9", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "a28a515f-0e48-4c23-a418-3b30c1e6dc71", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Aborted Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "1b842c47-c67c-4bfe-a77d-7d5b553e001b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const nextTest = jsonData.next_test;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "", |
| "const web_root = pm.environment.get(\"web_root\");", |
| "", |
| "pm.test(\"Returned test is new session page\", function () {", |
| " pm.expect(test).to.equal(\"/\" + web_root + \"/pause.html\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Stop Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e2318e93-7446-43be-ad52-99201a85fcbf", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "stop" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Aborted Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c3bdd37f-c048-4a2a-979b-deca61758292", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const nextTest = jsonData.next_test;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "", |
| "const web_root = pm.environment.get(\"web_root\");", |
| "", |
| "pm.test(\"Returned test is new session page\", function () {", |
| " pm.expect(test).to.equal(\"/\" + web_root + \"/finish.html\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Control Session", |
| "item": [ |
| { |
| "name": "Setup", |
| "item": [ |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "506a2f52-ab98-4e61-943c-ca0f7cab7f28", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Pause Pending Session", |
| "item": [ |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "85ee0aec-9fbd-4544-a938-fb821e576fac", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "f42cdf2c-5304-420d-b79d-f3345ac4455d", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is pending\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"pending\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Start Pending Session", |
| "item": [ |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "01d6bfab-8ec5-4317-8595-667778be42d8", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "dec9ab62-5014-4b6e-a747-be83dce71a3d", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "pm.test(\"Status is running\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"running\");", |
| "});", |
| "", |
| "pm.test(\"Start date is set\", function () {", |
| " pm.expect(Date.parse(jsonData.date_started)).to.be.below(Date.now());", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Start Running Session", |
| "item": [ |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "1db3770b-6fa9-40b9-875c-56d113d0ff5b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "84ccae85-36d6-4226-850c-269cbfddff8e", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is running\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"running\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Pause Running Session", |
| "item": [ |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "29e3a3ed-7b75-43a2-99b3-7300bd39044a", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "614689fb-9d26-4ac1-b89c-eca305a957f2", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is paused\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"paused\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Pause Paused Session", |
| "item": [ |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "221d9b75-af5c-4aa9-b13b-6d3af10578aa", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "34147223-f4f2-4c11-a60b-09396d46c152", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is paused\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"paused\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Start Paused Session", |
| "item": [ |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "41b686b9-80e9-4c16-906d-ca948c0873a6", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "7a053b4c-87c6-426c-95d6-750c5d478aba", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is running\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"running\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Stop Running Session", |
| "item": [ |
| { |
| "name": "Stop Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "52600705-47f5-4ec7-bf3c-ff2243022625", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "stop" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "39c0a314-3efe-4977-8c20-33666ea8e0e6", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "pm.test(\"Status is aborted\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"aborted\");", |
| "});", |
| "", |
| "pm.test(\"Finish date is set\", function () {", |
| " pm.expect(Date.parse(jsonData.date_finished)).to.be.below(Date.now());", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Stop Aborted Session", |
| "item": [ |
| { |
| "name": "Stop Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "0d53b83e-5b8b-4d69-980f-ddc2736d2a5f", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "stop" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "4217abb8-3e6e-4125-8aaf-92b378136f87", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is aborted\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"aborted\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "f66a7794-ade7-41e7-abc6-560af7acfd53", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "04ca0247-e30e-470a-8282-d7a5eafc5b92", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Start Aborted Session", |
| "item": [ |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "0a17b42b-dc5e-4588-88c5-b8bc29065dd0", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "5b908a57-2fe5-4309-86ab-933c196badfd", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is aborted\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"aborted\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "fe61b75f-f106-43f6-bcaf-ad4400ae1ef4", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "f94a7f25-72eb-4bcf-9ddb-573ca2cfbb1f", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Pause Aborted Session", |
| "item": [ |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c3915b66-bcd4-4a23-8b74-2fd9c16210d8", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c94d14bf-e48f-4a85-8939-e45bc66be6d0", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is aborted\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"aborted\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "eb6a4051-3cd7-4d75-93ec-8f0c4463cc98", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "64295661-300d-4773-8856-6c3ecbe158b0", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Setup", |
| "item": [ |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "4d33ee50-4368-42f3-b8a4-ab0ff27f00f6", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "6a217097-fdf7-4c99-b005-723acf9b8389", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "37c80a2a-9508-4e8d-93d5-dfbfac837bed", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Stop Pending Session", |
| "item": [ |
| { |
| "name": "Stop Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "6d0635aa-2b63-4e0f-89d2-da4d47741160", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "stop" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "90895f8b-5398-4eeb-9f35-5869736dc46c", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is aborted\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"aborted\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Setup", |
| "item": [ |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e4929021-a5b2-4839-8537-bfb7ea1935c2", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "2e2703a2-d74f-46ba-b168-9f3b64888086", |
| "exec": [ |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "df98f07d-4bb3-467d-92aa-e9122db42e31", |
| "exec": [ |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "c3e166ef-de4b-4c02-89c3-547aaa7a6555", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "a86891f3-8f1d-48c6-9e08-0a792bb1627a", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Stop Paused Session Copy", |
| "item": [ |
| { |
| "name": "Stop Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "3ea151c0-8286-419f-bed6-0c06da912850", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "stop" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "f10cf08b-9a1a-4f3e-8b3e-8be52f82734e", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is aborted\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"aborted\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "a1b3bf2e-4d09-4ee1-9063-6c4c842fcd94", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "a6745e90-5382-445d-9d65-db74aff7af1b", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Setup", |
| "item": [ |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session One Test", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "da2ec442-44fd-432e-b335-abe4dd73c182", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "47665454-d468-4964-8167-bd80051a3937", |
| "exec": [ |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const test = availableTests[Object.keys(availableTests)[0]][0]", |
| "", |
| "pm.globals.set(\"single_test\", test);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test}}\"]\n }\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "8a575b02-40ff-404c-a344-d768c218caba", |
| "exec": [ |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e8ab1a02-2be0-43ee-be8b-04967b5aaff3", |
| "exec": [ |
| "const response = pm.response.json();", |
| "const nextTest = response.next_test;", |
| "pm.globals.set(\"current_test_url\", nextTest);", |
| "if (!nextTest) return;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "pm.globals.set(\"current_test\", test);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Result", |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "be410b75-d674-4ef3-8dda-5731f4dbcbd5", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "706efcea-90f2-4206-8246-b82240e719fb", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Start Completed Session", |
| "item": [ |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "a68edf67-0a80-450d-8f4e-921626491163", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "d3495b7e-e4b7-47a0-9589-f2d145915846", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is completed\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"completed\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Pause Completed Session", |
| "item": [ |
| { |
| "name": "Pause Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "f1ca8fab-80d3-4d92-887e-018cb6536a9f", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "pause" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c220fdc3-b483-40fa-ae88-bf7f57415d90", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is completed\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"completed\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Stop Completed Session", |
| "item": [ |
| { |
| "name": "Stop Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "a9130ab9-562e-48d9-a7c1-f8cb3bb8d85e", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "stop" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "013fa69e-f98b-4124-ac3f-cbc1bb4c5078", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Status is completed\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData.status).to.equal(\"completed\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Clean Up", |
| "item": [ |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Update and Read Sessions", |
| "item": [ |
| { |
| "name": "Create Default", |
| "item": [ |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "6ed4bed9-b4d6-4463-beca-4c4c09a23e44", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e2eba0d4-9e38-4a5c-9aa0-9874c70f0788", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"tests\");", |
| " pm.expect(typeof jsonData.tests).to.equal(\"object\");", |
| " pm.expect(jsonData.tests).to.have.property(\"include\");", |
| " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData.tests).to.have.property(\"exclude\");", |
| " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"types\");", |
| " pm.expect(jsonData.types).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"user_agent\");", |
| " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"timeouts\");", |
| " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", |
| " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", |
| " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", |
| " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", |
| " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", |
| " pm.expect(jsonData).to.have.property(\"browser\");", |
| " pm.expect(typeof jsonData.browser).to.equal(\"object\");", |
| " pm.expect(jsonData.browser).to.have.property(\"name\");", |
| " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", |
| " pm.expect(jsonData.browser).to.have.property(\"version\");", |
| " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"reference_tokens\");", |
| " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", |
| "});", |
| "", |
| "pm.test(\"Configuration is default\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " pm.expect(jsonData.tests.include).to.include(\"/\");", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(300000);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "22d812a9-5d6f-4cbb-924e-cbe4392072ad", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"status\");", |
| " pm.expect(typeof jsonData.status).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| " pm.expect(jsonData).to.have.property(\"date_started\");", |
| " pm.expect(jsonData.date_started).to.satisfy(value => !value || typeof value === \"number\");", |
| " pm.expect(jsonData).to.have.property(\"date_finished\");", |
| " pm.expect(jsonData.date_finished).to.satisfy(value => !value || typeof value === \"number\");", |
| "});", |
| "", |
| "pm.test(\"Session status is pending\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"pending\");", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "d06b4cb9-f5b9-4a88-8a24-a195e59c298e", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "pm.test(\"All tests are pending tests\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", |
| "})", |
| "", |
| "const availableTests = pm.globals.get(\"available_tests\"); ", |
| "", |
| "pm.test(\"All available tests are part of the session\", function () {", |
| " for (var api of Object.keys(jsonData.pending_tests)) {", |
| " for (var test of jsonData.pending_tests[api]) {", |
| " pm.expect(availableTests[api]).to.include(test);", |
| " }", |
| " }", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "bcf419eb-495a-4558-95de-45dea07bd6b0", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "86795630-9b19-49f3-988e-ac089ef76187", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Update With Configuration", |
| "item": [ |
| { |
| "name": "Update Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "181e1f95-34d7-4c2c-bc3c-b6d5f411807d", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "46e33bfe-0783-49f8-a9bc-98e26a34b55e", |
| "exec": [ |
| "var automaticTimeout = 120000;", |
| "var manualTimeout = 1000000;", |
| "var specialTimeout = 2000;", |
| "", |
| "pm.globals.set(\"automatic_timeout\", automaticTimeout);", |
| "pm.globals.set(\"manual_timeout\", manualTimeout);", |
| "pm.globals.set(\"special_timeout\", specialTimeout);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "PUT", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\"\n ],\n \"timeouts\": {\n \"automatic\": {{automatic_timeout}},\n \"manual\": {{manual_timeout}},\n \"{{special_timeout_test}}\": {{special_timeout}}\n }\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "dd86be15-3e08-491e-b56b-274531c348e6", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"tests\");", |
| " pm.expect(typeof jsonData.tests).to.equal(\"object\");", |
| " pm.expect(jsonData.tests).to.have.property(\"include\");", |
| " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData.tests).to.have.property(\"exclude\");", |
| " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"types\");", |
| " pm.expect(jsonData.types).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"user_agent\");", |
| " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"timeouts\");", |
| " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", |
| " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", |
| " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", |
| " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", |
| " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", |
| " pm.expect(jsonData).to.have.property(\"browser\");", |
| " pm.expect(typeof jsonData.browser).to.equal(\"object\");", |
| " pm.expect(jsonData.browser).to.have.property(\"name\");", |
| " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", |
| " pm.expect(jsonData.browser).to.have.property(\"version\");", |
| " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"reference_tokens\");", |
| " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", |
| "});", |
| "", |
| "var includedTests = JSON.parse(pm.globals.get(\"included_tests\"));", |
| "var excludedTests = JSON.parse(pm.globals.get(\"excluded_tests\"));", |
| "var automaticTimeout = pm.globals.get(\"automatic_timeout\");", |
| "var manualTimeout = pm.globals.get(\"manual_timeout\");", |
| "var specialTimeout = pm.globals.get(\"special_timeout\");", |
| "var specialTimeoutTest = pm.globals.get(\"special_timeout_test\");", |
| "", |
| "pm.test(\"Configuration is as specified\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " for (var test of includedTests) {", |
| " pm.expect(jsonData.tests.include).to.include(test);", |
| " }", |
| " for (var test of excludedTests) {", |
| " pm.expect(jsonData.tests.exclude).to.include(test);", |
| " }", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.not.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(automaticTimeout);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(manualTimeout);", |
| " pm.expect(jsonData.timeouts[specialTimeoutTest]).to.equal(specialTimeout);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "569dc8f6-39d4-4ec6-9466-64154671e4bc", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "pm.test(\"All tests are pending tests\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", |
| "})", |
| "", |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const includedTests = pm.globals.get(\"included_tests\");", |
| "const excludedTests = pm.globals.get(\"excluded_tests\");", |
| "", |
| "pm.test(\"Selected subset of tests are part of the session\", function () {", |
| " for (var api of Object.keys(jsonData.pending_tests)) {", |
| " for (var includedTest of includedTests) {", |
| " if (includedTest.split(\"/\").find(part => !!part) === api) {", |
| " var includeRegExp = new RegExp(\"^\" + includedTest, \"i\");", |
| " for (var test of jsonData.pending_tests[api]) {", |
| " pm.expect(test).to.match(regex);", |
| " }", |
| " break;", |
| " }", |
| " }", |
| " for (var excludedTest of excludedTests) {", |
| " if (excludedTest.split(\"/\").find(part => !!part) === api) {", |
| " var excludeRegExp = new RegExp(\"^\" + excludedTest, \"i\");", |
| " for (var test of jsonData.pending_tests[api]) {", |
| " pm.expect(test).to.not.match(regex);", |
| " }", |
| " break;", |
| " }", |
| " }", |
| " }", |
| "});", |
| "", |
| "const sessionTests = jsonData.pending_tests;", |
| "", |
| "pm.globals.set(\"session_tests\", JSON.stringify(sessionTests));" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "db83ae93-7a70-4267-8a2f-3d2e7cb40b88", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"status\");", |
| " pm.expect(typeof jsonData.status).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| " pm.expect(jsonData).to.have.property(\"date_started\");", |
| " pm.expect(jsonData.date_started).to.satisfy(value => !value || typeof value === \"number\");", |
| " pm.expect(jsonData).to.have.property(\"date_finished\");", |
| " pm.expect(jsonData.date_finished).to.satisfy(value => !value || typeof value === \"number\");", |
| "});", |
| "", |
| "pm.test(\"Session status is pending\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"pending\");", |
| "})", |
| "", |
| "pm.test(\"Start and Finish date not set\", function () {", |
| " pm.expect(jsonData.date_started).to.be.null;", |
| " pm.expect(jsonData.date_finished).to.be.null;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "52cc597e-30b7-426e-a15e-3a628c66619a", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "60d6def7-cb5b-433f-8a4e-33bd8e20be53", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Update Session Labels", |
| "item": [ |
| { |
| "name": "Create Session \\w Configuration Copy", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "a1c2e070-9309-4dee-ae71-6edf4cbe3630", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "1f03ad23-73c7-4e64-9de9-abe902e2b90c", |
| "exec": [ |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"labels\": [\"label1\", \"label2\"]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "bf76f47c-960c-4007-a59b-92793e470082", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"tests\");", |
| " pm.expect(typeof jsonData.tests).to.equal(\"object\");", |
| " pm.expect(jsonData.tests).to.have.property(\"include\");", |
| " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData.tests).to.have.property(\"exclude\");", |
| " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"types\");", |
| " pm.expect(jsonData.types).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"user_agent\");", |
| " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"timeouts\");", |
| " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", |
| " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", |
| " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", |
| " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", |
| " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", |
| " pm.expect(jsonData).to.have.property(\"browser\");", |
| " pm.expect(typeof jsonData.browser).to.equal(\"object\");", |
| " pm.expect(jsonData.browser).to.have.property(\"name\");", |
| " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", |
| " pm.expect(jsonData.browser).to.have.property(\"version\");", |
| " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"reference_tokens\");", |
| " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"labels\");", |
| " pm.expect(jsonData.labels).to.be.an.instanceof(Array);", |
| "});", |
| "", |
| "pm.test(\"Configuration is default\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " pm.expect(jsonData.tests.include).to.include(\"/\");", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(300000);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| " pm.expect(jsonData.labels).to.include(\"label1\");", |
| " pm.expect(jsonData.labels).to.include(\"label2\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Update Labels Copy", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "20cc9f7d-b4bb-4bb2-a628-4cfddd86112a", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "PUT", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n\t\"labels\": [\"new\", \"labels\"]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/labels", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "labels" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "11fcc51b-effd-4522-8126-6b6a20435927", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"tests\");", |
| " pm.expect(typeof jsonData.tests).to.equal(\"object\");", |
| " pm.expect(jsonData.tests).to.have.property(\"include\");", |
| " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData.tests).to.have.property(\"exclude\");", |
| " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"types\");", |
| " pm.expect(jsonData.types).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"user_agent\");", |
| " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"timeouts\");", |
| " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", |
| " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", |
| " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", |
| " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", |
| " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", |
| " pm.expect(jsonData).to.have.property(\"browser\");", |
| " pm.expect(typeof jsonData.browser).to.equal(\"object\");", |
| " pm.expect(jsonData.browser).to.have.property(\"name\");", |
| " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", |
| " pm.expect(jsonData.browser).to.have.property(\"version\");", |
| " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"reference_tokens\");", |
| " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"labels\");", |
| " pm.expect(jsonData.labels).to.be.an.instanceof(Array);", |
| "});", |
| "", |
| "pm.test(\"Configuration is default\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " pm.expect(jsonData.tests.include).to.include(\"/\");", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(300000);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| " pm.expect(jsonData.labels).to.include(\"new\");", |
| " pm.expect(jsonData.labels).to.include(\"labels\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean Up", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Delete Session", |
| "item": [ |
| { |
| "name": "Setup", |
| "item": [ |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "2b7198ef-6051-40ee-af4f-466bf41e3768", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Delete Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "cabccfe1-882e-48bf-9946-4b8f67b09f04", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "cad95ed0-822a-433b-b411-adf3b2e5ea77", |
| "exec": [ |
| "pm.test(\"Status code is 404\", function () {", |
| " pm.response.to.have.status(404);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Create and Read Results", |
| "item": [ |
| { |
| "name": "Create Session", |
| "item": [ |
| { |
| "name": "Create Session Two Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "3c82b199-e27f-4b86-b98d-9f10ad2b363f", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "70ad16d3-5df7-4c94-9498-f5abd0b6f76c", |
| "exec": [ |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const test1 = availableTests[Object.keys(availableTests)[0]][0];", |
| "const test2 = availableTests[Object.keys(availableTests)[1]][0];", |
| "", |
| "pm.globals.set(\"single_test_1\", test1);", |
| "pm.globals.set(\"single_test_2\", test2);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\", \"{{single_test_2}}\"]\n }\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "074aff68-931d-4d31-b138-d9068bc57422", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Results", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "9440583c-b8a5-4488-93aa-e37daf96485a", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Responds with no results\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(typeof jsonData).to.equal(\"object\");", |
| " pm.expect(Object.keys(jsonData)).to.be.empty;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ], |
| "query": [ |
| { |
| "key": "path", |
| "value": "/2dcontext/drawing-images-to-the-canvas", |
| "disabled": true |
| }, |
| { |
| "key": "path", |
| "value": "/2dcontext/conformance-requirements", |
| "disabled": true |
| }, |
| { |
| "key": "path", |
| "value": "/2dcontext/conformance-requirements/2d.missingargs.html", |
| "disabled": true |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Results Compact", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "50b9afe7-63ef-40ae-a6ea-5abbd40f254d", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var singleTest1 = pm.globals.get(\"single_test_1\");", |
| "var singleTest2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "var api1 = singleTest1.split(\"/\").find(part => !!part);", |
| "var api2 = singleTest2.split(\"/\").find(part => !!part);", |
| "", |
| "pm.test(\"Responds with no results\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(typeof jsonData).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(api1);", |
| " pm.expect(jsonData).to.have.property(api2);", |
| " pm.expect(jsonData[api1].complete).to.equal(0);", |
| " pm.expect(jsonData[api2].complete).to.equal(0);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "compact" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Last Completed Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "f0c77dd0-d424-4b6e-8bfa-3e0ea5908514", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| " ", |
| "pm.test(\"JSON format is as expected\", function () {", |
| " pm.expect(Object.keys(jsonData)).to.have.lengthOf(3);", |
| " pm.expect(jsonData).to.have.property(\"pass\");", |
| " pm.expect(jsonData).to.have.property(\"fail\");", |
| " pm.expect(jsonData).to.have.property(\"timeout\");", |
| " for (var key of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[key]).to.be.an.instanceof(Array);", |
| " }", |
| "});", |
| "", |
| "pm.test(\"Responds with no last completed tests\", function () {", |
| " for (var key of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[key]).to.be.empty;", |
| " }", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/last_completed", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "last_completed" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "bfdb82c2-1411-4e22-810b-a1f7edb8d2f4", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "const sessionTests = jsonData.pending_tests;", |
| "", |
| "pm.globals.set(\"session_tests\", JSON.stringify(sessionTests));" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Create First Result", |
| "item": [ |
| { |
| "name": "Read Next Test of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "2a60296d-953b-430d-a21d-df99265b90c1", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(Object.keys(response)).to.have.lengthOf(1);", |
| " pm.expect(response).to.have.property(\"next_test\");", |
| " pm.expect(typeof response.next_test).to.equal(\"string\");", |
| "});", |
| "", |
| "const nextTest = response.next_test;", |
| "pm.globals.set(\"current_test_url\", nextTest);", |
| "if (!nextTest) return;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "pm.globals.set(\"current_test\", test);", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "", |
| "pm.test(\"Returned test is first of two specified tests\", function () {", |
| " pm.expect(test).to.equal(test1);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "42168b0e-8be9-4211-8c4a-5a0776a3d131", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "pm.test(\"One test is pending, one test is running\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(1);", |
| " var api = Object.keys(jsonData.pending_tests)[0];", |
| " pm.expect(jsonData.pending_tests[api]).to.have.lengthOf(1);", |
| " pm.expect(jsonData.pending_tests[api]).to.include(test2);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(1);", |
| " api = Object.keys(jsonData.running_tests)[0];", |
| " pm.expect(jsonData.running_tests[api]).to.have.lengthOf(1);", |
| " pm.expect(jsonData.running_tests[api]).to.include(test1);", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Result", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "95a23ee1-f9e9-4b6a-abf5-4afa48ba5254", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "707c403b-7135-4e0b-aae8-4fa4f07daac9", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "pm.test(\"One test is pending, one test is completed\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(1);", |
| " var api = Object.keys(jsonData.pending_tests)[0];", |
| " pm.expect(jsonData.pending_tests[api]).to.have.lengthOf(1);", |
| " pm.expect(jsonData.pending_tests[api]).to.include(test2);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "7b77cb94-4159-462c-877b-23b48446a1bb", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"status\");", |
| " pm.expect(typeof jsonData.status).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| " pm.expect(jsonData).to.have.property(\"date_started\");", |
| " pm.expect(jsonData).to.have.property(\"date_finished\");", |
| "});", |
| "", |
| "pm.test(\"Session status is running\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"running\");", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Last Completed Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "8ba5726b-ed37-48f5-9389-4f6041b1eeaa", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| " ", |
| "pm.test(\"JSON format is as expected\", function () {", |
| " pm.expect(Object.keys(jsonData)).to.have.lengthOf(3);", |
| " pm.expect(jsonData).to.have.property(\"pass\");", |
| " pm.expect(jsonData).to.have.property(\"fail\");", |
| " pm.expect(jsonData).to.have.property(\"timeout\");", |
| " for (var key of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[key]).to.be.an.instanceof(Array);", |
| " }", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "", |
| "pm.test(\"Responds with one last completed tests as failed\", function () {", |
| " pm.expect(jsonData[\"pass\"]).to.be.empty;", |
| " pm.expect(jsonData[\"fail\"]).to.have.lengthOf(1);", |
| " pm.expect(jsonData[\"fail\"][0]).to.equal(test1);", |
| " pm.expect(jsonData[\"timeout\"]).to.be.empty;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/last_completed", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "last_completed" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Results", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "5ac4de17-caf3-43b2-8eb8-fee26eed5c96", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON format is as expected\", function () {", |
| " for (var api of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[api]).to.be.an.instanceof(Array);", |
| " for (var result of jsonData[api]) {", |
| " pm.expect(typeof result).to.equal(\"object\");", |
| " pm.expect(Object.keys(result)).to.have.lengthOf(4);", |
| " pm.expect(result).to.have.property(\"test\");", |
| " pm.expect(typeof result.test).to.equal(\"string\");", |
| " pm.expect(result).to.have.property(\"status\");", |
| " pm.expect(typeof result.status).to.equal(\"string\");", |
| " pm.expect(result).to.have.property(\"message\");", |
| " pm.expect(result.message).to.satisfy(message => !message || typeof message === \"string\");", |
| " pm.expect(result).to.have.property(\"subtests\");", |
| " pm.expect(result.subtests).to.be.an.instanceof(Array);", |
| " for (var subtest of result.subtests) {", |
| " pm.expect(typeof subtest).to.equal(\"object\");", |
| " pm.expect(Object.keys(subtest)).to.have.lengthOf(3);", |
| " pm.expect(subtest).to.have.property(\"name\");", |
| " pm.expect(typeof subtest.name).to.equal(\"string\");", |
| " pm.expect(subtest).to.have.property(\"status\");", |
| " pm.expect(typeof subtest.status).to.equal(\"string\");", |
| " pm.expect(subtest).to.have.property(\"message\");", |
| " pm.expect(subtest.message).to.satisfy(message => !message || typeof message === \"string\");", |
| " }", |
| " }", |
| " }", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "", |
| "pm.test(\"Test is first test, successful run and failed\", function () {", |
| " var api = Object.keys(jsonData)[0];", |
| " pm.expect(api).to.equal(test1.split(\"/\").find(part => !!part))", |
| " var result = jsonData[api][0];", |
| " pm.expect(result.test).to.equal(test1);", |
| " pm.expect(result.status).to.equal(\"OK\");", |
| " pm.expect(result.message).to.be.null;", |
| " var subtest = result.subtests[0];", |
| " pm.expect(subtest.status).to.equal(\"FAIL\");", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ], |
| "query": [ |
| { |
| "key": "path", |
| "value": "/2dcontext/drawing-images-to-the-canvas", |
| "disabled": true |
| }, |
| { |
| "key": "path", |
| "value": "/2dcontext/conformance-requirements", |
| "disabled": true |
| }, |
| { |
| "key": "path", |
| "value": "/2dcontext/conformance-requirements/2d.missingargs.html", |
| "disabled": true |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Results Compact", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "38afbc94-502e-4aa7-85c2-70dbbdae7e13", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(typeof jsonData).to.equal(\"object\");", |
| " for (var api of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[api]).to.have.property(\"pass\");", |
| " pm.expect(typeof jsonData[api].pass).to.equal(\"number\");", |
| " pm.expect(jsonData[api]).to.have.property(\"fail\");", |
| " pm.expect(typeof jsonData[api].fail).to.equal(\"number\");", |
| " pm.expect(jsonData[api]).to.have.property(\"timeout\");", |
| " pm.expect(typeof jsonData[api].timeout).to.equal(\"number\");", |
| " pm.expect(jsonData[api]).to.have.property(\"not_run\");", |
| " pm.expect(typeof jsonData[api].not_run).to.equal(\"number\");", |
| " }", |
| "})", |
| "", |
| "pm.test(\"Responds with one test failed\", function () {", |
| " var api = Object.keys(jsonData)[0];", |
| " pm.expect(jsonData[api].pass).to.equal(0);", |
| " pm.expect(jsonData[api].fail).to.equal(1);", |
| " pm.expect(jsonData[api].timeout).to.equal(0);", |
| " pm.expect(jsonData[api].not_run).to.equal(0);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "compact" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Create Last Result", |
| "item": [ |
| { |
| "name": "Read Next Test of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "85cf7940-73d0-4419-81a1-390c9c4c3a1c", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(Object.keys(response)).to.have.lengthOf(1);", |
| " pm.expect(response).to.have.property(\"next_test\");", |
| " pm.expect(typeof response.next_test).to.equal(\"string\");", |
| "});", |
| "", |
| "const nextTest = response.next_test;", |
| "pm.globals.set(\"current_test_url\", nextTest);", |
| "if (!nextTest) return;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "pm.globals.set(\"current_test\", test);", |
| "", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "pm.test(\"Returned test is second of two specified tests\", function () {", |
| " pm.expect(test).to.equal(test2);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "3e288d2c-865a-48ab-ac53-cddd160a9840", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "pm.test(\"One test is running\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(0);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(1);", |
| " var api = Object.keys(jsonData.running_tests)[0];", |
| " pm.expect(jsonData.running_tests[api]).to.have.lengthOf(1);", |
| " pm.expect(jsonData.running_tests[api]).to.include(test2);", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Result", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "786dbb67-47e8-4009-991c-1670d0ab04e1", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"PASS\",\n \"message\": \"Error message\"\n }\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "db8fcfe2-89f3-4e1c-be82-059412218073", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"status\");", |
| " pm.expect(typeof jsonData.status).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| " pm.expect(jsonData).to.have.property(\"date_started\");", |
| " pm.expect(jsonData).to.have.property(\"date_finished\");", |
| "});", |
| "", |
| "pm.test(\"Session status is completed\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"completed\");", |
| "})", |
| "", |
| "pm.test(\"Finish date is set\", function () {", |
| " pm.expect(Date.parse(jsonData.date_finished)).to.be.below(Date.now());", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "f8938178-c924-4038-a1cb-5d6fc88c08d2", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "var test1Api = test1.split(\"/\").find(part => !!part);", |
| "var test2Api = test1.split(\"/\").find(part => !!part);", |
| "", |
| "pm.test(\"One test is pending, one test is completed\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(0);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Last Completed Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "5ff3fe93-2649-4874-9ae6-ce0bc2887685", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| " ", |
| "pm.test(\"JSON format is as expected\", function () {", |
| " pm.expect(Object.keys(jsonData)).to.have.lengthOf(3);", |
| " pm.expect(jsonData).to.have.property(\"pass\");", |
| " pm.expect(jsonData).to.have.property(\"fail\");", |
| " pm.expect(jsonData).to.have.property(\"timeout\");", |
| " for (var key of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[key]).to.be.an.instanceof(Array);", |
| " }", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "pm.test(\"Responds with one last completed tests as failed and one last completed test as passed\", function () {", |
| " pm.expect(jsonData[\"pass\"]).to.have.lengthOf(1);", |
| " pm.expect(jsonData[\"pass\"][0]).to.equal(test2);", |
| " pm.expect(jsonData[\"fail\"]).to.have.lengthOf(1);", |
| " pm.expect(jsonData[\"fail\"][0]).to.equal(test1);", |
| " pm.expect(jsonData[\"timeout\"]).to.be.empty;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/last_completed", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "last_completed" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Results", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "fee15d71-abfc-46f6-ad63-bdf67c42905d", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON format is as expected\", function () {", |
| " for (var api of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[api]).to.be.an.instanceof(Array);", |
| " for (var result of jsonData[api]) {", |
| " pm.expect(typeof result).to.equal(\"object\");", |
| " pm.expect(Object.keys(result)).to.have.lengthOf(4);", |
| " pm.expect(result).to.have.property(\"test\");", |
| " pm.expect(typeof result.test).to.equal(\"string\");", |
| " pm.expect(result).to.have.property(\"status\");", |
| " pm.expect(typeof result.status).to.equal(\"string\");", |
| " pm.expect(result).to.have.property(\"message\");", |
| " pm.expect(result.message).to.satisfy(message => !message || typeof message === \"string\");", |
| " pm.expect(result).to.have.property(\"subtests\");", |
| " pm.expect(result.subtests).to.be.an.instanceof(Array);", |
| " for (var subtest of result.subtests) {", |
| " pm.expect(typeof subtest).to.equal(\"object\");", |
| " pm.expect(Object.keys(subtest)).to.have.lengthOf(3);", |
| " pm.expect(subtest).to.have.property(\"name\");", |
| " pm.expect(typeof subtest.name).to.equal(\"string\");", |
| " pm.expect(subtest).to.have.property(\"status\");", |
| " pm.expect(typeof subtest.status).to.equal(\"string\");", |
| " pm.expect(subtest).to.have.property(\"message\");", |
| " pm.expect(subtest.message).to.satisfy(message => !message || typeof message === \"string\");", |
| " }", |
| " }", |
| " }", |
| "});", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "pm.test(\"Test is first and second test, successful run and failed, and successful run and passed\", function () {", |
| " var api = Object.keys(jsonData)[0];", |
| " for (var result of jsonData[api]) {", |
| " if (result.test === test1) {", |
| " pm.expect(result.test).to.equal(test1); ", |
| " pm.expect(result.status).to.equal(\"OK\");", |
| " pm.expect(result.message).to.be.null;", |
| " var subtest = result.subtests[0];", |
| " pm.expect(subtest.status).to.equal(\"FAIL\");", |
| " } else {", |
| " pm.expect(result.test).to.equal(test2); ", |
| " pm.expect(result.status).to.equal(\"OK\");", |
| " pm.expect(result.message).to.be.null;", |
| " subtest = result.subtests[0];", |
| " pm.expect(subtest.status).to.equal(\"PASS\");", |
| " }", |
| " }", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ], |
| "query": [ |
| { |
| "key": "path", |
| "value": "/2dcontext/drawing-images-to-the-canvas", |
| "disabled": true |
| }, |
| { |
| "key": "path", |
| "value": "/2dcontext/conformance-requirements", |
| "disabled": true |
| }, |
| { |
| "key": "path", |
| "value": "/2dcontext/conformance-requirements/2d.missingargs.html", |
| "disabled": true |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Results Compact", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "9f739832-3e90-4efc-96cf-2889f08af718", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(typeof jsonData).to.equal(\"object\");", |
| " for (var api of Object.keys(jsonData)) {", |
| " pm.expect(jsonData[api]).to.have.property(\"pass\");", |
| " pm.expect(typeof jsonData[api].pass).to.equal(\"number\");", |
| " pm.expect(jsonData[api]).to.have.property(\"fail\");", |
| " pm.expect(typeof jsonData[api].fail).to.equal(\"number\");", |
| " pm.expect(jsonData[api]).to.have.property(\"timeout\");", |
| " pm.expect(typeof jsonData[api].timeout).to.equal(\"number\");", |
| " pm.expect(jsonData[api]).to.have.property(\"not_run\");", |
| " pm.expect(typeof jsonData[api].not_run).to.equal(\"number\");", |
| " }", |
| "})", |
| "", |
| "const test1 = pm.globals.get(\"single_test_1\");", |
| "const test2 = pm.globals.get(\"single_test_2\");", |
| "", |
| "var test1Api = test1.split(\"/\").find(part => !!part);", |
| "var test2Api = test1.split(\"/\").find(part => !!part);", |
| "", |
| "pm.test(\"Responds with one test failed\", function () {", |
| " pm.expect(Object.keys(jsonData)).to.have.lengthOf(2);", |
| " var api = Object.keys(jsonData)[0];", |
| " if (api === test1Api) {", |
| " pm.expect(jsonData[api].pass).to.equal(0);", |
| " pm.expect(jsonData[api].fail).to.equal(1);", |
| " } else {", |
| " pm.expect(jsonData[api].pass).to.equal(1);", |
| " pm.expect(jsonData[api].fail).to.equal(0);", |
| " }", |
| " pm.expect(jsonData[api].timeout).to.equal(0);", |
| " pm.expect(jsonData[api].not_run).to.equal(0);", |
| " api = Object.keys(jsonData)[1];", |
| " if (api === test1Api) {", |
| " pm.expect(jsonData[api].pass).to.equal(0);", |
| " pm.expect(jsonData[api].fail).to.equal(1);", |
| " } else {", |
| " pm.expect(jsonData[api].pass).to.equal(1);", |
| " pm.expect(jsonData[api].fail).to.equal(0);", |
| " }", |
| " pm.expect(jsonData[api].timeout).to.equal(0);", |
| " pm.expect(jsonData[api].not_run).to.equal(0);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "compact" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "353cde4e-5c57-4df7-b69e-7dac5cf408e3", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(Object.keys(response)).to.have.lengthOf(1);", |
| " pm.expect(response).to.have.property(\"next_test\");", |
| " pm.expect(typeof response.next_test).to.equal(\"string\");", |
| "});", |
| "", |
| "const nextTest = response.next_test;", |
| "pm.globals.set(\"current_test_url\", nextTest);", |
| "if (!nextTest) return;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "pm.globals.set(\"current_test\", test);", |
| "", |
| "const web_root = pm.environment.get(\"web_root\");", |
| "", |
| "pm.test(\"Returned test finish page\", function () {", |
| " pm.expect(test).to.equal(\"/\" + web_root + \"/finish.html\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Clean Up", |
| "item": [ |
| { |
| "name": "Delete Session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Viewing and Downloading Reports", |
| "item": [ |
| { |
| "name": "Create Sessions", |
| "item": [ |
| { |
| "name": "First Session", |
| "item": [ |
| { |
| "name": "Create Session One Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "84a0a44c-fdac-42e5-a3f8-7bbe7fc01fd8", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "6748c537-4286-48bb-9a10-7c1828d7f6e8", |
| "exec": [ |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const test1 = availableTests[Object.keys(availableTests)[0]][0];", |
| "const test2 = availableTests[Object.keys(availableTests)[0]][1];", |
| "const apiName = test1.split(\"/\").filter(part => !!part)[0];", |
| "", |
| "pm.globals.set(\"single_test_1\", test1);", |
| "pm.globals.set(\"single_test_2\", test2);", |
| "pm.globals.set(\"api_name\", apiName);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\"]\n }\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "579feb39-25c5-482a-95e1-be6861144110", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "2399a9f6-0689-4035-8f01-22ad4726232b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "", |
| "const nextTest = response.next_test;", |
| "pm.globals.set(\"current_test_url\", nextTest);", |
| "if (!nextTest) return;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "pm.globals.set(\"current_test\", test);", |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Result", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "75177890-a772-4bcc-9d94-6a7f485b647b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Second Session", |
| "item": [ |
| { |
| "name": "Create Session One Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e35de151-f1d5-4cb4-b403-953bb7dca87f", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token_comp\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "30b29828-cd1c-469a-873c-77a31ce7b7f4", |
| "exec": [ |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const test1 = availableTests[Object.keys(availableTests)[0]][0];", |
| "const test2 = availableTests[Object.keys(availableTests)[0]][1];", |
| "", |
| "pm.globals.set(\"single_test_1\", test1);", |
| "pm.globals.set(\"single_test_2\", test2);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\"]\n }\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Start Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "29cdd92a-28c4-426e-9f53-8563bc3a36e7", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token_comp}}/start", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token_comp}}", |
| "start" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Next Test of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "8cc61693-a77c-467c-a7df-5c239a3bf569", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const response = pm.response.json();", |
| "", |
| "const nextTest = response.next_test;", |
| "pm.globals.set(\"current_test_url\", nextTest);", |
| "if (!nextTest) return;", |
| "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", |
| "pm.globals.set(\"current_test\", test);", |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token_comp}}/next", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token_comp}}", |
| "next" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Result", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "ae30e47e-bb3d-4479-9455-3823bc2adf88", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token_comp}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token_comp}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Download reports", |
| "item": [ |
| { |
| "name": "Download Results Overview", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e614e97d-15e4-4c9b-987f-bd9f272bd295", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/overview", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "overview" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Download All Apis Json", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e72a7387-bd42-4221-be2a-21bca702d1fe", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/json", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "json" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Download WPT Multi Report Url", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "dbcd722b-480a-4544-807a-6f7d6edcb441", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Uri returned\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(typeof jsonData.uri).to.equal(\"string\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{api_name}}/reporturl?tokens={{session_token}},{{session_token_comp}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{api_name}}", |
| "reporturl" |
| ], |
| "query": [ |
| { |
| "key": "tokens", |
| "value": "{{session_token}},{{session_token_comp}}" |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Download Results Api Json", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "9e302610-c7a7-4de0-989a-9903e77499eb", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "9d79c233-e3a3-4972-af76-aa3dfa2ade4b", |
| "exec": [ |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/json", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "{{api_name}}", |
| "json" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Download WPT Report Copy", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "0a43dacd-8106-414c-b9b4-750c2a0375a4", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"Uri returned\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(typeof jsonData.uri).to.equal(\"string\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "4b29e651-47e5-48ae-aa5d-b04b62e47e54", |
| "exec": [ |
| "" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/reporturl", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "results", |
| "{{session_token}}", |
| "{{api_name}}", |
| "reporturl" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Malfunctioning List", |
| "item": [ |
| { |
| "name": "Create Session \\w Configuration Copy", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "d0ededde-44a0-48f3-bc21-eab3302b7b4d", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "ef1d181c-10b8-4bdd-9b5c-f14d6d9ca046", |
| "exec": [ |
| "var automaticTimeout = 120000;", |
| "var manualTimeout = 1000000;", |
| "var specialTimeout = 2000;", |
| "", |
| "pm.globals.set(\"automatic_timeout\", automaticTimeout);", |
| "pm.globals.set(\"manual_timeout\", manualTimeout);", |
| "pm.globals.set(\"special_timeout\", specialTimeout);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\"\n ],\n \"timeouts\": {\n \"automatic\": {{automatic_timeout}},\n \"manual\": {{manual_timeout}},\n \"{{special_timeout_test}}\": {{special_timeout}}\n },\n \"labels\": [\"label1\", \"label2\"]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Malfunctioning Empty", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "e4ed838e-02e3-4fe7-9f27-b9aed6d72d02", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"Return empty array\", function() {", |
| " pm.expect(jsonData).to.be.an.instanceof(Array)", |
| " pm.expect(jsonData).to.have.length(0)", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "malfunctioning" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Update Session Malfunctioning Insert Two", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "40b5a135-a839-4ffc-98e5-6d8923d53743", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "PUT", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "value": "application/json", |
| "type": "text" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "[\n\t\"/test/file/one.html\",\n\t\"/test/file/two.html\"\n]", |
| "options": { |
| "raw": { |
| "language": "json" |
| } |
| } |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "malfunctioning" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Malfunctioning Two Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "32953640-3b13-4df0-8af2-36544ebfe59e", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"Return array with two tests\", function() {", |
| " pm.expect(jsonData).to.be.an.instanceof(Array)", |
| " pm.expect(jsonData).to.have.length(2)", |
| " pm.expect(jsonData).to.include(\"/test/file/one.html\")", |
| " pm.expect(jsonData).to.include(\"/test/file/two.html\")", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "malfunctioning" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Update Session Malfunctioning Empty Array", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "784734d2-61db-4ff3-b063-ba9fc07176d3", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "PUT", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "[]", |
| "options": { |
| "raw": { |
| "language": "json" |
| } |
| } |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "malfunctioning" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Malfunctioning Empty", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "75a2bbc5-47aa-4708-b783-2c5e36f59e1a", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"Return empty array\", function() {", |
| " pm.expect(jsonData).to.be.an.instanceof(Array)", |
| " pm.expect(jsonData).to.have.length(0)", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}", |
| "malfunctioning" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "Sessions API", |
| "item": [ |
| { |
| "name": "create session", |
| "item": [ |
| { |
| "name": "With Defaults", |
| "item": [ |
| { |
| "name": "Prep: Read Available Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "2f9076bb-59aa-43f9-992d-49723c0487e7", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var availableTests = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(typeof availableTests).to.equal(\"object\");", |
| " for (var api of Object.keys(availableTests)) {", |
| " pm.expect(availableTests[api]).to.be.an.instanceof(Array);", |
| " var apiRegExp = new RegExp(\"^/\" + api, \"i\");", |
| " for (var test of availableTests[api]) {", |
| " pm.expect(test).to.match(apiRegExp);", |
| " }", |
| " }", |
| "});", |
| "", |
| "var includedTests = [];", |
| "var excludedTests = [];", |
| "var specialTimeoutTest = \"\";", |
| "", |
| "var apis = Object.keys(availableTests);", |
| "for(var api of apis) {", |
| " if (availableTests[api].length > 50) {", |
| " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part).join(\"/\").split(\"/\")[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", |
| " if (subDirs.length > 2) {", |
| " includedTests.push(\"/\" + api);", |
| " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", |
| " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", |
| " break;", |
| " }", |
| " ", |
| " }", |
| "}", |
| "", |
| "pm.globals.set(\"available_tests\", availableTests);", |
| "pm.globals.set(\"included_tests\", JSON.stringify(includedTests));", |
| "pm.globals.set(\"excluded_tests\", JSON.stringify(excludedTests));", |
| "pm.globals.set(\"special_timeout_test\", specialTimeoutTest.replace(\".\", \"\"));" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "3279e145-d372-4feb-a496-8e3cce73e839", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "2f52b046-49d6-4ae3-bd84-111c5f9e534a", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Configuration is default\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " pm.expect(jsonData.tests.include).to.include(\"/\");", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(300000);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| " pm.expect(jsonData.labels).to.be.empty;", |
| " pm.expect(new Date(jsonData.date_created).getTime()).to.be.below(Date.now());", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "86966d77-4519-415d-b893-5af6e18a0acf", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"Session status is pending\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"pending\");", |
| "})", |
| "", |
| "pm.test(\"Start, Finish and Expiration date not set\", function () {", |
| " pm.expect(jsonData.date_started).to.be.null;", |
| " pm.expect(jsonData.date_finished).to.be.null;", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "b67d346a-b2c9-4d67-af7b-27d2f5b8854f", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"pending_tests\");", |
| " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", |
| " pm.expect(jsonData).to.have.property(\"running_tests\");", |
| " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", |
| "});", |
| "", |
| "pm.test(\"All tests are pending tests\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", |
| "})", |
| "", |
| "const availableTests = pm.globals.get(\"available_tests\"); ", |
| "", |
| "pm.test(\"All available tests are part of the session\", function () {", |
| " for (var api of Object.keys(jsonData.pending_tests)) {", |
| " for (var test of jsonData.pending_tests[api]) {", |
| " pm.expect(availableTests[api]).to.include(test);", |
| " }", |
| " }", |
| "})" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "a4ad3a47-e64a-491b-91cf-57b36a8eb88f", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "ee4ad964-e66e-45fd-9c7a-7895fcbc9e10", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "With Configuration", |
| "item": [ |
| { |
| "name": "Prep: Read Available Tests", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "1a955154-d0c2-4d20-84a7-445da8ecc722", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var availableTests = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(typeof availableTests).to.equal(\"object\");", |
| " for (var api of Object.keys(availableTests)) {", |
| " pm.expect(availableTests[api]).to.be.an.instanceof(Array);", |
| " var apiRegExp = new RegExp(\"^/\" + api, \"i\");", |
| " for (var test of availableTests[api]) {", |
| " pm.expect(test).to.match(apiRegExp);", |
| " }", |
| " }", |
| "});", |
| "", |
| "var includedTests = [];", |
| "var excludedTests = [];", |
| "var specialTimeoutTest = \"\";", |
| "", |
| "var apis = Object.keys(availableTests);", |
| "for(var api of apis) {", |
| " if (availableTests[api].length > 50) {", |
| " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part).join(\"/\").split(\"/\")[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", |
| " if (subDirs.length > 2) {", |
| " includedTests.push(\"/\" + api);", |
| " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", |
| " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", |
| " break;", |
| " }", |
| " ", |
| " }", |
| "}", |
| "", |
| "pm.globals.set(\"available_tests\", availableTests);", |
| "pm.globals.set(\"included_tests\", JSON.stringify(includedTests));", |
| "pm.globals.set(\"excluded_tests\", JSON.stringify(excludedTests));", |
| "pm.globals.set(\"special_timeout_test\", specialTimeoutTest.replace(\".\", \"\"));" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Create Session \\w Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "38973bf0-0737-469d-b2ed-819c1acc6cf3", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "cc54eb7d-209f-4659-8119-ade100bb37ef", |
| "exec": [ |
| "var automaticTimeout = 120000;", |
| "var manualTimeout = 1000000;", |
| "var specialTimeout = 2000;", |
| "", |
| "pm.globals.set(\"automatic_timeout\", automaticTimeout);", |
| "pm.globals.set(\"manual_timeout\", manualTimeout);", |
| "pm.globals.set(\"special_timeout\", specialTimeout);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\"\n ],\n \"timeouts\": {\n \"automatic\": {{automatic_timeout}},\n \"manual\": {{manual_timeout}},\n \"{{special_timeout_test}}\": {{special_timeout}}\n },\n \"labels\": [\"label1\", \"label2\"]\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "dbe16a67-70ba-4989-ab50-bafc8acab84c", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "var includedTests = JSON.parse(pm.globals.get(\"included_tests\"));", |
| "var excludedTests = JSON.parse(pm.globals.get(\"excluded_tests\"));", |
| "var automaticTimeout = pm.globals.get(\"automatic_timeout\");", |
| "var manualTimeout = pm.globals.get(\"manual_timeout\");", |
| "var specialTimeout = pm.globals.get(\"special_timeout\");", |
| "var specialTimeoutTest = pm.globals.get(\"special_timeout_test\");", |
| "", |
| "pm.test(\"Configuration is as specified\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " for (var test of includedTests) {", |
| " pm.expect(jsonData.tests.include).to.include(test);", |
| " }", |
| " for (var test of excludedTests) {", |
| " pm.expect(jsonData.tests.exclude).to.include(test);", |
| " }", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.not.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(automaticTimeout);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(manualTimeout);", |
| " pm.expect(jsonData.timeouts[specialTimeoutTest]).to.equal(specialTimeout);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| " pm.expect(jsonData.labels).to.include(\"label1\");", |
| " pm.expect(jsonData.labels).to.include(\"label2\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "c1514c3e-fd96-4e9c-b799-6fd04185bb63", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"Session status is pending\", function () {", |
| " pm.expect(jsonData.status).to.equal(\"pending\");", |
| "})", |
| "", |
| "pm.test(\"Start and Finish date not set\", function () {", |
| " pm.expect(jsonData.date_started).to.be.null;", |
| " pm.expect(jsonData.date_finished).to.be.null;", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Tests of Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "d31b10eb-4a59-4f92-98b2-73707e37a03b", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"All tests are pending tests\", function () {", |
| " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", |
| " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", |
| "})", |
| "", |
| "const availableTests = pm.globals.get(\"available_tests\");", |
| "const includedTests = pm.globals.get(\"included_tests\");", |
| "const excludedTests = pm.globals.get(\"excluded_tests\");", |
| "", |
| "pm.test(\"Selected subset of tests are part of the session\", function () {", |
| " for (var api of Object.keys(jsonData.pending_tests)) {", |
| " for (var includedTest of includedTests) {", |
| " if (includedTest.split(\"/\").find(part => !!part) === api) {", |
| " var includeRegExp = new RegExp(\"^\" + includedTest, \"i\");", |
| " for (var test of jsonData.pending_tests[api]) {", |
| " pm.expect(test).to.match(regex);", |
| " }", |
| " break;", |
| " }", |
| " }", |
| " for (var excludedTest of excludedTests) {", |
| " if (excludedTest.split(\"/\").find(part => !!part) === api) {", |
| " var excludeRegExp = new RegExp(\"^\" + excludedTest, \"i\");", |
| " for (var test of jsonData.pending_tests[api]) {", |
| " pm.expect(test).to.not.match(regex);", |
| " }", |
| " break;", |
| " }", |
| " }", |
| " }", |
| "});", |
| "", |
| "const sessionTests = jsonData.pending_tests;", |
| "", |
| "pm.globals.set(\"session_tests\", JSON.stringify(sessionTests));" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "tests", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "event": [ |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "daf759dc-ea36-4d8f-a524-4dae0cc841dc", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| }, |
| { |
| "listen": "test", |
| "script": { |
| "id": "b50f4e6b-23b6-41e1-9bab-cd2ca90b7f43", |
| "type": "text/javascript", |
| "exec": [ |
| "" |
| ] |
| } |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "With Expiration", |
| "item": [ |
| { |
| "name": "Create Session With Expiration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "53183c44-31d1-48de-89ae-17950ef47363", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "6dadba7e-5352-4b9c-9601-f0eb429341ce", |
| "exec": [ |
| "var expirationDate = Date.now() + 3000;", |
| "pm.globals.set(\"expiration_date\", expirationDate);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "{\n\t\"expiration_date\": {{expiration_date}}\n}" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Expired Session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "f2bc16d6-099b-487c-a7a6-d48d198ff826", |
| "exec": [ |
| "pm.test(\"Status code is 404\", function () {", |
| " pm.response.to.have.status(404);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| }, |
| { |
| "listen": "prerequest", |
| "script": { |
| "id": "57f858cd-b882-4fc0-9170-60078cfe5af8", |
| "exec": [ |
| "var expirationDate = pm.globals.get(\"expiration_date\");", |
| "", |
| "var timeout = expirationDate - Date.now() + 1000", |
| "", |
| "console.log(timeout)", |
| "", |
| "setTimeout(function () {}, timeout);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "read session", |
| "item": [ |
| { |
| "name": "Prep: Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "b50313e7-7fd2-434b-a86e-7ff5fb0af1d8", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "ef9e2d68-6b36-4ce7-8dba-27ebc7153015", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"tests\");", |
| " pm.expect(typeof jsonData.tests).to.equal(\"object\");", |
| " pm.expect(jsonData.tests).to.have.property(\"include\");", |
| " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData.tests).to.have.property(\"exclude\");", |
| " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"types\");", |
| " pm.expect(jsonData.types).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"user_agent\");", |
| " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"timeouts\");", |
| " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", |
| " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", |
| " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", |
| " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", |
| " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", |
| " pm.expect(jsonData).to.have.property(\"browser\");", |
| " pm.expect(typeof jsonData.browser).to.equal(\"object\");", |
| " pm.expect(jsonData.browser).to.have.property(\"name\");", |
| " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", |
| " pm.expect(jsonData.browser).to.have.property(\"version\");", |
| " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"reference_tokens\");", |
| " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"labels\");", |
| " pm.expect(jsonData.labels).to.be.an.instanceof(Array);", |
| " pm.expect(jsonData).to.have.property(\"date_created\");", |
| "});", |
| "", |
| "pm.test(\"Configuration is default\", function () {", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| " pm.expect(jsonData.tests.include).to.include(\"/\");", |
| " pm.expect(jsonData.types).to.include(\"automatic\");", |
| " pm.expect(jsonData.types).to.include(\"manual\");", |
| " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", |
| " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", |
| " pm.expect(jsonData.timeouts.manual).to.equal(300000);", |
| " pm.expect(jsonData.browser.name).to.equal(\"Other\");", |
| " pm.expect(jsonData.browser.version).to.equal(\"0\");", |
| " pm.expect(jsonData.is_public).to.equal(false);", |
| " pm.expect(jsonData.reference_tokens).to.be.empty;", |
| " pm.expect(jsonData.labels).to.be.empty;", |
| " pm.expect(new Date(jsonData.date_created).getTime()).to.be.below(Date.now());", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "read session status", |
| "item": [ |
| { |
| "name": "Prep: Create Session No Configuration", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "8c7bcb56-cd2a-4d99-ad6e-ac4bc4767dce", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", |
| "", |
| "pm.test(\"Responds with token in JSON format\", function () {", |
| " var jsonData = pm.response.json();", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(jsonData.token).to.match(tokenRegex);", |
| "});", |
| "", |
| "", |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [ |
| { |
| "key": "Content-Type", |
| "name": "Content-Type", |
| "type": "text", |
| "value": "application/json" |
| } |
| ], |
| "body": { |
| "mode": "raw", |
| "raw": "" |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read Session Status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "0639b5a0-d419-4642-baf1-5aa4aedf33c9", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"token\");", |
| " pm.expect(typeof jsonData.token).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"status\");", |
| " pm.expect(typeof jsonData.status).to.equal(\"string\");", |
| " pm.expect(jsonData).to.have.property(\"expiration_date\");", |
| " pm.expect(jsonData.expiration_date).to.be.null;", |
| " pm.expect(jsonData).to.have.property(\"date_started\");", |
| " pm.expect(jsonData).to.have.property(\"date_finished\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "read sessions", |
| "item": [ |
| { |
| "name": "Without query parameters", |
| "item": [ |
| { |
| "name": "Read sessions", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "a1fe1580-1807-45d1-93bb-e54596895c00", |
| "exec": [ |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"JSON structure as expected\", function() {", |
| " pm.expect(response).to.have.property(\"items\");", |
| " pm.expect(response[\"items\"]).to.be.instanceof(Array);", |
| " pm.expect(response).to.have.property(\"_links\");", |
| " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "_wave", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "Containing created session", |
| "item": [ |
| { |
| "name": "Prep: Create session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "8c6722cf-7d5c-4b03-8404-3bdf17e543d9", |
| "exec": [ |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "body": { |
| "mode": "raw", |
| "raw": "", |
| "options": { |
| "raw": { |
| "language": "json" |
| } |
| } |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read sessions", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "7478f8f8-c838-4ae0-87ef-9889afc1041d", |
| "exec": [ |
| "const token = pm.globals.get(\"session_token\");", |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"JSON structure as expected\", function() {", |
| " pm.expect(response).to.have.property(\"items\");", |
| " pm.expect(response[\"items\"]).to.be.instanceof(Array);", |
| " pm.expect(response).to.have.property(\"_links\");", |
| " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", |
| "});", |
| "", |
| "pm.test(\"Created session's token in response\", function() {", |
| " pm.expect(response.items).to.contain(token);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions?index=0&count=1000", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "_wave", |
| "api", |
| "sessions" |
| ], |
| "query": [ |
| { |
| "key": "index", |
| "value": "0" |
| }, |
| { |
| "key": "count", |
| "value": "1000" |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete Session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "With configuration expansion", |
| "item": [ |
| { |
| "name": "Prep: Create session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "9f59683a-df99-4e3c-b461-85c606196218", |
| "exec": [ |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "body": { |
| "mode": "raw", |
| "raw": "", |
| "options": { |
| "raw": { |
| "language": "json" |
| } |
| } |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read sessions", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "1cb72090-e989-4f6d-b19a-cd57388b18dc", |
| "exec": [ |
| "const token = pm.globals.get(\"session_token\");", |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"JSON structure as expected\", function() {", |
| " pm.expect(response).to.have.property(\"items\");", |
| " pm.expect(response[\"items\"]).to.be.instanceof(Array);", |
| " pm.expect(response).to.have.property(\"_links\");", |
| " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", |
| " pm.expect(response).to.have.property(\"_embedded\");", |
| " pm.expect(response[\"_embedded\"]).to.be.instanceof(Object);", |
| " pm.expect(response[\"_embedded\"]).to.have.property(\"configuration\");", |
| " pm.expect(response[\"_embedded\"][\"configuration\"]).to.be.instanceof(Array);", |
| "});", |
| "", |
| "pm.test(\"Created session's token in response\", function() {", |
| " pm.expect(response.items).to.contain(token);", |
| "});", |
| "", |
| "pm.test(\"Created session's token in embedded configuration\", function() {", |
| " let tokenInConfigurationList = false;", |
| " let configurations = response._embedded.configuration;", |
| " for (let configuration of configurations) {", |
| " if (configuration.token !== token) continue;", |
| " tokenInConfigurationList = true;", |
| " }", |
| " pm.expect(tokenInConfigurationList).to.equal(true);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions?index=0&count=1000&expand=configuration", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "_wave", |
| "api", |
| "sessions" |
| ], |
| "query": [ |
| { |
| "key": "index", |
| "value": "0" |
| }, |
| { |
| "key": "count", |
| "value": "1000" |
| }, |
| { |
| "key": "expand", |
| "value": "configuration" |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete Session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| }, |
| { |
| "name": "With status expansion", |
| "item": [ |
| { |
| "name": "Prep: Create session", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "268fd1fa-4dba-401b-8072-8177a0f250c6", |
| "exec": [ |
| "const response = pm.response.json();", |
| "const token = response.token;", |
| "pm.globals.set(\"session_token\", token);" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "POST", |
| "header": [], |
| "body": { |
| "mode": "raw", |
| "raw": "", |
| "options": { |
| "raw": { |
| "language": "json" |
| } |
| } |
| }, |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions" |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Read sessions", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "93db4741-b574-4433-8dbd-008611311442", |
| "exec": [ |
| "const token = pm.globals.get(\"session_token\");", |
| "const response = pm.response.json();", |
| "", |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "pm.test(\"JSON structure as expected\", function() {", |
| " pm.expect(response).to.have.property(\"items\");", |
| " pm.expect(response[\"items\"]).to.be.instanceof(Array);", |
| " pm.expect(response).to.have.property(\"_links\");", |
| " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", |
| " pm.expect(response).to.have.property(\"_embedded\");", |
| " pm.expect(response[\"_embedded\"]).to.be.instanceof(Object);", |
| " pm.expect(response[\"_embedded\"]).to.have.property(\"status\");", |
| " pm.expect(response[\"_embedded\"][\"status\"]).to.be.instanceof(Array);", |
| "});", |
| "", |
| "pm.test(\"Created session's token in response\", function() {", |
| " pm.expect(response.items).to.contain(token);", |
| "});", |
| "", |
| "pm.test(\"Created session's token in embedded status\", function() {", |
| " let tokenInStatusList = false;", |
| " let statuses = response._embedded.status;", |
| " for (let status of statuses) {", |
| " if (status.token !== token) continue;", |
| " tokenInStatusList = true;", |
| " }", |
| " pm.expect(tokenInStatusList).to.equal(true);", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions?index=0&count=1000&expand=status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "_wave", |
| "api", |
| "sessions" |
| ], |
| "query": [ |
| { |
| "key": "index", |
| "value": "0" |
| }, |
| { |
| "key": "count", |
| "value": "1000" |
| }, |
| { |
| "key": "expand", |
| "value": "status" |
| } |
| ] |
| } |
| }, |
| "response": [] |
| }, |
| { |
| "name": "Clean up: Delete Session", |
| "request": { |
| "method": "DELETE", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "sessions", |
| "{{session_token}}" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| }, |
| { |
| "name": "General API", |
| "item": [ |
| { |
| "name": "server status", |
| "item": [ |
| { |
| "name": "Read server status", |
| "event": [ |
| { |
| "listen": "test", |
| "script": { |
| "id": "d695b371-c742-4eaf-9179-852b04460ecf", |
| "exec": [ |
| "pm.test(\"Status code is 200\", function () {", |
| " pm.response.to.have.status(200);", |
| "});", |
| "", |
| "var jsonData = pm.response.json();", |
| "", |
| "pm.test(\"JSON structure is as expected\", function () {", |
| " pm.expect(jsonData).to.have.property(\"import_results_enabled\");", |
| " pm.expect(typeof jsonData.import_results_enabled).to.equal(\"boolean\");", |
| " pm.expect(jsonData).to.have.property(\"reports_enabled\");", |
| " pm.expect(typeof jsonData.reports_enabled).to.equal(\"boolean\");", |
| " pm.expect(jsonData).to.have.property(\"read_sessions_enabled\");", |
| " pm.expect(typeof jsonData.read_sessions_enabled).to.equal(\"boolean\");", |
| " pm.expect(jsonData).to.have.property(\"version_string\");", |
| " pm.expect(typeof jsonData.version_string).to.equal(\"string\");", |
| "});" |
| ], |
| "type": "text/javascript" |
| } |
| } |
| ], |
| "request": { |
| "method": "GET", |
| "header": [], |
| "url": { |
| "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/status", |
| "protocol": "{{protocol}}", |
| "host": [ |
| "{{host}}" |
| ], |
| "port": "{{port}}", |
| "path": [ |
| "{{web_root}}", |
| "api", |
| "status" |
| ] |
| } |
| }, |
| "response": [] |
| } |
| ], |
| "protocolProfileBehavior": {}, |
| "_postman_isSubFolder": true |
| } |
| ], |
| "protocolProfileBehavior": {} |
| } |
| ], |
| "protocolProfileBehavior": {} |
| } |