{ "info": { "_postman_id": "1facadda-be71-4b53-b028-3100e261e0d3", "name": "Damage Assessment API Tests", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "2845111" }, "item": [ { "name": "Setup", "item": [ { "name": "New Request", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Domain variable is set\", function() {", " pm.expect(pm.environment.has(\"domain\")).to.be.true;", " pm.expect(pm.environment.get(\"domain\")).to.be.not.empty;", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.has(\"domain\") || !pm.environment.get(\"domain\")) {", " pm.environment.set(\"domain\", \"https://dev-services.damageassessment.net/\");", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "https://dev-services.damageassessment.net/answers", "protocol": "https", "host": [ "dev-services", "damageassessment", "net" ], "path": [ "answers" ] } }, "response": [] } ] }, { "name": "Answers", "item": [ { "name": "Get Requests", "item": [ { "name": "Get Answers", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "", "pm.test(\"Response is an array\", function () {", " pm.expect(pm.response.json()).to.be.an('array');", "});", "", "", "pm.test(\"Response array is empty\", function () {", " const responseData = pm.response.json();", " ", " pm.expect(responseData).to.be.an('array');", " pm.expect(responseData).to.have.lengthOf(0);", "});", "", "", "pm.test(\"Response time is less than 200ms\", function () {", " pm.expect(pm.response.responseTime).to.be.below(200);", "});", "", "", "pm.test(\"Response does not contain any errors or error messages\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array');", " pm.expect(responseData).to.have.lengthOf(0, \"Response should not contain any errors or error messages\");", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}answers", "host": [ "{{domain}}answers" ] } }, "response": [] }, { "name": "Get Answers By Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}answers/1", "host": [ "{{domain}}answers" ], "path": [ "1" ] } }, "response": [] }, { "name": "Get Answers By Reponse Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}answers/byresponse/1", "host": [ "{{domain}}answers" ], "path": [ "byresponse", "1" ] } }, "response": [] }, { "name": "Get Answers By Question Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}answers/byquestion/1", "host": [ "{{domain}}answers" ], "path": [ "byquestion", "1" ] } }, "response": [] } ] }, { "name": "Put Answers", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;" ], "type": "text/javascript" } } ], "request": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"id\": 1,\n \"questionId\": 1,\n \"answerText\": \"string\",\n \"comment\": \"string\",\n \"surveyResponseId\": 1\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{domain}}answers", "host": [ "{{domain}}answers" ] } }, "response": [] }, { "name": "Post Answers", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"id\": 1,\n \"questionId\": 1,\n \"answerText\": \"string\",\n \"comment\": \"string\",\n \"surveyResponseId\": 1\n}" }, "url": { "raw": "{{domain}}answers", "host": [ "{{domain}}answers" ] } }, "response": [] }, { "name": "Delete Answers by Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;" ], "type": "text/javascript" } } ], "request": { "method": "DELETE", "header": [], "url": { "raw": "{{domain}}answers/1", "host": [ "{{domain}}answers" ], "path": [ "1" ] } }, "response": [] } ] }, { "name": "Employees", "item": [ { "name": "Get Requests", "item": [ { "name": "Get Employees", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "// This assumes jsonData.items is sorted and you want the next ID.", "var nextId;", "if (jsonData && jsonData.length > 0) {", " lastId = _.last(jsonData).id", " nextId = lastId + 1;", " pm.environment.set(\"lastEmployeeId\", lastId);", " pm.environment.set(\"nextEmployeeId\", nextId);", "} else {", " console.log(\"No items found in the response or invalid response format\");", "}", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}employees", "host": [ "{{domain}}employees" ] } }, "response": [] }, { "name": "Get Employees By Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "pm.test(\"Employee name matches\", function() {", " var expectedName = pm.environment.get(\"employeeName\");", " pm.expect(jsonData.name).to.eql(expectedName);", "});", "", "pm.test(\"Birth date matches\", function() {", " var expectedBirthDate = pm.environment.get(\"randomBirthDate\");", " pm.expect(jsonData.birthDate).to.eql(expectedBirthDate);", "});", "", "pm.test(\"Phone number matches\", function() {", " var expectedPhoneNumber = pm.environment.get(\"randomPhoneNumber\");", " pm.expect(jsonData.officePhoneNumber).to.eql(expectedPhoneNumber);", "});", "", "pm.test(\"Email matches\", function() {", " var expectedEmail = pm.environment.get(\"randomEmail\");", " pm.expect(jsonData.email).to.eql(expectedEmail);", "});", "", "pm.test(\"Activity status matches\", function() {", " var expectedIsActive = pm.environment.get(\"randomBoolean\");", " pm.expect(jsonData.isActive).to.eql(expectedIsActive === \"true\");", "});", "", "pm.test(\"Preferred language matches\", function() {", " var expectedLanguage = pm.environment.get(\"randomLanguage\");", " pm.expect(jsonData.preferredLanguage).to.eql(expectedLanguage);", "});", "" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}employees/{{lastEmployeeId}}", "host": [ "{{domain}}employees" ], "path": [ "{{lastEmployeeId}}" ] } }, "response": [] } ] }, { "name": "Add Employee", "item": [ { "name": "Post Employees", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "function pad(number, digits) {", " return String(number).padStart(digits, '0');", "}", "", "// Random year between 1980 and 2000", "var randomYear = Math.floor(Math.random() * (2000 - 1980 + 1) + 1980);", "", "// Random month between 1 and 12", "var randomMonth = Math.floor(Math.random() * 12) + 1;", "", "// Days per month (considering leap year for February)", "var daysInMonth = [31, (randomYear % 4 === 0 && (randomYear % 100 !== 0 || randomYear % 400 === 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];", "", "// Random day based on month", "var randomDay = Math.floor(Math.random() * daysInMonth[randomMonth - 1]) + 1;", "", "// Random time components", "var randomHour = Math.floor(Math.random() * 24);", "var randomMinute = Math.floor(Math.random() * 60);", "var randomSecond = Math.floor(Math.random() * 60);", "var randomMillisecond = Math.floor(Math.random() * 10000000); // 7 digits", "", "// Construct the date string", "var randomBirthDate = randomYear + '-' +", " pad(randomMonth, 2) + '-' +", " pad(randomDay, 2) + 'T' +", " pad(randomHour, 2) + ':' +", " pad(randomMinute, 2) + ':' +", " pad(randomSecond, 2) + '.' +", " pad(randomMillisecond, 7) + '+00:00';", "", "// Array of possible languages", "var languages = [\"en\", \"fr\", \"de\", \"ht\", \"es\"];", "var randomLanguage = languages[Math.floor(Math.random() * languages.length)];", "", "// Use Postman's built-in dynamic variables", "var firstName = pm.variables.replaceIn(\"{{$randomFirstName}}\");", "var lastName = pm.variables.replaceIn(\"{{$randomLastName}}\");", "var phoneNumber = pm.variables.replaceIn(\"{{$randomPhoneNumber}}\");", "var email = pm.variables.replaceIn(\"{{$randomEmail}}\");", "var randomBoolean = pm.variables.replaceIn(\"{{$randomBoolean}}\"); // This will return \"true\" or \"false\" as a string", "", "// Set the environment variables", "pm.environment.set(\"employeeName\", firstName + \" \" + lastName);", "pm.environment.set(\"randomPhoneNumber\", phoneNumber);", "pm.environment.set(\"randomBirthDate\", randomBirthDate);", "pm.environment.set(\"randomEmail\", email);", "pm.environment.set(\"randomBoolean\", randomBoolean);", "pm.environment.set(\"randomLanguage\", randomLanguage);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"id\": {{nextEmployeeId}},\n \"employeeCode\": \"{{$randomBankAccount}}\",\n \"name\": \"{{employeeName}}\",\n \"birthDate\": \"{{randomBirthDate}}\",\n \"officePhoneNumber\": \"{{randomPhoneNumber}}\",\n \"email\": \"{{randomEmail}}\",\n \"isActive\": {{$randomBoolean}},\n \"preferredLanguage\": \"{{randomLanguage}}\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{domain}}employees", "host": [ "{{domain}}employees" ] } }, "response": [] }, { "name": "Verify Add", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "pm.test(\"Employee name matches\", function() {", " var expectedName = pm.environment.get(\"employeeName\");", " pm.expect(jsonData.name).to.eql(expectedName);", "});", "", "pm.test(\"Birth date matches\", function() {", " var expectedBirthDate = pm.environment.get(\"randomBirthDate\");", " pm.expect(jsonData.birthDate).to.eql(expectedBirthDate);", "});", "", "pm.test(\"Phone number matches\", function() {", " var expectedPhoneNumber = pm.environment.get(\"randomPhoneNumber\");", " pm.expect(jsonData.officePhoneNumber).to.eql(expectedPhoneNumber);", "});", "", "pm.test(\"Email matches\", function() {", " var expectedEmail = pm.environment.get(\"randomEmail\");", " pm.expect(jsonData.email).to.eql(expectedEmail);", "});", "", "pm.test(\"Activity status matches\", function() {", " var expectedIsActive = pm.environment.get(\"randomBoolean\");", " pm.expect(jsonData.isActive).to.eql(expectedIsActive === \"true\");", "});", "", "pm.test(\"Preferred language matches\", function() {", " var expectedLanguage = pm.environment.get(\"randomLanguage\");", " pm.expect(jsonData.preferredLanguage).to.eql(expectedLanguage);", "});", "" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}employees/{{nextEmployeeId}}", "host": [ "{{domain}}employees" ], "path": [ "{{nextEmployeeId}}" ] } }, "response": [] } ] }, { "name": "Update Employee", "item": [ { "name": "Put Employees", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "function pad(number, digits) {", " return String(number).padStart(digits, '0');", "}", "", "// Random year between 1980 and 2000", "var randomYear = Math.floor(Math.random() * (2000 - 1980 + 1) + 1980);", "", "// Random month between 1 and 12", "var randomMonth = Math.floor(Math.random() * 12) + 1;", "", "// Days per month (considering leap year for February)", "var daysInMonth = [31, (randomYear % 4 === 0 && (randomYear % 100 !== 0 || randomYear % 400 === 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];", "", "// Random day based on month", "var randomDay = Math.floor(Math.random() * daysInMonth[randomMonth - 1]) + 1;", "", "// Random time components", "var randomHour = Math.floor(Math.random() * 24);", "var randomMinute = Math.floor(Math.random() * 60);", "var randomSecond = Math.floor(Math.random() * 60);", "var randomMillisecond = Math.floor(Math.random() * 10000000); // 7 digits", "", "// Construct the date string", "var randomBirthDate = randomYear + '-' +", " pad(randomMonth, 2) + '-' +", " pad(randomDay, 2) + 'T' +", " pad(randomHour, 2) + ':' +", " pad(randomMinute, 2) + ':' +", " pad(randomSecond, 2) + '.' +", " pad(randomMillisecond, 7) + '+00:00';", "", "// Array of possible languages", "var languages = [\"en\", \"fr\", \"de\", \"ht\", \"es\"];", "var randomLanguage = languages[Math.floor(Math.random() * languages.length)];", "", "// Use Postman's built-in dynamic variables", "var firstName = pm.variables.replaceIn(\"{{$randomFirstName}}\");", "var lastName = pm.variables.replaceIn(\"{{$randomLastName}}\");", "var phoneNumber = pm.variables.replaceIn(\"{{$randomPhoneNumber}}\");", "var email = pm.variables.replaceIn(\"{{$randomEmail}}\");", "var randomBoolean = pm.variables.replaceIn(\"{{$randomBoolean}}\"); // This will return \"true\" or \"false\" as a string", "", "// Set the environment variables", "pm.environment.set(\"employeeName\", firstName + \" \" + lastName);", "pm.environment.set(\"randomPhoneNumber\", phoneNumber);", "pm.environment.set(\"randomBirthDate\", randomBirthDate);", "pm.environment.set(\"randomEmail\", email);", "pm.environment.set(\"randomBoolean\", randomBoolean);", "pm.environment.set(\"randomLanguage\", randomLanguage);", "" ], "type": "text/javascript" } } ], "request": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"id\": {{nextEmployeeId}},\n \"employeeCode\": \"{{$randomBankAccount}}\",\n \"name\": \"{{employeeName}}\",\n \"birthDate\": \"{{randomBirthDate}}\",\n \"officePhoneNumber\": \"{{randomPhoneNumber}}\",\n \"email\": \"{{randomEmail}}\",\n \"isActive\": {{$randomBoolean}},\n \"preferredLanguage\": \"{{randomLanguage}}\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{domain}}employees", "host": [ "{{domain}}employees" ] } }, "response": [] }, { "name": "Verify Update", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "pm.test(\"Employee name matches\", function() {", " var expectedName = pm.environment.get(\"employeeName\");", " pm.expect(jsonData.name).to.eql(expectedName);", "});", "", "pm.test(\"Birth date matches\", function() {", " var expectedBirthDate = pm.environment.get(\"randomBirthDate\");", " pm.expect(jsonData.birthDate).to.eql(expectedBirthDate);", "});", "", "pm.test(\"Phone number matches\", function() {", " var expectedPhoneNumber = pm.environment.get(\"randomPhoneNumber\");", " pm.expect(jsonData.officePhoneNumber).to.eql(expectedPhoneNumber);", "});", "", "pm.test(\"Email matches\", function() {", " var expectedEmail = pm.environment.get(\"randomEmail\");", " pm.expect(jsonData.email).to.eql(expectedEmail);", "});", "", "pm.test(\"Activity status matches\", function() {", " var expectedIsActive = pm.environment.get(\"randomBoolean\");", " pm.expect(jsonData.isActive).to.eql(expectedIsActive === \"true\");", "});", "", "pm.test(\"Preferred language matches\", function() {", " var expectedLanguage = pm.environment.get(\"randomLanguage\");", " pm.expect(jsonData.preferredLanguage).to.eql(expectedLanguage);", "});", "" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}employees/{{nextEmployeeId}}", "host": [ "{{domain}}employees" ], "path": [ "{{nextEmployeeId}}" ] } }, "response": [] } ] }, { "name": "Delete Employee", "item": [ { "name": "Delete Employees", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "" ], "type": "text/javascript" } } ], "request": { "method": "DELETE", "header": [], "url": { "raw": "{{domain}}employees/{{nextEmployeeId}}", "host": [ "{{domain}}employees" ], "path": [ "{{nextEmployeeId}}" ] } }, "response": [] } ] } ] }, { "name": "Questions", "item": [ { "name": "Get Requests", "item": [ { "name": "Get Questions", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function () {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "", "pm.test(\"Response is an array\", function () {", " pm.expect(pm.response.json()).to.be.an('array');", "});", "", "", "pm.test(\"Check if id is a non-negative integer\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array').that.is.not.empty;", "", " responseData.forEach(function (question) {", " pm.expect(question.id).to.be.a('number').that.is.greaterThan(-1);", " });", "});", "", "", "pm.test(\"QuestionNumber is a non-negative integer\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array').and.to.have.lengthOf.at.least(1);", "", " responseData.forEach(function (question) {", " pm.expect(question.questionNumber).to.be.a('number').and.to.be.at.least(0);", " });", "});", "", "", "pm.test(\"surveyId is a non-negative integer\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array');", "", " responseData.forEach(function (question) {", " pm.expect(question.surveyId).to.be.a('number');", " pm.expect(question.surveyId).to.be.at.least(0);", " });", "});", "", "", "", "", "pm.test(\"Response status code is 200\", function () {", " pm.expect(pm.response.code).to.equal(200);", "});", "", "", "pm.test(\"Response is an array\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array');", "});", "", "", "pm.test(\"Each question has a non-negative integer id\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array');", "", " responseData.forEach(function (question) {", " pm.expect(question.id).to.be.a('number');", " pm.expect(question.id).to.be.at.least(0);", " });", "});", "", "", "pm.test(\"Each question has a non-negative integer questionNumber\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array');", " responseData.forEach(function (question) {", " pm.expect(question.questionNumber).to.be.a('number');", " pm.expect(question.questionNumber).to.be.at.least(0);", " });", "});", "", "", "pm.test(\"Each question has a non-negative integer surveyId\", function () {", " const responseData = pm.response.json();", "", " pm.expect(responseData).to.be.an('array');", "", " responseData.forEach(function (question) {", " pm.expect(question.surveyId).to.be.a('number');", " pm.expect(question.surveyId).to.be.at.least(0);", " });", "});", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions", "host": [ "{{domain}}questions" ] } }, "response": [] }, { "name": "Get Questions By Language", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/en", "host": [ "{{domain}}questions" ], "path": [ "en" ] } }, "response": [] }, { "name": "Get Questions By Id and Language", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/1/en", "host": [ "{{domain}}questions" ], "path": [ "1", "en" ] } }, "response": [] }, { "name": "Get Questions By Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/1", "host": [ "{{domain}}questions" ], "path": [ "1" ] } }, "response": [] }, { "name": "Get Questions By Survey Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/bysurvey/1", "host": [ "{{domain}}questions" ], "path": [ "bysurvey", "1" ] } }, "response": [] }, { "name": "Get Questions By Survey Id and Language", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/bysurvey/1/en", "host": [ "{{domain}}questions" ], "path": [ "bysurvey", "1", "en" ] } }, "response": [] }, { "name": "Get Questions Categories", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/categories", "host": [ "{{domain}}questions" ], "path": [ "categories" ] } }, "response": [] }, { "name": "Get Questions Categories Language", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/categories/en", "host": [ "{{domain}}questions" ], "path": [ "categories", "en" ] } }, "response": [] }, { "name": "Get Questions Categories By Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/categories/1", "host": [ "{{domain}}questions" ], "path": [ "categories", "1" ] } }, "response": [] }, { "name": "Get Questions Categories By Id and Lanuage", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "tests[\"200 Unauthorized POST request\"] = responseCode.code === 200;", "pm.test(\"Response status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}questions/categories/en/1", "host": [ "{{domain}}questions" ], "path": [ "categories", "en", "1" ] } }, "response": [] } ] } ] }, { "name": "Locations", "item": [] }, { "name": "Surveys", "item": [ { "name": "Get Requests", "item": [ { "name": "Get Surveys", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}surveys", "host": [ "{{domain}}surveys" ] } }, "response": [] }, { "name": "Get Surveys By Language", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}surveys/en", "host": [ "{{domain}}surveys" ], "path": [ "en" ] } }, "response": [] }, { "name": "Get Surveys By Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}surveys/1", "host": [ "{{domain}}surveys" ], "path": [ "1" ] } }, "response": [] }, { "name": "Get Surveys By Id and Language", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}surveys/1/en", "host": [ "{{domain}}surveys" ], "path": [ "1", "en" ] } }, "response": [] } ] } ] }, { "name": "SurveyResponses", "item": [ { "name": "Get Requests", "item": [ { "name": "Get Responses", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses", "host": [ "{{domain}}responses" ] } }, "response": [] }, { "name": "Get Responses By Survey Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses/bysurvey/1", "host": [ "{{domain}}responses" ], "path": [ "bysurvey", "1" ] } }, "response": [] }, { "name": "Get Responses By Survey Id and Location Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses/1/1", "host": [ "{{domain}}responses" ], "path": [ "1", "1" ] } }, "response": [] }, { "name": "Get Responses Survey Id and Question Id and Answer Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses/byanswer/1/1/1", "host": [ "{{domain}}responses" ], "path": [ "byanswer", "1", "1", "1" ] } }, "response": [] }, { "name": "Get Responses By Region", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses/byregion/1", "host": [ "{{domain}}responses" ], "path": [ "byregion", "1" ] } }, "response": [] }, { "name": "Get Responses By Maintenance Center", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses/bymaintenancecenter/1", "host": [ "{{domain}}responses" ], "path": [ "bymaintenancecenter", "1" ] } }, "response": [] }, { "name": "Get Responses By Response Id", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);", "", "", "pm.test(\"No errors in Pre-request Script\", function() {", " pm.expect(pm.environment.get(\"preRequestError\")).to.be.undefined;", "});", "", "", "tests[\"Response code is 200 OK\"] = responseCode.code === 200;", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "if (!pm.environment.get(\"domain\")) {", " console.error(\"Error: Domain is missing!\");", "", " // Set an error flag", " pm.environment.set(\"preRequestError\", \"Domain is missing!\");", "", " // Change request URL to prevent it from sending", " pm.request.url = \"http://invalid-url-to-prevent-sending.com\";", "}" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{domain}}responses/bymaintenancecenter/1", "host": [ "{{domain}}responses" ], "path": [ "bymaintenancecenter", "1" ] } }, "response": [] } ] } ] }, { "name": "Attachments", "item": [] }, { "name": "UserAccess", "item": [] } ] }