From 88db33c6a8e2a03e72a0c676f51937418ee84912 Mon Sep 17 00:00:00 2001 From: Dominik Mizyn Date: Thu, 22 Aug 2019 14:04:44 +0200 Subject: Postman tests up Postman tests up Issue-ID: PORTAL-710 Change-Id: I2bdb4ba12b35f7c17014eff2a68fd5534e307bbd Signed-off-by: Dominik Mizyn --- .../postman/Portal.postman_collection.json | 267 +++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 portal-BE/deliveries/postman/Portal.postman_collection.json (limited to 'portal-BE/deliveries') diff --git a/portal-BE/deliveries/postman/Portal.postman_collection.json b/portal-BE/deliveries/postman/Portal.postman_collection.json new file mode 100644 index 00000000..e0b51e9e --- /dev/null +++ b/portal-BE/deliveries/postman/Portal.postman_collection.json @@ -0,0 +1,267 @@ +{ + "info": { + "_postman_id": "1c6e52dd-039b-400b-a986-49d25e5a1428", + "name": "Portal", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "LanguageController", + "item": [ + { + "name": "localhost:8080/auxapi/languageSetting/user/2", + "event": [ + { + "listen": "test", + "script": { + "id": "2fc1aa20-6048-4500-bdd2-5b2cc070f27c", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=", + "type": "string" + }, + { + "key": "username", + "value": "demo", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "localhost:8080/auxapi/languageSetting/user/2", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "auxapi", + "languageSetting", + "user", + "2" + ] + } + }, + "response": [] + }, + { + "name": "localhost:8080/auxapi/language", + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "localhost:8080/auxapi/language", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "auxapi", + "language" + ] + } + }, + "response": [] + }, + { + "name": "localhost:8080/auxapi/language", + "event": [ + { + "listen": "test", + "script": { + "id": "2fc1aa20-6048-4500-bdd2-5b2cc070f27c", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=", + "type": "string" + }, + { + "key": "username", + "value": "demo", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"languageName\": \"PL\",\n \"languageAlias\": \"Polish\"\n}" + }, + "url": { + "raw": "localhost:8080/auxapi/language", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "auxapi", + "language" + ] + } + }, + "response": [] + }, + { + "name": "localhost:8080/auxapi/language", + "event": [ + { + "listen": "test", + "script": { + "id": "2fc1aa20-6048-4500-bdd2-5b2cc070f27c", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "var customer = JSON.parse(responseBody);", + "", + "tests[\"Message is valid\"] = customer.message === \"FAILURE\"", + "tests[\"Status is valid\"] = customer.status === \"ERROR\"", + "tests[\"Response is valid\"] = customer.response === \"FnLanguage is not valid, may have unsafe html content\"" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=", + "type": "string" + }, + { + "key": "username", + "value": "demo", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"languageName\": \"PL\",\n \"languageAlias\": \"\"\n}" + }, + "url": { + "raw": "localhost:8080/auxapi/language", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "auxapi", + "language" + ] + }, + "description": "XSS test" + }, + "response": [] + } + ], + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=", + "type": "string" + }, + { + "key": "username", + "value": "demo", + "type": "string" + } + ] + } + }, + { + "name": "http://localhost:8080/logout", + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://localhost:8080/logout", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "logout" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file -- cgit 1.2.3-korg