Add tests for partners, services, warranty activation, and location support. #229

This commit is contained in:
Korina Cordero 2019-08-13 03:26:11 +00:00
parent 72a1a53c0a
commit dc5bf07c19
2 changed files with 545 additions and 44 deletions

View file

@ -1235,6 +1235,168 @@
},
"response": []
},
{
"name": "[Normal] Get JO History",
"event": [
{
"listen": "test",
"script": {
"id": "bd898f60-4188-4063-903b-e802e195e97e",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Get job order history\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
" pm.expect(jsonData.data.job_orders[0].id).to.eql(3);",
" pm.expect(jsonData.data.job_orders[0].customer_vehicle.plate_number).to.eql(\"MOG1234\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{resq_url}}/api/job_order/history?api_key={{preset_api_key}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"job_order",
"history"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Get JO Invoice",
"event": [
{
"listen": "test",
"script": {
"id": "f6aec690-14a8-4c12-940d-242547577f2f",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Get job order invoice\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
" pm.expect(jsonData.data.items[0].title).to.eql(\"GOLD 1SM / D23 /NS50 / R\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "jo_id",
"value": "{{jo_id_for_cancel_jo}}",
"type": "text",
"disabled": true
}
]
},
"url": {
"raw": "{{resq_url}}/api/job_order/invoice?api_key={{preset_api_key}}&jo_id={{jo_id_for_cancel_jo}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"job_order",
"invoice"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
},
{
"key": "jo_id",
"value": "{{jo_id_for_cancel_jo}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Update Device ID",
"event": [
{
"listen": "test",
"script": {
"id": "f412a2f4-4409-4928-9c4a-c62f9d1b7533",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Update device ID\", 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": "device_id",
"value": "{{device_id}}",
"type": "text"
}
]
},
"url": {
"raw": "{{resq_url}}/api/device_id?api_key={{preset_api_key}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"device_id"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Privacy Settings",
"event": [
@ -1288,6 +1450,101 @@
},
"response": []
},
{
"name": "[Normal] Resend Code",
"event": [
{
"listen": "test",
"script": {
"id": "bfa9f9d2-9ae6-4978-bd67-b7317a22cbf1",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Resend code\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{resq_url}}/api/resend_code?api_key={{preset_api_key_unconfirmed}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"resend_code"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key_unconfirmed}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Location Support",
"event": [
{
"listen": "test",
"script": {
"id": "538d8939-f19a-49c7-a4b4-3b06cfd5676b",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Location support\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
" pm.expect(jsonData.data.supported).to.eql(true);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{resq_url}}/api/location_support?api_key={{preset_api_key}}&longitude={{longitude}}&latitude={{latitude}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"location_support"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
},
{
"key": "longitude",
"value": "{{longitude}}"
},
{
"key": "latitude",
"value": "{{latitude}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Activate Warranty",
"event": [
@ -1300,10 +1557,10 @@
" pm.response.to.have.status(200);",
"});",
"",
"//pm.test(\"Activate warranty\", function () {",
"// var jsonData = pm.response.json();",
"// pm.expect(jsonData.error.status).to.eql(\"success\");",
"//});"
"pm.test(\"Activate warranty\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
"});"
],
"type": "text/javascript"
}
@ -1323,7 +1580,7 @@
]
},
"url": {
"raw": "{{resq_url}}/api/activate_warranty?api_key={{api_key}}",
"raw": "{{resq_url}}/api/activate_warranty?api_key={{preset_api_key}}",
"host": [
"{{resq_url}}"
],
@ -1334,7 +1591,217 @@
"query": [
{
"key": "api_key",
"value": "{{api_key}}"
"value": "{{preset_api_key}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] List Services",
"event": [
{
"listen": "test",
"script": {
"id": "68ade044-b9d3-4425-a8b4-16674778f6dc",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"List of services is present\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
" pm.expect(jsonData.data.services.length).to.be.gt(0);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{resq_url}}/api/services?api_key={{preset_api_key}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"services"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Get partner information",
"event": [
{
"listen": "test",
"script": {
"id": "6c3ba8c3-f0ae-40ab-a884-cd540d592653",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Get partner information and reviews\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
" pm.expect(jsonData.data.partner).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{resq_url}}/api/partners/{{partner_id}}?api_key={{preset_api_key}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"partners",
"{{partner_id}}"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
}
]
},
"description": "Get partner details and reviews"
},
"response": []
},
{
"name": "[Normal] Get list of closest partners",
"event": [
{
"listen": "test",
"script": {
"id": "94823df8-bf4f-42a9-843f-e7b1c5ceda29",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"List of partners is present\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.error.status).to.eql(\"success\");",
" pm.expect(jsonData.data.partners.length).to.be.gt(0);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{resq_url}}/api/partners?api_key={{preset_api_key}}&longitude={{longitude}}&latitude={{latitude}}&limit={{limit}}&service_id={{service_id}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"partners"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
},
{
"key": "longitude",
"value": "{{longitude}}"
},
{
"key": "latitude",
"value": "{{latitude}}"
},
{
"key": "limit",
"value": "{{limit}}"
},
{
"key": "service_id",
"value": "{{service_id}}"
}
]
}
},
"response": []
},
{
"name": "[Normal] Review Partner",
"event": [
{
"listen": "test",
"script": {
"id": "26cdf169-7282-4ceb-9ab5-237e70dfb70d",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Review partnert\", 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": "rating",
"value": "{{rating}}",
"type": "text"
},
{
"key": "message",
"value": "{{comment}}",
"type": "text"
}
]
},
"url": {
"raw": "{{resq_url}}/api/partners/{{partner_id}}/review?api_key={{preset_api_key}}",
"host": [
"{{resq_url}}"
],
"path": [
"api",
"partners",
"{{partner_id}}",
"review"
],
"query": [
{
"key": "api_key",
"value": "{{preset_api_key}}"
}
]
}
@ -1366,215 +1833,245 @@
],
"variable": [
{
"id": "5d93f375-0011-406c-a88f-a63e2f68488c",
"id": "8d2330fb-5db8-46f6-b179-9b587b7ffdae",
"key": "resq_url",
"value": "resq.local",
"type": "string",
"disabled": true
},
{
"id": "c5ab2ec9-5fa1-42c0-9b59-a5f39c341c93",
"id": "85913ee7-5c59-4194-b63a-10a2d67e7e13",
"key": "phone_model",
"value": "iPhone8",
"type": "string"
},
{
"id": "3a5bc033-4298-41f2-a2a6-723af86e8941",
"id": "9db4816f-5b02-41ac-a517-ea7313349e2f",
"key": "os_type",
"value": "IOS",
"type": "string"
},
{
"id": "1100e110-9b61-4e86-9e5b-0d2b9ce1d459",
"id": "92eabed4-7c39-4cf8-bb8b-3f2422e28a88",
"key": "os_version",
"value": "11.4",
"type": "string"
},
{
"id": "1e79c0c3-a365-48bf-b279-8082e49ab690",
"id": "37fe6cd6-f03f-41e4-be90-dd0130884458",
"key": "phone_id",
"value": "11376660-F8BF-46ED-B30A-EF3F361EE223",
"type": "string"
},
{
"id": "72e74248-809b-46d5-a7f8-19132e90ebd4",
"id": "41b56804-7a1e-422e-888c-998eeca61af2",
"key": "phone_number",
"value": "9221111111",
"type": "string"
},
{
"id": "a9ed9e37-8497-4a6e-885c-e6bc7b90d0a2",
"id": "5613ed18-d7bc-42a2-9052-59ce6cf18384",
"key": "first_name",
"value": "Stiltzkin",
"type": "string"
},
{
"id": "99f734c3-1b7f-4c38-b1fd-33add5c21e90",
"id": "5d2ed826-cd18-4dea-b175-6fbc444f50d1",
"key": "last_name",
"value": "Moogle",
"type": "string"
},
{
"id": "c4a4859a-fd69-42ac-b6f1-9b745b2e7e1e",
"id": "d33dfddc-44c0-4e85-983d-9b0916021bcc",
"key": "mfg_id",
"value": "1435",
"type": "string"
},
{
"id": "f6eaa575-52c9-43be-8d1a-e2b6d82155fd",
"id": "8756da11-2452-4382-bee9-d87a2917c5c0",
"key": "make_id",
"value": "22043",
"type": "string"
},
{
"id": "2abf6bbb-35e3-48bf-98b2-c935fa22f809",
"id": "062322be-b65a-4a7d-9069-14d5b9e08691",
"key": "name",
"value": "Beetle 1.2 TSI MT (Gas)",
"type": "string"
},
{
"id": "974d51f3-7de7-4601-aedf-8118534760fd",
"id": "7ffa69c3-0c9b-424e-9d51-16b246843dd5",
"key": "plate_num",
"value": "MGL1234",
"type": "string"
},
{
"id": "302e37a0-de56-4dbb-b04d-51e6cc6ceb67",
"id": "24c12bf8-25e9-4487-bbc9-f1f78e9885f0",
"key": "model_year",
"value": "2016",
"type": "string"
},
{
"id": "c2bd2449-d853-4834-8610-2a50e7a2f44b",
"id": "aeaa3842-7788-4978-a9ff-5aa06cd4208e",
"key": "color",
"value": "White",
"type": "string"
},
{
"id": "5e1c7cf7-6c2d-4ccb-a7c7-a57fd9f28cba",
"id": "7a1d5798-256b-4f58-a901-e0f4d590b791",
"key": "condition",
"value": "Brand New",
"type": "string"
},
{
"id": "a5f72792-689d-4cf3-889a-57389ce61e10",
"id": "37cc3206-05f8-41cb-bfda-7b31b3ac0f1f",
"key": "fuel_type",
"value": "Gas",
"type": "string"
},
{
"id": "ad681bc9-dfb5-4c20-8df0-8be64917b87b",
"id": "c1c743a5-8795-45ad-9fc3-6b4a3a685b1a",
"key": "wty_code",
"value": "MKUP0123456",
"type": "string"
},
{
"id": "b36813a5-50a8-42da-be7a-6a393b7c4029",
"id": "546efeb7-b0b1-49d6-baed-2bb0d81e6db4",
"key": "wty_expire",
"value": "20201125",
"type": "string"
},
{
"id": "e2492bad-83af-4c36-b718-e735c615acf5",
"id": "f593c5e2-a408-453d-ae48-31eb0ac94d2b",
"key": "service_type",
"value": "battery_new",
"type": "string"
},
{
"id": "543637fd-dba2-47c7-ad57-17e7514c46e6",
"id": "ccbd96fb-d538-41c6-aa98-fbd30db888df",
"key": "trade_in",
"value": "MOTOLITE",
"type": "string"
},
{
"id": "4ccd2182-6d87-4293-a471-ec4ea3a36230",
"id": "a12f7829-c214-405a-8966-42886a6c01cf",
"key": "longitude",
"value": "121.018039",
"type": "string"
},
{
"id": "1af5abab-b961-4123-8ff2-8b6bfd26b64a",
"id": "03e74d4e-84b5-486c-a345-c6912c3b634d",
"key": "latitude",
"value": "14.606807",
"type": "string"
},
{
"id": "339b4adb-35ea-4a62-9c18-5e0b4d510dba",
"id": "ccc96e0c-20ed-487a-93d4-f587d5868396",
"key": "warranty",
"value": "private",
"type": "string"
},
{
"id": "3011207b-0efe-4990-bf1a-07ac93f0d997",
"id": "1a06bec2-ccff-470b-87c6-976c5fd45e46",
"key": "mode_of_payment",
"value": "CASH",
"type": "string"
},
{
"id": "906c85a0-d63c-49be-9bad-95a5c3995efa",
"id": "e0f7a8aa-8641-4be4-b835-9d4e22bc9f66",
"key": "delivery_address",
"value": "#123 Moogle Drive",
"type": "string"
},
{
"id": "9d8631f3-6f4a-4617-b9c6-a891dbdb7080",
"id": "07b61f80-1944-49e8-9fb1-ba53e138eed6",
"key": "delivery_instructions",
"value": "Look for the red bon-bon",
"type": "string"
},
{
"id": "817cba3e-5a1c-4437-a3a1-a435fb6e2102",
"id": "49422a74-4683-4fad-80f3-fad0fe7c1674",
"key": "promo_id",
"value": "1",
"type": "string"
},
{
"id": "830e5413-aede-49d5-96d6-9f9ffd69d362",
"id": "6f778734-29ec-47d3-b8c0-dc56c403408c",
"key": "code",
"value": "123456",
"type": "string"
},
{
"id": "5c63ff91-5a46-46a6-bb50-a99fcf9c2469",
"id": "4f5e4acf-511e-43e7-96aa-1bb8f92a60e3",
"key": "batt_id",
"value": "1050",
"type": "string"
},
{
"id": "df43d18c-da1e-4d1e-a39e-ff497e1e3ade",
"id": "c43b9981-550a-40b6-b3a6-28007f8bb8a8",
"key": "jo_id_for_rider_rating",
"value": "4",
"type": "string"
},
{
"id": "ba2bfbc9-4177-46c9-9bba-a99fa4cf6800",
"id": "436646d7-8233-493d-aada-241fe92085a8",
"key": "preset_api_key",
"value": "5d427428b1541",
"type": "string"
},
{
"id": "35e07ec1-e1ac-42ba-94cb-284fac688eeb",
"id": "65fcc401-ba87-4a22-be52-9cf1c7e1ffa5",
"key": "rating",
"value": "4",
"type": "string"
},
{
"id": "ab22b498-e2ae-4148-954f-6d3b42e2a8bc",
"id": "d50b735d-29e3-48aa-8391-af2cc638a600",
"key": "comment",
"value": "Very professional, kupo!",
"type": "string"
},
{
"id": "4e7ec753-ab40-4814-8e54-2808a82659f0",
"id": "e5790ffa-d2aa-4210-936c-9cbcddec4e87",
"key": "jo_id_for_cancel_jo",
"value": "3",
"type": "string"
},
{
"id": "be480a65-6da0-48e3-b388-7545d237a123",
"id": "d5a7f058-4e54-47ac-b60b-d3595618adb1",
"key": "cancel_reason",
"value": "No money, kupo!",
"type": "string"
},
{
"id": "ca9ad85f-5809-42aa-afcd-89008810e6b2",
"key": "device_id",
"value": "123456",
"type": "string"
},
{
"id": "6b7f078a-e509-4fb9-b99d-91c48cb26718",
"key": "partner_id",
"value": "1",
"type": "string"
},
{
"id": "98abae1f-9ca4-4041-95d3-62c659fc11b7",
"key": "preset_api_key_unconfirmed",
"value": "5d439b3a43f40",
"type": "string"
},
{
"id": "37bddaba-3933-4895-adf9-8b2b1be68d48",
"key": "service_id",
"value": "2",
"type": "string"
},
{
"id": "94e86dc8-2237-41b1-8fdc-8da7e1ac8331",
"key": "limit",
"value": "5",
"type": "string"
}
]
}

File diff suppressed because one or more lines are too long