diff --git a/src/tests/postman_collection.json b/src/tests/postman_collection.json index 0cc679d..e6049ed 100644 --- a/src/tests/postman_collection.json +++ b/src/tests/postman_collection.json @@ -1,200 +1,179 @@ { - "info": { - "_postman_id": "8c90c22b-3e1f-45c9-aaf5-058b37f34474", - "name": "Node.js Demoapp", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Check Home Page", - "event": [ - { - "listen": "test", - "script": { - "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", - "exec": [ - "pm.test(\"Home Page: Successful GET request\", function () {", - " pm.response.to.be.ok;", - "});", - "", - "pm.test(\"Home Page: Response valid & HTML body\", function () {", - " pm.response.to.be.withBody;", - " pm.expect(pm.response.headers.get('Content-Type')).to.contain('text/html');", - "});", - "", - "pm.test(\"Home Page: Check content\", function () {", - " pm.expect(pm.response.text()).to.include('Ben Coleman');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{apphost}}/", - "protocol": "http", - "host": [ - "{{apphost}}" - ], - "path": [ - "" - ] - } - }, - "response": [] - }, - { - "name": "Check Info Page", - "event": [ - { - "listen": "test", - "script": { - "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", - "exec": [ - "pm.test(\"Info Page: Successful GET request\", function () {", - " pm.response.to.be.ok;", - "});", - "", - "pm.test(\"Info Page: Response valid & HTML body\", function () {", - " pm.response.to.be.withBody;", - " pm.expect(pm.response.headers.get('Content-Type')).to.contain('text/html');", - "});", - "", - "pm.test(\"Info Page: Check content\", function () {", - " pm.expect(pm.response.text()).to.include('Intel');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{apphost}}/info", - "protocol": "http", - "host": [ - "{{apphost}}" - ], - "path": [ - "info" - ] - } - }, - "response": [] - }, - { - "name": "Check Weather API", - "event": [ - { - "listen": "test", - "script": { - "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", - "exec": [ - "pm.test(\"Weather API: Successful GET request\", function () {", - " pm.response.to.be.ok;", - "});", - "", - "pm.test(\"Weather API: Response valid & JSON body\", function () {", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Weather API: Check API response\", function () {", - " var weatherData = pm.response.json();", - " pm.expect(weatherData.temp).to.be.an('number')", - " pm.expect(weatherData.summary).to.exist;", - " pm.expect(weatherData.forecastLong).to.be.an('string')", - " pm.expect(weatherData.forecastShort).to.be.an('string')", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{apphost}}/api/weather/51.40329/0.05619", - "protocol": "http", - "host": [ - "{{apphost}}" - ], - "path": [ - "api", - "weather", - "51.40329", - "0.05619" - ] - } - }, - "response": [] - }, - { - "name": "Check Error Page", - "event": [ - { - "listen": "test", - "script": { - "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", - "exec": [ - "pm.test(\"Error Page: Returns 500\", function () {", - " pm.response.to.be.error;", - "});", - "", - "pm.test(\"Error Page: Response valid & HTML body\", function () {", - " pm.response.to.be.withBody;", - " pm.expect(pm.response.headers.get('Content-Type')).to.contain('text/html');", - "});", - "", - "pm.test(\"Error Page: Check exception\", function () {", - " pm.expect(pm.response.text()).to.include('ReferenceError');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{apphost}}/tools/error", - "protocol": "http", - "host": [ - "{{apphost}}" - ], - "path": [ - "tools/error" - ] - } - }, - "response": [] - } - ] -} \ No newline at end of file + "info": { + "_postman_id": "8c90c22b-3e1f-45c9-aaf5-058b37f34474", + "name": "Node.js Demoapp", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Check Home Page", + "event": [ + { + "listen": "test", + "script": { + "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", + "exec": [ + "pm.test(\"Home Page: Successful GET request\", function () {", + " pm.response.to.be.ok;", + "});", + "", + "pm.test(\"Home Page: Response valid & HTML body\", function () {", + " pm.response.to.be.withBody;", + " pm.expect(pm.response.headers.get('Content-Type')).to.contain('text/html');", + "});", + "", + "pm.test(\"Home Page: Check content\", function () {", + " pm.expect(pm.response.text()).to.include('Ben Coleman');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{apphost}}/", + "protocol": "http", + "host": ["{{apphost}}"], + "path": [""] + } + }, + "response": [] + }, + { + "name": "Check Info Page", + "event": [ + { + "listen": "test", + "script": { + "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", + "exec": [ + "pm.test(\"Info Page: Successful GET request\", function () {", + " pm.response.to.be.ok;", + "});", + "", + "pm.test(\"Info Page: Response valid & HTML body\", function () {", + " pm.response.to.be.withBody;", + " pm.expect(pm.response.headers.get('Content-Type')).to.contain('text/html');", + "});", + "", + "pm.test(\"Info Page: Check content\", function () {", + " pm.expect(pm.response.text()).to.include('Intel');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{apphost}}/info", + "protocol": "http", + "host": ["{{apphost}}"], + "path": ["info"] + } + }, + "response": [] + }, + { + "name": "Check Weather API", + "event": [ + { + "listen": "test", + "script": { + "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", + "exec": [ + "pm.test(\"Weather API: Successful GET request\", function () {", + " pm.response.to.be.ok;", + "});", + "", + "pm.test(\"Weather API: Response valid & JSON body\", function () {", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Weather API: Check API response\", function () {", + " var weatherData = pm.response.json();", + " pm.expect(weatherData.main.temp).to.be.an('number')", + " pm.expect(weatherData.weather[0]).to.exist;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{apphost}}/api/weather/51.40329/0.05619", + "protocol": "http", + "host": ["{{apphost}}"], + "path": ["api", "weather", "51.40329", "0.05619"] + } + }, + "response": [] + }, + { + "name": "Check Error Page", + "event": [ + { + "listen": "test", + "script": { + "id": "e1f514e2-fc14-4fcd-a140-50b3fc9f5a56", + "exec": [ + "pm.test(\"Error Page: Returns 500\", function () {", + " pm.response.to.be.error;", + "});", + "", + "pm.test(\"Error Page: Response valid & HTML body\", function () {", + " pm.response.to.be.withBody;", + " pm.expect(pm.response.headers.get('Content-Type')).to.contain('text/html');", + "});", + "", + "pm.test(\"Error Page: Check exception\", function () {", + " pm.expect(pm.response.text()).to.include('ReferenceError');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{apphost}}/tools/error", + "protocol": "http", + "host": ["{{apphost}}"], + "path": ["tools/error"] + } + }, + "response": [] + } + ] +}