diff --git a/qa_tests/Boilerplate-status-page.postman_collection.json b/qa_tests/Boilerplate-status-page.postman_collection.json new file mode 100644 index 000000000..6514f847b --- /dev/null +++ b/qa_tests/Boilerplate-status-page.postman_collection.json @@ -0,0 +1,7674 @@ +{ + "info": { + "_postman_id": "c8ad1ef2-4d79-47ce-9847-92e36a7b959e", + "name": "Boilerplate-status-page", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "23968045", + "_collection_link": "https://crimson-star-498952.postman.co/workspace/HNG-Internship~4ced83f4-98e1-4fdc-9aaf-2ea4e3bf860b/collection/23968045-c8ad1ef2-4d79-47ce-9847-92e36a7b959e?action=share&source=collection_link&creator=23968045" + }, + "item": [ + { + "name": "Waitlist", + "item": [ + { + "name": "Waitlist-signup", + "item": [ + { + "name": "Register", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + " pm.test('Generate biolerplate random email', function(){\r", + "\r", + " let randomEmail=function makeEmail() { \r", + " var strValues=\"abcd\"; \r", + " let name='utest'\r", + " var strEmail = \"@gmail.com\"; \r", + " var strTmp; \r", + " for (var i=0;i<10;i++) { \r", + " strTmp = strValues.charAt(Math.round(strValues.length*Math.random())); \r", + " strEmail =strTmp +strEmail; \r", + " }\r", + " return strEmail\r", + " }\r", + "\r", + " \r", + "\r", + " pm.collectionVariables.set('boilerPlateRandomEmail',randomEmail())\r", + "\r", + " })" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "\r", + "\r", + "pm.test(\"set access token and id\", function () {\r", + " let userAccessToken=pm.response.json().access_token\r", + " let userId=pm.response.json().data.user.id\r", + "\r", + " pm.collectionVariables.set('userAccessToken',userAccessToken)\r", + " pm.collectionVariables.set('userId',userId)\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"first_name\": \"Lordwill\",\r\n \"last_name\": \"Ben\",\r\n \"email\": \"{{boilerPlateRandomEmail}}\",\r\n \"password\": \"paS$word1\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{boilerplateUrl}}/api/v1/auth/register", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "Waitlist", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"API is available 200\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "pm.test(\"Content-Type is present\", function () {\r", + " pm.response.to.have.header(\"Content-Type\");\r", + "});\r", + "pm.test(\"Response time is less than 3000ms\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(3000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{boilerPlateRandomEmail}}\",\r\n \"full_name\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{boilerplateUrl}}/api/v1/waitlist/", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "waitlist", + "" + ] + } + }, + "response": [] + }, + { + "name": "Waitlist-Error Check(same Email)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 401 or 422\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400,401, 422]);\r", + "});\r", + "pm.test(\"Content-Type is present\", function () {\r", + " pm.response.to.have.header(\"Content-Type\");\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{boilerPlateRandomEmail}}\",\r\n \"full_name\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{boilerplateUrl}}/api/v1/waitlist/", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "waitlist", + "" + ] + } + }, + "response": [] + }, + { + "name": "Waitlist-Error Check(Empty fields)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 401 or 422\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 401, 422]);\r", + "});\r", + "pm.test(\"Content-Type is present\", function () {\r", + " pm.response.to.have.header(\"Content-Type\");\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"full_name\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{boilerplateUrl}}/api/v1/waitlist/", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "waitlist", + "" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Contacts us", + "item": [ + { + "name": "Retrieve all contact us", + "item": [ + { + "name": "Retrieve all contact us", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"API is available 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Content-Type is present\", function () {\r", + " pm.response.to.have.header(\"Content-Type\");\r", + "});\r", + "pm.test(\"Response time is less than 3000ms\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(3000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{adminAccessTokenBoiler}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{boilerplateUrl}}/api/v1/contact", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "contact" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve all contact us --Error check(Invalid token)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "\r", + "pm.test(\"Check for error [400,401,422]\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400,422,401])\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMDY2YzhiMTctMTA0My03OWQ5LTgwMDAtZDU0MDFhYWFlODNlIiwiZXhwIjoxNzI0NDY0NjU3LCJ0eXBlIjoiYWNjZXNzIn0.ds605XJ3NwMQquYuGkJfDaMWbBIStsMCuQq-apkM_-M", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{boilerplateUrl}}/api/v1/contact", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "contact" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Create contact us", + "item": [ + { + "name": "create contact us", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"API is available 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "pm.test(\"Response time is less than 3000ms\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(3000);\r", + "});\r", + "pm.test(\"Body matches string\", function () {\r", + " pm.expect(pm.response.text()).to.include(\"SUCCESS\");\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"full_name\": \"string\",\r\n \"email\": \"user@example.com\",\r\n \"phone_number\": \"string\",\r\n \"message\": \"string\",\r\n \"org_id\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{boilerplateUrl}}/api/v1/contact", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "contact" + ] + } + }, + "response": [] + }, + { + "name": "create contact us--Error check(empty field)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Error check [422]\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "pm.test(\"Response time is less than 500ms\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(500);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"full_name\": \"\",\r\n \"email\": \"\",\r\n \"phone_number\": \"\",\r\n \"message\": \"\",\r\n \"org_id\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{boilerplateUrl}}/api/v1/contact", + "host": [ + "{{boilerplateUrl}}" + ], + "path": [ + "api", + "v1", + "contact" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Authentication - Spartacus", + "item": [ + { + "name": "Sign Up User (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});\r", + "\r", + "\r", + "pm.test(\"Body is correct\", function () {\r", + " pm.response.to.have.body('{\"message\":\"Welcome to API\",\"data\":{\"URL\":\"\"},\"status_code\":200}'\r", + " );\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Register new user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('xuser-k', data.user.email);\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "let date = Date.now();\r", + "let email = 'john' + date + '@doe.com';\r", + "pm.collectionVariables.set('useremail-k', email);\r", + "\r", + "let pwd = 'JohnDoe@123';\r", + "pm.collectionVariables.set('userpwd-k', pwd);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Required Fields (email empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Required Fields (password empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"\",\r\n \"first_name\": \"John4\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Required Fields (first name empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-07_Required Fields (last name empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-08_Required Fields (all empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"password\": \"\",\r\n \"first_name\": \"\",\r\n \"last_name\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-09_Invalid Email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"john2@doe\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-10_Invalid Password (only 4 alphaNum chars)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "\r", + "pm.test(\"Invalid Input\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"Jo@1\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-11_Invalid Password (only 8 alpha chars)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"JohnJohn\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-12_Register Existing Email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"User with this email already exists\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{xuser-k}}\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"Kate\",\r\n \"last_name\": \"Flynn\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Sign Up Super Admin (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Register new super admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('xadmin-k', data.user.email);\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "let date = Date.now();\r", + "let email = 'admin' + date + '@doe.com';\r", + "pm.collectionVariables.set('adminemail-k', email);\r", + "\r", + "let pwd = 'JohnDoe@123';\r", + "pm.collectionVariables.set('adminpwd-k', pwd);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"Admin\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Required Fields (email empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"Admin\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Required Fields (password empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"\",\r\n \"first_name\": \"Admin4\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Required Fields (first name empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-07_Required Fields (last name empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-08_Required Fields (all empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"password\": \"\",\r\n \"first_name\": \"\",\r\n \"last_name\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-09_Invalid Email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"john2@doe\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"Admin\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-10_Invalid Password (only 4 alphaNum chars)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "\r", + "pm.test(\"Invalid Input\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"Jo@1\",\r\n \"first_name\": \"Admin\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-11_Invalid Password (only 8 alpha chars)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"AdminAdmin\",\r\n \"first_name\": \"Admin\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-12_Register Existing Email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"User with this email already exists\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{xadmin-k}}\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"Kate\",\r\n \"last_name\": \"Flynn\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Login (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Login existing user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token-k', access_token);\r", + "\r", + "pm.test(\"Has a token\", function(){\r", + " return 'access_token';\r", + " \r", + "})\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Required Fields (email empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Required Fields (password empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Bad Request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400,422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-08_Required Fields (all empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\",\r\n \"password\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-09_Invalid Email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"john@doe\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-10_Invalid Password (only 4 alphaNum chars)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"Jo@1\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-11_Invalid Password (only 8 alpha chars)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-length": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"JohnJohn\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Refresh & Logout (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Login existing user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token-k', access_token);\r", + "\r", + "pm.test(\"Has a token\", function(){\r", + " return 'access_token';\r", + " \r", + "})\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Refresh Access Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token2-k', access_token);\r", + "\r", + "// pm.test(\"New token generated?\", function(){\r", + "// return 'access_token';\r", + " \r", + "// })\r", + "\r", + "pm.test(\"Is the token refreshed?\", function () {\r", + " 'token-k' != 'token2-k';\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/refresh-access-token", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "refresh-access-token" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Request Sign In Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token2-k', access_token);\r", + "\r", + "// pm.test(\"New token generated?\", function(){\r", + "// return 'access_token';\r", + " \r", + "// })\r", + "\r", + "pm.test(\"Is the token refreshed?\", function () {\r", + " 'token-k' != 'token2-k';\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/request-token", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "request-token" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Verify Sign In Token with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Token Invalid or Expired\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([404, 422]);\r", + "});\r", + "\r", + "\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token2-k', access_token);\r", + "\r", + "// pm.test(\"New token generated?\", function(){\r", + "// return 'access_token';\r", + " \r", + "// })\r", + "\r", + "pm.test(\"Is the token refreshed?\", function () {\r", + " 'token-k' != 'token2-k';\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"token\": \" \"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/verify-token", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "verify-token" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Login existing user Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token-k', access_token);\r", + "\r", + "pm.test(\"Has a token\", function(){\r", + " return 'access_token';\r", + " \r", + "})\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Logout existing user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "// const {access_token} = pm.response.json();\r", + "// pm.collectionVariables.set('token-k', access_token);\r", + "\r", + "pm.test(\"Has a token\", function(){\r", + " return 'access_token';\r", + " \r", + "})\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/logout", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "logout" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Magic Link (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Request Magic Link", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "// pm.test(\"Parse access token and store in collectionVariables\", () => {\r", + "// const responseJson = pm.response.json();\r", + "// const magic = responseJson.data[\"magic-link\"];\r", + " \r", + "// var fields = magic.split('=');\r", + "\r", + "// var magic_link = fields[1];\r", + "\r", + "// pm.collectionVariables.set('magic_link', magic_link);\r", + "\r", + "// });\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/magic-link", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "magic-link" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Verify Magic Link with wrong link", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid link or Could not validate credentials;\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([401, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"token\": \" \"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/magic-link/verify?token={{magic_link}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "magic-link", + "verify" + ], + "query": [ + { + "key": "token", + "value": "{{magic_link}}" + } + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Required Fields (email empty)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Invalid Input\", function () {\r", + " pm.response.to.have.status(422);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/magic-link", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "magic-link" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Change Password (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Confirm Old (before change)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\"\r\n \r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Change Password (wrong old pwd)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Bad Request, Invalid Old Password\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"old_password\": \"JackDoe@123\",\r\n \"new_password\": \"JaneDoe@456\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/change-password", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Change Password", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"old_password\": \"{{userpwd-k}}\",\r\n \"new_password\": \"JaneDoe@456\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/change-password", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-05_Confirm Old Pwd (after change)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Bad Request, Invalid Password\", function () {\r", + " pm.response.to.have.status(400);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Confirm New Pwd (after change)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"JaneDoe@456\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-00_Reset Password Test", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"old_password\": \"JaneDoe@456\",\r\n \"new_password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/change-password", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ] + } + } + ] + }, + { + "name": "Forget Password (Boilerplate)", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Request Forget Password", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Password reset link sent successfully\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "\r", + "// pm.test(\"Get reset link\", () => {\r", + "// const responseJson = pm.response.json();\r", + "// const reset = responseJson.data[\"reset_link\"];\r", + " \r", + "// var fields = reset.split('=');\r", + "\r", + "// var reset_link = fields[1];\r", + "\r", + "// pm.collectionVariables.set('reset_link', reset_link);\r", + "\r", + "// });\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/forgot-password", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "forgot-password" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Process Forget Password Link", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Token is valid for user xyz\", function () {\r", + " pm.response.to.have.status(302);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.execution.skipRequest();" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/forget-password?token={{reset_link}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "forget-password" + ], + "query": [ + { + "key": "token", + "value": "{{reset_link}}" + } + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Change Password", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.execution.skipRequest();\r", + "\r", + "let pwd2 = 'JohnDoe@1234';\r", + "pm.collectionVariables.set('userpwd2-k', pwd2);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "\r\n{\r\n \"new_password\": \"{{userpwd2-k}}\",\r\n \"confirm_password\": \"{{userpwd2-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/forget-password?token={{reset_link}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "forget-password" + ], + "query": [ + { + "key": "token", + "value": "{{reset_link}}" + } + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-05_Reset Password with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Bad Request - Reset Token Invalid\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"reset_token\": \"stringstringstringstringstrings\",\r\n \"new_password\": \"{{userpwd-k}}\",\r\n \"confirm_password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/reset-password", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "reset-password" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + } + ] + } + ] + }, + { + "name": "Tests - Spartacus", + "item": [ + { + "name": "Run HNG Tests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"All Tests successfully Executed\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 5 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(5000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/hng-test", + "host": [ + "{{host-k}}" + ], + "path": [ + "hng-test" + ] + } + }, + "response": [] + }, + { + "name": "Run Tests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"All Tests successfully Executed\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 30 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(30000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/all/run-tests", + "host": [ + "{{host-k}}" + ], + "path": [ + "all", + "run-tests" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Dashboard - Spartacus", + "item": [ + { + "name": "BE-PY-01_Connection Copy 4", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "// pm.execution.skipRequest();" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Register new user Copy 3", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('xuser-k', data.user.email);\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "let date = Date.now();\r", + "let email = 'john' + date + '@doe.com';\r", + "pm.collectionVariables.set('useremail-k', email);\r", + "\r", + "let pwd = 'JohnDoe@123';\r", + "pm.collectionVariables.set('userpwd-k', pwd);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\",\r\n \"first_name\": \"John\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Login existing user Copy 3", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('token-k', access_token);\r", + "\r", + "pm.test(\"Has a token\", function(){\r", + " return 'access_token';\r", + " \r", + "})\r", + "\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{useremail-k}}\",\r\n \"password\": \"{{userpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "Get All Projects", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/dashboard/projects", + "host": [ + "{{host-k}}" + ], + "path": [ + "dashboard", + "projects" + ] + } + }, + "response": [] + }, + { + "name": "Create a Project", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('dash_project_id', data.id);\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"title\": \"{{project_title-k}}\",\r\n \"project_type\": \"PDF Summarizer\",\r\n \"description\": \"This is a new project created from the user Dashboard.\",\r\n \"file_url\": \"string\",\r\n \"result\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/dashboard/projects", + "host": [ + "{{host-k}}" + ], + "path": [ + "dashboard", + "projects" + ] + } + }, + "response": [] + }, + { + "name": "Get a single Project", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/dashboard/projects/{{dash_project_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "dashboard", + "projects", + "{{dash_project_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Get all Notifications", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/dashboard/notifications", + "host": [ + "{{host-k}}" + ], + "path": [ + "dashboard", + "notifications" + ] + } + }, + "response": [] + }, + { + "name": "Get a single Notification with invalid id", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Notification not found\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "// pm.execution.skipRequest();\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/dashboard/notifications/{xyz}", + "host": [ + "{{host-k}}" + ], + "path": [ + "dashboard", + "notifications", + "{xyz}" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.execution.skipRequest();\r", + "// pm.test.skip();\r", + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Newsletters - Spartacus", + "item": [ + { + "name": "BE-PY-01_Connection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://staging.api-python.boilerplate.hng.tech/", + "protocol": "https", + "host": [ + "staging", + "api-python", + "boilerplate", + "hng", + "tech" + ], + "path": [ + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Register new super admin Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('xadmin-k', data.user.email);\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "let date = Date.now();\r", + "let email = 'admin' + date + '@doe.com';\r", + "pm.collectionVariables.set('adminemail-k', email);\r", + "\r", + "let pwd = 'JohnDoe@123';\r", + "pm.collectionVariables.set('adminpwd-k', pwd);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\",\r\n \"first_name\": \"Admin\",\r\n \"last_name\": \"Doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/register-super-admin", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "register-super-admin" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Login existing super admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('tokenadmin-k', access_token);\r", + "\r", + "pm.test(\"Has a token\", function(){\r", + " return 'access_token';\r", + " \r", + "})\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-00_Get all Subscribers", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/newsletters/subscribers", + "host": [ + "{{host-k}}" + ], + "path": [ + "newsletters", + "subscribers" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-00_Get all Newsletters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/newsletters/", + "host": [ + "{{host-k}}" + ], + "path": [ + "newsletters", + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Test with valid email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"john@doe.com\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/newsletters", + "host": [ + "{{host-k}}" + ], + "path": [ + "newsletters" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Test with invalid email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"john@doe\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-python}}/newsletters", + "host": [ + "{{host-python}}" + ], + "path": [ + "newsletters" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Test with blank email field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-python}}/newsletters", + "host": [ + "{{host-python}}" + ], + "path": [ + "newsletters" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.execution.skipRequest();" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "FAQ - Spartacus", + "item": [ + { + "name": "Login SUPER ADMIN for Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('tokenadmin-k', access_token);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-01_Fetch all FAQs", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('faq_id', data.id)" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/faqs", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Test with blank Question field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Question field should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \" \",\r\n \"answer\": \"You know when you need to pay, don't you?\",\r\n \"category\": \"Payment\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Test with blank Answer field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Answer field should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"When should I pay?\",\r\n \"answer\": \" \",\r\n \"category\": \"Payment\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Test with blank Category field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Category field should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"When should I pay?\",\r\n \"answer\": \"As soon as you are ready to use the Premium features\",\r\n \"category\": \" \"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Create FAQ with valid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"FAQ successfully created\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('faq_id', data.id)" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"When should I pay?\",\r\n \"answer\": \"As soon as you are ready to use the Premium features\",\r\n \"category\": \"Payment\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Fetch an FAQ with valid ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs/{{faq_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs", + "{{faq_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-07_Fetch an FAQ with invalid ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"FAQ does not exist\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([404]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs/xyz", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs", + "xyz" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-09_Update an FAQ with blank fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Fields should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \" \",\r\n \"answer\": \" \",\r\n \"category\": \" \"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs/{{faq_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs", + "{{faq_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-08_Update an FAQ with valid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"How do I get new features?\",\r\n \"answer\": \"We enhance our features periodically as part of your subscription\",\r\n \"category\": \"Feature\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs/{{faq_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs", + "{{faq_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-10_Delete a specific FAQ", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"FAQ successfully deleted\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs/{{faq_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs", + "{{faq_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Confirm FAQ no longer exists", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "\r", + "pm.test(\"FAQ does not exist\", function () {\r", + " pm.response.to.have.status(404);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/faqs/{{faq_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "faqs", + "{{faq_id}}" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ] + } + } + ] + }, + { + "name": "Testimonial - Spartacus", + "item": [ + { + "name": "Login SUPER ADMIN for Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "const {access_token} = pm.response.json();\r", + "pm.collectionVariables.set('tokenadmin-k', access_token);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-01_Fetch all Testimonials", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/testimonials", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Test with blank 'content' field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Testimonial should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"content\": \"\",\r\n \"ratings\": 4\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Test with blank 'ratings' field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.execution.skipRequest();" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"content\": \"This is awesome\",\r\n \"ratings\": \r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Create Testimonial", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('testimonial_id', data.id)" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"content\": \"I like this product\",\r\n \"ratings\": 4\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Fetch a Testimonial with valid ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/{{testimonial_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "{{testimonial_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-07_Fetch an Testimonial with invalid ID Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Testimonial does not exist\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([404]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/xyz", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "xyz" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-08_Delete a specific Testimonial", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Testimonial Deleted\", function () {\r", + " pm.response.to.have.status(204);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/{{testimonial_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "{{testimonial_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Confirm testimonial was deleted", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Testimonial does not exist\", function () {\r", + " pm.response.to.have.status(404);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/{{testimonial_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "{{testimonial_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-09_Delete all Testimonials", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"ALL Testimonials have been deleted\", function () {\r", + " pm.response.to.have.status(204);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/testimonials/", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials", + "" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-01_Confirm ALL Testimonials were deleted", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Testimonial Array is empty\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response Body is correct\", function () {\r", + " pm.response.to.have.body('{\"status_code\":200,\"success\":true,\"message\":\"Successfully fetched items\",\"data\":{\"pages\":0,\"total\":0,\"skip\":0,\"limit\":10,\"items\":[]}}');\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/testimonials", + "host": [ + "{{host-k}}" + ], + "path": [ + "testimonials" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMDY2YWI4YzktNDlhMy03NGFiLTgwMDAtNDk5N2YyODU1OGRkIiwiZXhwIjoxNzIyNTI3ODQzLCJ0eXBlIjoiYWNjZXNzIn0.Thcd725Xw_EX5Vyr3wQ3jDvdtZYlTieF7Y2iMmKxEtA", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ] + } + } + ] + }, + { + "name": "Region, Timezone & Lang - Spartacus", + "item": [ + { + "name": "Login SUPER ADMIN for Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"{{adminemail-k}}\",\r\n \"password\": \"{{adminpwd-k}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/auth/login", + "host": [ + "{{host-k}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-01_Fetch all Regions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{host-k}}/regions", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-03_Test with blank 'region' field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Region Field should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \" \",\r\n \"language\": \"Spanish\",\r\n \"timezone\": \"+1 GMT\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-04_Test with blank 'language' field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Language Field should not be blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \"West Africa\",\r\n \"language\": \"\",\r\n \"timezone\": \"+1 WAT\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-05_Test with blank 'timezone' field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Timezone Field should not be Blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \"West Africa\",\r\n \"language\": \"Afrikans\",\r\n \"timezone\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-06_Test with blank fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Fields should not be Blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \"\",\r\n \"language\": \"\",\r\n \"timezone\": \"\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-02_Create Region", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r", + "});\r", + "\r", + "const {data} = pm.response.json();\r", + "pm.collectionVariables.set('region_id', data.id)" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \"Europe\",\r\n \"language\": \"English\",\r\n \"timezone\": \"+1 GMT\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-07_Fetch a Region with valid ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Region retrieved successfully\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions/{{region_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions", + "{{region_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-08_Fetch a Region with invalid ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Region does not exist\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([404]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions/xyz", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions", + "xyz" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-10_Update a Region with blank fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Fields should not be Blank\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([400, 422]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \" \",\r\n \"language\": \" \",\r\n \"timezone\": \" \"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions/{{region_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions", + "{{region_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-09_Update a Region with valid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"region\": \"Asia\",\r\n \"language\": \"Mandarin\",\r\n \"timezone\": \"+7 GMT\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions/{{region_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions", + "{{region_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-11_Delete a specific Region", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Content Deleted\", function () {\r", + " pm.response.to.have.status(204);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions/{{region_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions", + "{{region_id}}" + ] + } + }, + "response": [] + }, + { + "name": "BE-PY-07_Verify Region was deleted", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Region does not exist\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([404]);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true, + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{tokenadmin-k}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/vnd.api+json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host-k}}/regions/{{region_id}}", + "host": [ + "{{host-k}}" + ], + "path": [ + "regions", + "{{region_id}}" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.test(\"Response time is less than 2 seconds\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(2000);\r", + "});" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.test(\"Content-Type is present\", function () {\r", + " pm.response.to.have.header(\"Content-Type\");\r", + "});" + ] + } + } + ], + "variable": [ + { + "key": "boilerplateUrl", + "value": "https://staging.api-python.boilerplate.hng.tech" + }, + { + "key": "boilerPlateRandomEmail", + "value": "" + }, + { + "key": "userAccessToken", + "value": "" + }, + { + "key": "userId", + "value": "" + }, + { + "key": "adminAccessTokenBoiler", + "value": "" + }, + { + "key": "adminRandomEmailBioler", + "value": "" + }, + { + "key": "host-k", + "value": "", + "type": "string" + }, + { + "key": "useremail-k", + "value": "" + }, + { + "key": "userpwd-k", + "value": "" + }, + { + "key": "xuser-k", + "value": "" + }, + { + "key": "adminemail-k", + "value": "" + }, + { + "key": "adminpwd-k", + "value": "" + }, + { + "key": "xadmin-k", + "value": "" + }, + { + "key": "token-k", + "value": "" + }, + { + "key": "token2-k", + "value": "" + }, + { + "key": "tokenadmin-k", + "value": "" + }, + { + "key": "faq_id", + "value": "" + }, + { + "key": "testimonial_id", + "value": "" + }, + { + "key": "region_id", + "value": "" + } + ] +} \ No newline at end of file