From 18a9102b3a471a0b5b1068e3c2d407e3a2f383af Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 31 Jul 2019 08:07:55 +0000 Subject: [PATCH] Add test scripts request job order, get estimate, get ongoing job orders, and get rider status for APIController. #229 --- ...I - API Controller.postman_collection.json | 500 +++++++++++++++++- 1 file changed, 473 insertions(+), 27 deletions(-) diff --git a/postman/Resq Mobile API - API Controller.postman_collection.json b/postman/Resq Mobile API - API Controller.postman_collection.json index df7c89e4..9f49efda 100755 --- a/postman/Resq Mobile API - API Controller.postman_collection.json +++ b/postman/Resq Mobile API - API Controller.postman_collection.json @@ -174,6 +174,59 @@ }, "response": [] }, + { + "name": "[Normal] Validate Code", + "event": [ + { + "listen": "test", + "script": { + "id": "11118347-c2fd-466d-800c-82714070afab", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Validate Code\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.error.status).to.eql(\"success\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "code", + "value": "{{code}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{resq_url}}/api/code_validate?api_key={{api_key}}", + "host": [ + "{{resq_url}}" + ], + "path": [ + "api", + "code_validate" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } + ] + } + }, + "response": [] + }, { "name": "[Normal] Get Status", "event": [ @@ -189,7 +242,7 @@ "pm.test(\"Status of mobile session\", function () {", " var jsonData = pm.response.json();", " pm.expect(jsonData.error.status).to.eql(\"success\");", - " pm.expect(jsonData.data.status).to.eql(\"unconfirmed\");", + " pm.expect(jsonData.data.status).to.eql(\"confirmed\");", "});" ], "type": "text/javascript" @@ -746,6 +799,28 @@ }, { "name": "[Normal] Request Job Order", + "event": [ + { + "listen": "test", + "script": { + "id": "004a6b74-d182-45c9-aaca-26eac31ef663", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Request job order\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.error.status).to.eql(\"success\");", + " pm.expect(jsonData.data.jo_id).to.eql(1);", + " pm.expect(jsonData.data.invoice.items[0].title).to.eql(\"GOLD DIN77\");", + " pm.expect(jsonData.data.invoice.items[0].qty).to.eql(1);", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [], @@ -754,7 +829,7 @@ "formdata": [ { "key": "service_type", - "value": "", + "value": "{{service_type}}", "type": "text" }, { @@ -764,39 +839,337 @@ }, { "key": "trade_in", - "value": "", + "value": "{{trade_in}}", "type": "text" }, { "key": "long", - "value": "", + "value": "{{longitude}}", "type": "text" }, { "key": "lat", - "value": "", + "value": "{{latitude}}", "type": "text" }, { "key": "warranty", - "value": "", + "value": "{{warranty}}", "type": "text" }, { "key": "mode_of_payment", - "value": "", + "value": "{{mode_of_payment}}", + "type": "text" + }, + { + "key": "delivery_address", + "value": "{{delivery_address}}", + "type": "text" + }, + { + "key": "delivery_instructions", + "value": "{{delivery_instructions}}", + "type": "text" + }, + { + "key": "promo_id", + "value": "{{promo_id}}", + "type": "text" + }, + { + "key": "batt_id", + "value": "{{batt_id}}", "type": "text" } ] }, "url": { - "raw": "{{resq_url}}/api/job_order", + "raw": "{{resq_url}}/api/job_order?api_key={{api_key}}", "host": [ "{{resq_url}}" ], "path": [ "api", "job_order" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } + ] + } + }, + "response": [] + }, + { + "name": "[Normal] Get Estimate", + "event": [ + { + "listen": "test", + "script": { + "id": "e1573c58-a141-4d97-8812-c1b50f261f32", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Your test name\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.error.status).to.eql(\"success\");", + " pm.expect(jsonData.data.total_price).to.eql(8014.29);", + " pm.expect(jsonData.data.items[0].title).to.eql(\"GOLD DIN77\");", + " pm.expect(jsonData.data.items[0].qty).to.eql(1);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "service_type", + "value": "{{service_type}}", + "type": "text" + }, + { + "key": "cv_id", + "value": "{{cv_id}}", + "type": "text" + }, + { + "key": "trade_in", + "value": "{{trade_in}}", + "type": "text" + }, + { + "key": "promo_id", + "value": "{{promo_id}}", + "type": "text" + }, + { + "key": "batt_id", + "value": "{{batt_id}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{resq_url}}/api/estimate?api_key={{api_key}}", + "host": [ + "{{resq_url}}" + ], + "path": [ + "api", + "estimate" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } + ] + } + }, + "response": [] + }, + { + "name": "[Normal] GetOngoing Job Order", + "event": [ + { + "listen": "test", + "script": { + "id": "7a7496f9-8ec7-4912-9887-55fda6e7c1c3", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Get ongoing job orders\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.error.status).to.eql(\"success\");", + " pm.expect(jsonData.data.has_ongoing).to.eql(true);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{resq_url}}/api/job_order/ongoing?api_key={{api_key}}", + "host": [ + "{{resq_url}}" + ], + "path": [ + "api", + "job_order", + "ongoing" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } + ] + } + }, + "response": [] + }, + { + "name": "[Normal] Get Rider Status", + "event": [ + { + "listen": "test", + "script": { + "id": "f12508f6-cd9f-443b-ae56-835d4e913e55", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Get rider status\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.error.status).to.eql(\"success\");", + " pm.expect(jsonData.data.service_type).to.eql(\"battery_new\");", + " pm.expect(jsonData.data.status).to.eql(\"outlet_assign\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{resq_url}}/api/rider?api_key={{api_key}}", + "host": [ + "{{resq_url}}" + ], + "path": [ + "api", + "rider" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } + ] + } + }, + "response": [] + }, + { + "name": "[Normal] Privacy Settings", + "event": [ + { + "listen": "test", + "script": { + "id": "080cb4ae-2e6a-4c41-a1a1-1f5993fb1703", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Privacy settings\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.error.status).to.eql(\"success\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "priv_third_party", + "value": "true", + "type": "text" + } + ] + }, + "url": { + "raw": "{{resq_url}}/api/privacy?api_key={{api_key}}", + "host": [ + "{{resq_url}}" + ], + "path": [ + "api", + "privacy" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } + ] + } + }, + "response": [] + }, + { + "name": "[Normal] Activate Warranty", + "event": [ + { + "listen": "test", + "script": { + "id": "4644fedd-befd-4d63-bf49-118ae368e690", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "//pm.test(\"Activate warranty\", function () {", + "// var jsonData = pm.response.json();", + "// pm.expect(jsonData.error.status).to.eql(\"success\");", + "//});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "plate_number", + "value": "{{plate_num}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{resq_url}}/api/activate_warranty?api_key={{api_key}}", + "host": [ + "{{resq_url}}" + ], + "path": [ + "api", + "activate_warranty" + ], + "query": [ + { + "key": "api_key", + "value": "{{api_key}}" + } ] } }, @@ -827,112 +1200,185 @@ ], "variable": [ { - "id": "ccac43fa-6d1e-49f2-b045-3e80c6d3934f", + "id": "ea71567b-5072-4022-ae8c-7562c32175b0", "key": "resq_url", "value": "resq.local", - "type": "string" + "type": "string", + "disabled": true }, { - "id": "acc8f492-7460-41b4-911c-d12826ef2017", + "id": "ba3077c6-779c-433f-902d-32e9a7c559a8", "key": "phone_model", "value": "iPhone8", "type": "string" }, { - "id": "43440cfe-0330-4254-a1e0-be0e7f054e1d", + "id": "9043af9b-f151-413e-94ea-b19c46354eac", "key": "os_type", "value": "IOS", "type": "string" }, { - "id": "8b0e4ffb-a6d0-45fd-bae0-2869b3a9a417", + "id": "a0b258b2-fdd2-479c-b916-7199abb2b2c1", "key": "os_version", "value": "11.4", "type": "string" }, { - "id": "4a6ebdda-c7b6-4f15-8b85-2afbfd7cab7d", + "id": "fe723a21-2354-4bcb-8e10-df741698509d", "key": "phone_id", "value": "11376660-F8BF-46ED-B30A-EF3F361EE223", "type": "string" }, { - "id": "6ce89a29-4591-41da-b4f0-2945c9ca1f2d", + "id": "98b503d1-057c-497b-9257-9b9e6fbb3c2e", "key": "phone_number", "value": "9221111111", "type": "string" }, { - "id": "d0c15f43-5b04-47f4-b26f-9b05e7c58c64", + "id": "e972a8ab-5201-486f-a7af-21ce3782fe78", "key": "first_name", "value": "Stiltzkin", "type": "string" }, { - "id": "3d44e913-b45d-4aaf-9c52-a13e8284a26a", + "id": "a0d00c69-e031-47ed-8dfe-d948c5ad2188", "key": "last_name", "value": "Moogle", "type": "string" }, { - "id": "c1a8a58a-e36c-4008-b3cb-be03e2c875fe", + "id": "01fa3dfd-8395-4f21-a883-9d5d75b5689c", "key": "mfg_id", "value": "1435", "type": "string" }, { - "id": "3e6a8c18-a095-4a9d-a230-fda30e649801", + "id": "f4fdee45-3e31-46b7-9ca3-2b6f29827e9e", "key": "make_id", "value": "22043", "type": "string" }, { - "id": "ab6c0e13-73e7-4191-94da-178569ed080c", + "id": "f9504219-f9bd-491a-926e-840a27962838", "key": "name", "value": "Beetle 1.2 TSI MT (Gas)", "type": "string" }, { - "id": "9bd4e6b2-f45e-4e25-a4fa-73c69475d2a1", + "id": "fc0514cd-871b-468e-9ab2-12942440ed91", "key": "plate_num", "value": "MGL1234", "type": "string" }, { - "id": "aeb30eac-85c6-42c9-940a-dfa07b17484a", + "id": "34a9c77a-0d2e-4444-93e6-b67945900dd8", "key": "model_year", "value": "2016", "type": "string" }, { - "id": "e58b31b5-f3ca-4d1d-bc4f-272904013a9f", + "id": "5eb2ca76-119c-4acc-8179-a958e6bc38a7", "key": "color", "value": "White", "type": "string" }, { - "id": "adaaae50-3591-4fb6-b9d0-d92b4b40dda2", + "id": "e9fabf98-8ac4-4670-a9f8-afde589d1910", "key": "condition", "value": "Brand New", "type": "string" }, { - "id": "23d8e583-0b00-4644-98f4-c9ce3307d312", + "id": "efd5911d-234a-42c8-9288-35b4f7e49d1c", "key": "fuel_type", "value": "Gas", "type": "string" }, { - "id": "0a9ab79f-75f3-46c2-829d-bb437f656cd5", + "id": "db9aede9-4365-4245-8d8c-2f917a306107", "key": "wty_code", "value": "MKUP0123456", "type": "string" }, { - "id": "167fbcaa-0dd1-4b34-aff7-df5c009d8b06", + "id": "77ca86d0-da17-4c35-898b-ce44a4f7f7cb", "key": "wty_expire", "value": "20201125", "type": "string" + }, + { + "id": "14a33e08-f033-413a-910c-6c780a5f9718", + "key": "service_type", + "value": "battery_new", + "type": "string" + }, + { + "id": "85e49d9f-ac6e-4cc1-9584-8e3a635a39a6", + "key": "trade_in", + "value": "MOTOLITE", + "type": "string" + }, + { + "id": "b05d017c-3634-4066-ba3f-db0328089593", + "key": "longitude", + "value": "121.018039", + "type": "string" + }, + { + "id": "8ac1e199-a2be-4a0f-8f8c-0bf3fa3361c6", + "key": "latitude", + "value": "14.606807", + "type": "string" + }, + { + "id": "5d1c918b-1e3d-4f86-999d-58788721898a", + "key": "warranty", + "value": "private", + "type": "string" + }, + { + "id": "1b5c2a8d-476f-4b16-9130-2e07d50cdd5f", + "key": "mode_of_payment", + "value": "CASH", + "type": "string" + }, + { + "id": "0dd2f37c-0bb5-4568-8c54-5998bf4e0cbd", + "key": "delivery_address", + "value": "#123 Moogle Drive", + "type": "string" + }, + { + "id": "b263ffe8-fa79-43fd-83c9-49117846c257", + "key": "delivery_instructions", + "value": "Look for the red bon-bon", + "type": "string" + }, + { + "id": "158cee53-072b-4cce-80cb-d7d92cb9aec2", + "key": "promo_id", + "value": "1", + "type": "string" + }, + { + "id": "85ff573c-d513-48d7-b37a-2869d5a956a8", + "key": "code", + "value": "123456", + "type": "string" + }, + { + "id": "0dfcab3a-08d3-4a91-99dc-b565475e667b", + "key": "batt_id", + "value": "1050", + "type": "string" + }, + { + "id": "a80f34f5-0dde-43b2-afa9-eff05801a611", + "key": "cv_id", + "value": "2", + "type": "string" } ] } \ No newline at end of file