{"info":{"_postman_id":"6ae6335e-fd25-4d67-bc6c-f3809a33f3b4","name":"Automation Exercise APIs","description":"<html><head></head><body><h1 id=\"about-this-collection\">About this collection</h1>\n<p>This collection showcases how I would test and ensure functionality of various APIs</p>\n<p><a href=\"https://postman.postman.co/documentation/24552533-5bead607-0197-4e1d-87d4-3160bc7631c1?entity=&amp;branch=&amp;version=\"></a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"About this collection","slug":"about-this-collection"}],"owner":"31103252","collectionId":"6ae6335e-fd25-4d67-bc6c-f3809a33f3b4","publishedId":"2sAXjT1pSH","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-09-10T20:33:36.000Z"},"item":[{"name":"Get All Products List","event":[{"listen":"test","script":{"id":"21b64763-29e5-4ea8-9d74-0de5adfc3ce6","exec":["// Validate that the response code should be 200","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","// Validate that the response is json object","pm.test(\"Response is a json object\", function () {","    pm.expect(pm.response.json()).to.be.an('object');","});","","// Validate that the response has an arg object","pm.test(\"Response to have 'arg' object\", function () {","    pm.expect(pm.response.json()).to.have.property('args');","});","","// Validate that the response has headers object","pm.test(\"Response to have 'headers' object\", function () {","    pm.expect(pm.response.json()).to.have.property('headers');","});","","// Validate that the response has url property","pm.test(\"Response to have 'url' property\", function () {","    pm.expect(pm.response.json()).to.have.property('url');","});",""],"type":"text/javascript","packages":{}}}],"id":"53f42f88-47f8-4572-9776-deb7fc3a4787","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://automationexercise.com/api/productsList","description":"<p>The tests in this request validate that:</p>\n<ul>\n<li>the response code is 200</li>\n<li>the response is a JSON object</li>\n<li>the response has an 'arg' object</li>\n<li>the response has 'headers' object</li>\n<li>the response has a 'URL' property</li>\n</ul>\n","urlObject":{"path":["productsList"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"53f42f88-47f8-4572-9776-deb7fc3a4787"},{"name":"POST To All Products List","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"Response has the required fields - responseCode and message\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('responseCode');","    pm.expect(responseData).to.have.property('message');","});","","","pm.test(\"Response code is a non-negative integer\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.responseCode).to.be.a('number');","    pm.expect(responseData.responseCode).to.be.at.least(0);","});","","","pm.test(\"Message is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Message should not be empty\");","});"],"type":"text/javascript"}}],"id":"5d7f7a9b-ebaf-4758-959c-abd9cd913e17","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://automationexercise.com/api/productsList","urlObject":{"path":["productsList"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"5d7f7a9b-ebaf-4758-959c-abd9cd913e17"},{"name":"Get All Brands List","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Response content type is application/json\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","","","pm.test(\"Response has the required fields - responseCode and brands\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('responseCode');","    pm.expect(responseData).to.have.property('brands');","});","","","pm.test(\"Brands array is present and contains expected number of elements\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.brands).to.exist.and.to.be.an('array');","    pm.expect(responseData.brands).to.have.lengthOf(1);","});","","","pm.test(\"Id is a non-negative integer and brand is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.brands).to.be.an('array');","  ","  responseData.brands.forEach(function(brand) {","    pm.expect(brand.id).to.be.a('number').and.to.satisfy((id) => id >= 0, \"Id should be a non-negative integer\");","    pm.expect(brand.brand).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Brand should not be empty\");","  });","});"],"type":"text/javascript"}}],"id":"749339d6-8c84-4f07-ad86-e50e2723848d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://automationexercise.com/api/brandsList","urlObject":{"path":["brandsList"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"749339d6-8c84-4f07-ad86-e50e2723848d"},{"name":"PUT To All Brands List","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.equal(\"text/html\");","});","","","pm.test(\"Validate responseCode is 0\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.responseCode).to.equal(0);","});","","","pm.test(\"Message is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Message should not be empty\");","});","","","pm.test(\"Response time is less than 200ms\", function () {","  pm.expect(pm.response.responseTime).to.be.below(200);","});"],"type":"text/javascript"}}],"id":"c7d2e03c-f509-4be4-ab83-826e76de66ca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://automationexercise.com/api/brandsList","urlObject":{"path":["brandsList"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"c7d2e03c-f509-4be4-ab83-826e76de66ca"},{"name":"POST To Search Product","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is text/html\", function () {","  pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"Response has the required fields - id, name, price, brand, category\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.products).to.be.an('array').that.is.not.empty;","","    responseData.products.forEach(function(product) {","        pm.expect(product.id).to.exist;","        pm.expect(product.name).to.exist;","        pm.expect(product.price).to.exist;","        pm.expect(product.brand).to.exist;","        pm.expect(product.category).to.exist;","    });","});","","","pm.test(\"Products array is present and contains expected number of elements\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.products).to.exist.and.to.be.an('array');","    pm.expect(responseData.products).to.have.lengthOf.at.least(1);","});","","","pm.test(\"Name and price are non-empty strings, and id is a non-negative integer\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  ","  responseData.products.forEach(function(product) {","    pm.expect(product.name).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Name should not be empty\");","    pm.expect(product.price).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Price should not be empty\");","    pm.expect(product.id).to.be.a('number').and.to.be.at.least(0, \"ID should be a non-negative integer\");","  });","});"],"type":"text/javascript"}}],"id":"71fbd949-ef9d-4076-ab34-8651f823c421","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"search_product","value":"top","type":"text"}]},"url":"https://automationexercise.com/api/searchProduct","urlObject":{"path":["searchProduct"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"71fbd949-ef9d-4076-ab34-8651f823c421"},{"name":"POST To Search Product without search_product parameter","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.equal(\"text/html\");","});","","","pm.test(\"ResponseCode should be 0\", function () {","  const responseData = pm.response.json();","  pm.expect(responseData.responseCode).to.equal(0);","});","","","pm.test(\"Message is an empty string\", function () {","  const responseData = pm.response.json();","  pm.expect(responseData.message).to.equal(\"\");","});","","","pm.test(\"Response contains the required fields\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData).to.include.all.keys('responseCode', 'message');","});"],"type":"text/javascript"}}],"id":"fe254c3c-30ad-4709-98ac-0422ae292220","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://automationexercise.com/api/searchProduct","urlObject":{"path":["searchProduct"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"fe254c3c-30ad-4709-98ac-0422ae292220"},{"name":"POST To Create/Register User Account","event":[{"listen":"prerequest","script":{"id":"380fd49b-3f82-41f2-903b-93e87ee34b67","exec":["// Function to generate a random integer between min (inclusive) and max (inclusive)\r","function getRandomInt(min, max) {\r","    return Math.floor(Math.random() * (max - min + 1)) + min;\r","}\r","\r","// Function to generate a random string of given length\r","function getRandomString(length) {\r","    const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\r","    let result = '';\r","    for (let i = 0; i < length; i++) {\r","        result += chars.charAt(Math.floor(Math.random() * chars.length));\r","    }\r","    return result;\r","}\r","\r","// Generate a random day (1 to 30)\r","const randomDay = getRandomInt(1, 30);\r","\r","// Generate a random year (1980 to 2005)\r","const randomYear = getRandomInt(1980, 2005);\r","\r","// Generate random email and password\r","const randomUserEmail = getRandomString(10) + '@example.com';\r","const randomUserPassword = getRandomString(12);\r","\r","// Set the generated values as environment variables\r","pm.environment.set(\"randomDay\", randomDay);\r","pm.environment.set(\"randomYear\", randomYear);\r","pm.environment.set(\"randomUserEmail\", randomUserEmail);\r","pm.environment.set(\"randomUserPassword\", randomUserPassword);\r","\r","// Log the generated values to the Postman Console (optional)\r","console.log(\"Generated Random Day:\", randomDay);\r","console.log(\"Generated Random Year:\", randomYear);\r","console.log(\"Generated Email:\", randomUserEmail);\r","console.log(\"Generated Password:\", randomUserPassword);"],"type":"text/javascript","packages":{}}},{"listen":"test","script":{"exec":["","pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Content-Type header is 'text/html'\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"Response has the required fields - responseCode and message\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('responseCode');","    pm.expect(responseData).to.have.property('message');","});","","","pm.test(\"Response code is a non-negative integer\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.responseCode).to.be.a('number');","  pm.expect(responseData.responseCode).to.be.at.least(0);","});","","","pm.test(\"Message is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Message should not be empty\");","});"],"type":"text/javascript"}}],"id":"d6474ddf-a416-47a9-be98-92039a1ec059","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Patricia McLaughlin","type":"text"},{"key":"email","value":"{{$randomUserEmail}}","type":"text"},{"key":"password","value":"{{$randomUserPassword}}","type":"text"},{"key":"title","value":"Mr","type":"text"},{"key":"birth_date","value":"{{randomDay}}","type":"text"},{"key":"birth_month","value":"November","type":"text"},{"key":"birth_year","value":"{{randomYear}}","type":"text"},{"key":"firstname","value":"Zita","type":"text"},{"key":"lastname","value":"Rempel","type":"text"},{"key":"company","value":"Robel - Bartoletti","type":"text"},{"key":"address1","value":"5144 Daniel Port","type":"text"},{"key":"address2","value":"","type":"text"},{"key":"country","value":"Austria","type":"text"},{"key":"zipcode","value":"KP","type":"text"},{"key":"state","value":"Test State","type":"text"},{"key":"city","value":"Jasttown","type":"text"},{"key":"mobile_number","value":"36-779-753-6509","type":"text"}]},"url":"https://automationexercise.com/api/createAccount","urlObject":{"path":["createAccount"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"d6474ddf-a416-47a9-be98-92039a1ec059"},{"name":"PUT METHOD To Update User Account","event":[{"listen":"prerequest","script":{"id":"380fd49b-3f82-41f2-903b-93e87ee34b67","exec":["// Function to generate a random integer between min (inclusive) and max (inclusive)\r","function getRandomInt(min, max) {\r","    return Math.floor(Math.random() * (max - min + 1)) + min;\r","}\r","\r","// Function to generate a random string of given length\r","function getRandomString(length) {\r","    const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\r","    let result = '';\r","    for (let i = 0; i < length; i++) {\r","        result += chars.charAt(Math.floor(Math.random() * chars.length));\r","    }\r","    return result;\r","}\r","\r","// Generate a random day (1 to 30)\r","const randomDay = getRandomInt(1, 30);\r","\r","// Generate a random year (1980 to 2005)\r","const randomYear = getRandomInt(1980, 2005);\r","\r","// Generate random email and password\r","const randomUserEmail = getRandomString(10) + '@example.com';\r","const randomUserPassword = getRandomString(12);\r","\r","// Set the generated values as environment variables\r","pm.environment.set(\"randomDay\", randomDay);\r","pm.environment.set(\"randomYear\", randomYear);\r","pm.environment.set(\"randomUserEmail\", randomUserEmail);\r","pm.environment.set(\"randomUserPassword\", randomUserPassword);\r","\r","// Log the generated values to the Postman Console (optional)\r","console.log(\"Generated Random Day:\", randomDay);\r","console.log(\"Generated Random Year:\", randomYear);\r","console.log(\"Generated Email:\", randomUserEmail);\r","console.log(\"Generated Password:\", randomUserPassword);"],"type":"text/javascript","packages":{}}},{"listen":"test","script":{"exec":["","pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.to.have.status(200));","});","","","pm.test(\"Content-Type header is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"Response includes responseCode\", function () {","    const responseData = pm.response.json();","    pm.expect(responseData.responseCode).to.exist;","});","","","pm.test(\"Message is an empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.equal(\"\");","});","","","pm.test(\"Verify that responseCode is a non-negative integer\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.responseCode).to.be.a('number').and.to.satisfy((num) => num >= 0, \"responseCode should be a non-negative integer\");","});"],"type":"text/javascript"}}],"id":"5a571154-f93d-4e4f-b6bc-981e572eae42","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Jana Rippin IV","type":"text","disabled":true},{"key":"email","value":"{{$randomUserEmail}}","type":"text"},{"key":"password","value":"{{$randomUserPassword}}","type":"text"},{"key":"title","value":"Mr","type":"text"},{"key":"birth_date","value":"{{randomDay}}","type":"text","disabled":true},{"key":"birth_month","value":"May","type":"text","disabled":true},{"key":"birth_year","value":"{{randomYear}}","type":"text","disabled":true},{"key":"firstname","value":"Luisa","type":"text","disabled":true},{"key":"lastname","value":"Romaguera","type":"text","disabled":true},{"key":"company","value":"Konopelski - Mitchell","type":"text"},{"key":"address1","value":"7182 Abby Roads","type":"text"},{"key":"address2","value":"","type":"text"},{"key":"country","value":"Montenegro","type":"text","disabled":true},{"key":"zipcode","value":"PF","type":"text","disabled":true},{"key":"state","value":"Test State","type":"text"},{"key":"city","value":"Porterville","type":"text"},{"key":"mobile_number","value":"69-918-471-9355","type":"text","disabled":true}]},"url":"https://automationexercise.com/api/updateAccount","urlObject":{"path":["updateAccount"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"5a571154-f93d-4e4f-b6bc-981e572eae42"},{"name":"GET user account detail by email","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is application/json\", function () {","  pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","","","pm.test(\"Response code should exist and be a number\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.responseCode).to.exist.and.to.be.a('number');","});","","","pm.test(\"Message field in the response should exist\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.exist;","});","","","pm.test(\"Ensure response does not contain sensitive information\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.not.have.property('password');","    pm.expect(responseData).to.not.have.property('creditCardNumber');","    pm.expect(responseData).to.not.have.property('ssn');","});"],"type":"text/javascript"}}],"id":"8df6c0c1-3b17-4748-87a8-92cf394f4a22","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"formdata","formdata":[{"key":"email","value":"{{$randomUserEmail}}","type":"text"}]},"url":"https://automationexercise.com/api/getUserDetailByEmail","urlObject":{"path":["getUserDetailByEmail"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"8df6c0c1-3b17-4748-87a8-92cf394f4a22"},{"name":"POST To Verify Login with valid details","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"Response code should exist and be a number\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.responseCode).to.exist;","    pm.expect(responseData.responseCode).to.be.a('number');","});","","","pm.test(\"Message is a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Message should not be empty\");","});"],"type":"text/javascript"}}],"id":"60c46259-5f3b-4fb1-804d-6128ff06c920","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"email","value":"{{$randomUserEmail}}","type":"text"},{"key":"password","value":"{{$randomUserPassword}}","type":"text"}]},"url":"https://automationexercise.com/api/verifyLogin","urlObject":{"path":["verifyLogin"],"host":["https://automationexercise.com/api"],"query":[{"disabled":true,"key":"email","value":"YOUR_EMAIL"},{"disabled":true,"key":"password","value":"YOUR_PASSWORD"}],"variable":[]}},"response":[],"_postman_id":"60c46259-5f3b-4fb1-804d-6128ff06c920"},{"name":"POST To Verify Login without email parameter","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Response has the required fields - responseCode and message\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('responseCode');","    pm.expect(responseData).to.have.property('message');","});","","","pm.test(\"Content-Type header is set to text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"ResponseCode is a non-negative integer\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.responseCode).to.be.a('number').and.to.satisfy((code) => code >= 0, \"ResponseCode should be a non-negative integer\");","});","","","pm.test(\"Message is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Message should not be empty\");","});"],"type":"text/javascript"}}],"id":"0263c994-f017-4878-808b-2031ba4112e6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"password","value":"{{$randomUserPassword}}","type":"text"}]},"url":"https://automationexercise.com/api/verifyLogin","urlObject":{"path":["verifyLogin"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"0263c994-f017-4878-808b-2031ba4112e6"},{"name":"DELETE To Verify Login","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type is text/html\", function () {","    pm.expect(pm.response.headers.get('Content-Type')).to.include('text/html');","});","","","pm.test(\"Response has the required fields - responseCode and message\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('responseCode');","    pm.expect(responseData).to.have.property('message');","});","","","pm.test(\"Response code is a non-negative integer\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.responseCode).to.be.a('number');","    pm.expect(responseData.responseCode).to.be.at.least(0);","});","","","pm.test(\"Message is a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Value should not be empty\");","});"],"type":"text/javascript"}}],"id":"affa6969-b9b0-47e2-bc59-4d7c2975c54f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[{"key":"email","value":"{{$randomUserEmail}}","type":"text"},{"key":"password","value":"{{$randomUserPassword}}","type":"text"}]},"url":"https://automationexercise.com/api/verifyLogin","urlObject":{"path":["verifyLogin"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"affa6969-b9b0-47e2-bc59-4d7c2975c54f"},{"name":"POST To Verify Login with invalid details","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type header is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"Response has the required fields - responseCode and message\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('responseCode');","    pm.expect(responseData).to.have.property('message');","});","","","pm.test(\"ResponseCode is of type number\", function () {","  const responseData = pm.response.json();","  pm.expect(responseData.responseCode).to.be.a('number');","});","","","pm.test(\"Message is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Message should not be empty\");","});"],"type":"text/javascript"}}],"id":"791bfcec-d33d-4850-8a82-4e3d65a76c72","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"email","value":"Hal_Trantow@gmail.com","type":"text"},{"key":"password","value":"7a8IsBENluWmGTb","type":"text"}]},"url":"https://automationexercise.com/api/verifyLogin","urlObject":{"path":["verifyLogin"],"host":["https://automationexercise.com/api"],"query":[],"variable":[]}},"response":[],"_postman_id":"791bfcec-d33d-4850-8a82-4e3d65a76c72"},{"name":"DELETE METHOD To Delete User Account","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type is text/html\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"text/html\");","});","","","pm.test(\"ResponseCode field exists and is not null\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.have.property('responseCode').that.is.not.null;","});","","","pm.test(\"Message field in the JSON should exist\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.exist;","});","","","pm.test(\"Verify that the response message is empty\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.be.empty;","});"],"type":"text/javascript"}}],"id":"f41804a6-423c-4885-a553-cbeed70c93f1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[{"key":"email","value":"{{$randomUserEmail}}","type":"text"},{"key":"password","value":"{{$randomUserPassword}}","type":"text"}]},"url":"https://automationexercise.com/api/deleteAccount","urlObject":{"path":["deleteAccount"],"host":["https://automationexercise.com/api"],"query":[{"disabled":true,"key":"email","value":"{{$randomUserEmail}}"},{"disabled":true,"key":"password","value":"{{$randomUserPassword}}"}],"variable":[]}},"response":[],"_postman_id":"f41804a6-423c-4885-a553-cbeed70c93f1"}],"event":[{"listen":"prerequest","script":{"id":"6f9e7b73-1f88-4d58-84e4-1c2ff6be57e1","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"c9c4768d-82c1-43b6-a431-26158553b48d","type":"text/javascript","packages":{},"exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://automationexercise.com/api"},{"key":"userEmail","value":"YOUR_EMAIL","type":"string"},{"key":"userPassword","value":"YOUR_PASSWORD","type":"string"}]}