Commit bfd12210 by Lee Daehyun

テストコード脱退テスト、メッセージ作成テスト、ルーム作成テスト

parent 47c9a8e9
{
"info": {
"_postman_id": "f558c7b6-5cd6-4100-acc1-5103957b29f2",
"name": "AbookCheck_communication",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "COMMUNICATION_API構造",
"item": [
{
"name": "AppStoreNewLoginAction\"api_test1\"",
"event": [
{
"listen": "test",
"script": {
"id": "42eed0cf-da5a-4deb-980a-35f1164bbf57",
"exec": [
"var sid = pm.response.json().sid;\r",
"pm.globals.set(\"sid\",sid);"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "3a0ede3a-2473-4577-b99e-a598ab388241",
"exec": [
"pm.globals.set(\"JOIN\",\"1\");\r",
"pm.globals.set(\"JOINROOM\",\"2\");\r",
"pm.globals.set(\"INVITEUSERS\",\"3\");\r",
"pm.globals.set(\"GETGROUPLIST\",\"4\");\r",
"pm.globals.set(\"GETUSERLISTINGROUP\",\"5\");\r",
"\r",
"pm.globals.set(\"getRoomList\",\"1\");\r",
"pm.globals.set(\"createNewRoom\",\"2\");\r",
"pm.globals.set(\"exitRoom\",\"3\");\r",
"pm.globals.set(\"disconnect\",\"4\");\r",
"\r",
"pm.globals.set(\"createMessage\",\"1\");\r",
"pm.globals.set(\"getMessages\",\"2\");\r",
"pm.globals.set(\"roomSearch\",\"3\");\r",
"\r",
"pm.globals.set(\"getPushMessage\",\"1\");\r",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"user-agent": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"type": "text",
"value": "Android"
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/nuabvapi/appStoreNewLogin?appId=3&appVersion=1.2.360&deviceToken=dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc&deviceTypeId=3&language=en&loginId=api_test1&ma&password=111111&uid=578529ca22cab829.androidid&urlPath=fermi",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"nuabvapi",
"appStoreNewLogin"
],
"query": [
{
"key": "appId",
"value": "3"
},
{
"key": "appVersion",
"value": "1.2.360"
},
{
"key": "deviceToken",
"value": "dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc"
},
{
"key": "deviceTypeId",
"value": "3"
},
{
"key": "language",
"value": "en"
},
{
"key": "loginId",
"value": "api_test1"
},
{
"key": "ma",
"value": null
},
{
"key": "password",
"value": "111111"
},
{
"key": "uid",
"value": "578529ca22cab829.androidid"
},
{
"key": "urlPath",
"value": "fermi"
}
]
}
},
"response": []
},
{
"name": "AppStoreNewLoginAction\"api_test5\"",
"event": [
{
"listen": "test",
"script": {
"id": "ce77a107-85ca-4f59-b733-f64c2b3af6a1",
"exec": [
"var sid = pm.response.json().sid;\r",
"pm.globals.set(\"sid\",sid);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"user-agent": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"value": "Android",
"type": "text"
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/nuabvapi/appStoreNewLogin?appId=3&appVersion=1.2.360&deviceToken=esSLc-NBwXc:APA91bFB13z_Zv7esMHAXwo5VvVZgETRLPqR4DvEyPtvCPNAw8ScCAfpiM53xos-PmOd98a-0eqvAN6rRIq1XaCBy64CXf-fQdNsW9yAE6F59RN57-l8Vk4utH1U0VPmIxWl3-0uw-er&deviceTypeId=3&language=en&loginId=api_test5&ma&password=111111&uid=3e40eb7cba223936.androidid&urlPath=fermi",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"nuabvapi",
"appStoreNewLogin"
],
"query": [
{
"key": "appId",
"value": "3"
},
{
"key": "appVersion",
"value": "1.2.360"
},
{
"key": "deviceToken",
"value": "esSLc-NBwXc:APA91bFB13z_Zv7esMHAXwo5VvVZgETRLPqR4DvEyPtvCPNAw8ScCAfpiM53xos-PmOd98a-0eqvAN6rRIq1XaCBy64CXf-fQdNsW9yAE6F59RN57-l8Vk4utH1U0VPmIxWl3-0uw-er"
},
{
"key": "deviceTypeId",
"value": "3"
},
{
"key": "language",
"value": "en"
},
{
"key": "loginId",
"value": "api_test5"
},
{
"key": "ma",
"value": null
},
{
"key": "password",
"value": "111111"
},
{
"key": "uid",
"value": "3e40eb7cba223936.androidid"
},
{
"key": "urlPath",
"value": "fermi"
}
]
}
},
"response": []
},
{
"name": "userAction",
"event": [
{
"listen": "test",
"script": {
"id": "41fb3c92-8196-422a-a12a-39e36a1f5216",
"exec": [
"//成功確認コード\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"switch(pm.globals.get(\"cmd\")){\r",
" //JOIN_TEST\r",
" case pm.globals.get(\"JOIN\") : \r",
" //ユーザー情報確認\r",
" pm.test(\"test userInfo\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.body.userInfo.shopMemberId).to.eq(935)\r",
" pm.expect(jsonData.body.userInfo.shopId).to.eq(59)\r",
" });\r",
"\r",
" //ルーム情報\r",
" pm.test(\"test chatRoomCount\", function () {\r",
" var jsonData = pm.response.json().body.chatRoomList;\r",
" pm.expect(jsonData.length).to.eq(3)\r",
" });\r",
"\r",
" pm.test(\"test roomInfo\",function(){\r",
" var jsonData = pm.response.json().body.chatRoomList; \r",
" for(var i = 0; i < jsonData.length; i++){\r",
" switch(i){\r",
" case 0 :\r",
" pm.expect(jsonData[i].roomId).to.eq(98);\r",
" pm.expect(jsonData[i].roomName).to.eq(\"chatRoom1\");\r",
" pm.expect(jsonData[i].message).to.eq(\"hello \");\r",
" pm.expect(jsonData[i].userCnt).to.eq(2);\r",
" break;\r",
"\r",
" case 1 :\r",
" pm.expect(jsonData[i].roomId).to.eq(100);\r",
" pm.expect(jsonData[i].roomName).to.eq(\"ChatRoom3\");\r",
" pm.expect(jsonData[i].message).to.eq(\"good morning \");\r",
" pm.expect(jsonData[i].userCnt).to.eq(3);\r",
" break;\r",
"\r",
" case 2 :\r",
" pm.expect(jsonData[i].roomId).to.eq(99);\r",
" pm.expect(jsonData[i].roomName).to.eq(\"ChatRoom2\");\r",
" pm.expect(jsonData[i].message).to.eq(\"こんにちは \");\r",
" pm.expect(jsonData[i].userCnt).to.eq(2);\r",
" break;\r",
" }\r",
" }\r",
" });\r",
" break;\r",
"\r",
"\r",
" //JOINROOM_TEST\r",
" case pm.globals.get(\"JOINROOM\") :\r",
" //以前ルームのユーザーloginId\r",
" pm.test(\"test userListBeforeExit\", function(){\r",
" var jsonData = pm.response.json();\r",
" var loginId = jsonData.body.userListBeforeExit;\r",
" \r",
" pm.expect(loginId.length).to.eq(2);\r",
" for(var i = 0; loginId.lenght; i ++){\r",
" switch(i){\r",
" case 0 : \r",
" pm.expect(loginId[i]).eq(\"api_test1\")\r",
" break;\r",
" case 1 : \r",
" pm.expect(loginId[i]).eq(\"api_test2\")\r",
" break;\r",
" }\r",
" }\r",
" })\r",
" //参加するルームのユーザーloginId\r",
" pm.test(\"test userListNewRoom\", function(){\r",
" var jsonData = pm.response.json();\r",
" var loginId = jsonData.body.userListNewRoom;\r",
" \r",
" pm.expect(loginId.length).to.eq(3);\r",
" for(var i = 0; loginId.lenght; i ++) {\r",
" switch(i) {\r",
" case 0 : \r",
" pm.expect(loginId[i]).eq(\"api_test1\")\r",
" break;\r",
" case 1 : \r",
" pm.expect(loginId[i]).eq(\"api_test2\")\r",
" break;\r",
" case 2 :\r",
" pm.expect(loginId[i]).eq(\"api_test3\")\r",
" }\r",
" }\r",
" })\r",
"\r",
" //メッセージリスト\r",
" pm.test(\"test messageList\", function(){\r",
" var jsonData = pm.response.json();\r",
" var message = jsonData.body.messageList;\r",
" pm.expect(message[0].messageId).to.eq(744)\r",
" pm.expect(message[0].message).to.eq(\"おはようございます!! \")\r",
" });\r",
" break;\r",
"\r",
" case pm.globals.get(\"INVITEUSERS\") :\r",
" break;\r",
" \r",
" //\r",
" case pm.globals.get(\"GETGROUPLIST\") :\r",
" pm.test(\"test groupList\", function(){\r",
" var jsonData = pm.response.json().body;\r",
" for(var i = 0; i < jsonData.groupList.length; i++){\r",
" switch(i){\r",
" case 0 :\r",
" pm.expect(jsonData.groupList[i].groupId).eq(1371);\r",
" pm.expect(jsonData.groupList[i].groupName).eq(\"全社\");\r",
" pm.expect(jsonData.groupList[i].memberCnt).eq(1);\r",
" break;\r",
" case 1 :\r",
" pm.expect(jsonData.groupList[i].groupId).eq(1372);\r",
" pm.expect(jsonData.groupList[i].groupName).eq(\"A\");\r",
" pm.expect(jsonData.groupList[i].memberCnt).eq(9);\r",
" break;\r",
" case 2 :\r",
" pm.expect(jsonData.groupList[i].groupId).eq(1373);\r",
" pm.expect(jsonData.groupList[i].groupName).eq(\"B\");\r",
" pm.expect(jsonData.groupList[i].memberCnt).eq(3);\r",
" break;\r",
" case 3 :\r",
" pm.expect(jsonData.groupList[i].groupId).eq(1374);\r",
" pm.expect(jsonData.groupList[i].groupName).eq(\"C\");\r",
" pm.expect(jsonData.groupList[i].memberCnt).eq(1);\r",
" break;\r",
" case 4 :\r",
" pm.expect(jsonData.groupList[i].groupId).eq(1408);\r",
" pm.expect(jsonData.groupList[i].groupName).eq(\"D\");\r",
" pm.expect(jsonData.groupList[i].memberCnt).eq(1);\r",
" break;\r",
" case 5 :\r",
" pm.expect(jsonData.groupList[i].groupId).eq(1410);\r",
" pm.expect(jsonData.groupList[i].groupName).eq(\"Bのサブ\");\r",
" pm.expect(jsonData.groupList[i].memberCnt).eq(1);\r",
" break;\r",
" }\r",
" break;\r",
" }\r",
" })\r",
" case pm.globals.get(\"GETUSERLISTINGROUP\") :\r",
" pm.test(\"test userInfoInGroup\",function() {\r",
" var jsonData = pm.response.json().body.groupUserList;\r",
" console.log(jsonData.length);\r",
" for (var i = 0; i < jsonData.length; i++) {\r",
" switch (i) {\r",
" case 0 :\r",
" pm.expect(jsonData[i].shopMemberId).eq(\"889\")\r",
" pm.expect(jsonData[i].loginId).eq(\"fermi5\")\r",
" //pm.expect(jsonData[i].timeStamp).eq(\"20201208105930\")\r",
" pm.expect(jsonData[i].groupName).eq(\"B\")\r",
" break; \r",
" case 1 :\r",
" pm.expect(jsonData[i].shopMemberId).eq(\"926\")\r",
" pm.expect(jsonData[i].loginId).eq(\"kim-p1\")\r",
" //pm.expect(jsonData[i].timeStamp).eq(0)\r",
" pm.expect(jsonData[i].groupName).eq(\"B\")\r",
" break;\r",
" case 2 :\r",
" pm.expect(jsonData[i].shopMemberId).eq(\"929\")\r",
" pm.expect(jsonData[i].loginId).eq(\"kimp1\")\r",
" //pm.expect(jsonData[i].timeStamp).eq(\"20201130162142\")\r",
" pm.expect(jsonData[i].groupName).eq(\"B\")\r",
" break;\r",
" }\r",
" }\r",
" });\r",
"\r",
" break;\r",
"}\r",
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "52a775f0-e5d4-4baa-a4e2-c590329d688d",
"exec": [
"pm.test(\"cmd\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" pm.globals.set(\"cmd\",map.get(\"cmd\"));\r",
"});\r",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"value": "Android",
"type": "text",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "javascript"
}
}
},
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?groupId=1373&sid={{sid}}&cmd=4&newRoomId=100",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "beforeRoomId",
"value": "99",
"disabled": true
},
{
"key": "loginIdList",
"value": null,
"disabled": true
},
{
"key": "groupId",
"value": "1373"
},
{
"key": "newRoomName",
"value": "",
"disabled": true
},
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "4"
},
{
"key": "newRoomId",
"value": "100"
}
]
}
},
"response": []
},
{
"name": "roomAction",
"event": [
{
"listen": "prerequest",
"script": {
"id": "e9c615e6-f547-4d46-ae79-c939ad10c138",
"exec": [
"pm.test(\"cmd\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" pm.globals.set(\"cmd\", map.get(\"cmd\"));\r",
" pm.globals.set(\"isOrberByUnread\", map.get(\"isOrberByUnread\"))\r",
"});\r",
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "39225fb9-3620-4e53-ae56-a666c8183f06",
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"switch(pm.globals.get(\"cmd\")){\r",
" //該当ユーザのチャット一覧\r",
" case pm.globals.get(\"getRoomList\") :\r",
" var jsonData = pm.response.json().body.roomList\r",
" var isOrberByUnread = pm.globals.get(\"isOrberByUnread\")\r",
" pm.test(\"test getRoomList\",function(){\r",
" //ルームの情報\r",
" pm.test(\"RoomList\",function() {\r",
" //既読されてないルームが最初整列\r",
" if (isOrberByUnread == \"true\") {\r",
" for (var i = 0; i < jsonData.length; i++) {\r",
" switch(i) {\r",
" case 0 :\r",
" pm.expect(jsonData[i].roomId).eq(100)\r",
" pm.expect(jsonData[i].roomName).eq(\"ChatRoom3\")\r",
" pm.expect(jsonData[i].message).eq(\"nice\")\r",
" pm.expect(jsonData[i].userCnt).eq(3)\r",
" pm.expect(jsonData[i].unreadFirst).eq(2)\r",
" break;\r",
"\r",
" case 1 :\r",
" pm.expect(jsonData[i].roomId).eq(98)\r",
" pm.expect(jsonData[i].roomName).eq(\"chatRoom1\")\r",
" pm.expect(jsonData[i].message).eq(\"hello \")\r",
" pm.expect(jsonData[i].userCnt).eq(2)\r",
" pm.expect(jsonData[i].unreadFirst).eq(2)\r",
" break;\r",
"\r",
" case 2 :\r",
" pm.expect(jsonData[i].roomId).eq(99)\r",
" pm.expect(jsonData[i].roomName).eq(\"ChatRoom2\")\r",
" pm.expect(jsonData[i].message).eq(\"こんにちは \")\r",
" pm.expect(jsonData[i].userCnt).eq(2)\r",
" pm.expect(jsonData[i].unreadFirst).eq(2)\r",
" break;\r",
" }\r",
" }\r",
" //メッセージの送信時間順で整列\r",
" } else if (isOrberByUnread == \"false\") {\r",
" for (var i = 0; i < jsonData.length; i++) {\r",
" switch(i) {\r",
" case 0 :\r",
" pm.expect(jsonData[i].roomId).eq(100)\r",
" pm.expect(jsonData[i].roomName).eq(\"ChatRoom3\")\r",
" pm.expect(jsonData[i].message).eq(\"nice\")\r",
" pm.expect(jsonData[i].userCnt).eq(3)\r",
" break;\r",
"\r",
" case 1 :\r",
" pm.expect(jsonData[i].roomId).eq(98)\r",
" pm.expect(jsonData[i].roomName).eq(\"chatRoom1\")\r",
" pm.expect(jsonData[i].message).eq(\"hello \")\r",
" pm.expect(jsonData[i].userCnt).eq(2)\r",
" break;\r",
"\r",
" case 2 :\r",
" pm.expect(jsonData[i].roomId).eq(99)\r",
" pm.expect(jsonData[i].roomName).eq(\"ChatRoom2\")\r",
" pm.expect(jsonData[i].message).eq(\"こんにちは \")\r",
" pm.expect(jsonData[i].userCnt).eq(2)\r",
" break;\r",
" }\r",
" }\r",
" }\r",
" })\r",
" })\r",
" break;\r",
" case pm.globals.get(\"createNewRoom\") :\r",
" break;\r",
" case pm.globals.get(\"exitRoom\") :\r",
" break;\r",
" \r",
" case pm.globals.get(\"disconnect\") :\r",
" var jsonData = pm.response.json().body.userList;\r",
" pm.test(\"test userList\", function(){\r",
" for (var i = 0; i < jsonData.length; i++){\r",
" switch (i) {\r",
" case 0 :\r",
" pm.expect(jsonData[i].loginId).eq(\"api_test1\")\r",
" pm.expect(jsonData[i].imageClearFlg).eq(0)\r",
" pm.expect(jsonData[i].shopMemberId).eq(935)\r",
" break;\r",
" case 1 :\r",
" pm.expect(jsonData[i].loginId).eq(\"api_test2\")\r",
" pm.expect(jsonData[i].imageClearFlg).eq(0)\r",
" pm.expect(jsonData[i].shopMemberId).eq(936)\r",
" break;\r",
" case 2 :\r",
" pm.expect(jsonData[i].loginId).eq(\"api_test3\")\r",
" pm.expect(jsonData[i].imageClearFlg).eq(0)\r",
" pm.expect(jsonData[i].shopMemberId).eq(937)\r",
" break;\r",
" }\r",
" }\r",
" })\r",
" break;\r",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/room?sid={{sid}}&cmd=1&isOrberByUnread=false",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"room"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "1"
},
{
"key": "isOrberByUnread",
"value": "false"
},
{
"key": "loginIdList",
"value": null,
"disabled": true
},
{
"key": "newRoomName",
"value": null,
"disabled": true
},
{
"key": "roomId",
"value": "100",
"disabled": true
}
]
}
},
"response": []
},
{
"name": "messageAction",
"event": [
{
"listen": "prerequest",
"script": {
"id": "645c2387-8265-47f3-90fa-e8934d78b2d3",
"exec": [
"pm.test(\"cmd\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" pm.globals.set(\"cmd\", map.get(\"cmd\"));\r",
"});\r",
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "0025f620-8347-4888-8d01-0b9fa63e11f7",
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"switch (pm.globals.get(\"cmd\")) {\r",
" case pm.globals.get(\"createMessage\") :\r",
" break;\r",
" case pm.globals.get(\"getMessages\") :\r",
" pm.test(\"test getMessages\", function(){\r",
" var jsonData = pm.response.json().body;\r",
" pm.test(\"messageList\", function(){\r",
" for (var i = 0; i < jsonData.messageList.length; i++) {\r",
" switch (i) {\r",
" case 0 :\r",
" pm.expect(jsonData.messageList[i].message).eq(\"Hello \")\r",
" pm.expect(jsonData.messageList[i].shopId).eq(59)\r",
" pm.expect(jsonData.messageList[i].loginId).eq(\"api_test2\")\r",
" pm.expect(jsonData.messageList[i].shopMemberId).eq(936)\r",
" break;\r",
" \r",
" case 1 :\r",
" pm.expect(jsonData.messageList[i].message).eq(\"こんばんは \")\r",
" pm.expect(jsonData.messageList[i].shopId).eq(59)\r",
" pm.expect(jsonData.messageList[i].loginId).eq(\"api_test1\")\r",
" pm.expect(jsonData.messageList[i].shopMemberId).eq(935)\r",
" break;\r",
" }\r",
" }\r",
" })\r",
" pm.test(\"userList\", function(){\r",
" for (var i = 0; i < jsonData.userList.length; i++) {\r",
" switch (i) {\r",
" case 0:\r",
" pm.expect(jsonData.userList[i].loginId).eq(\"api_test1\")\r",
" pm.expect(jsonData.userList[i].shopMemberId).eq(\"935\")\r",
" break;\r",
" \r",
" case 1:\r",
" pm.expect(jsonData.userList[i].loginId).eq(\"api_test2\")\r",
" pm.expect(jsonData.userList[i].shopMemberId).eq(\"936\")\r",
" break;\r",
"\r",
" }\r",
" }\r",
" })\r",
" })\r",
" break;\r",
" case pm.globals.get(\"roomSearch\") :\r",
" pm.test(\"test roomSearch\", function(){\r",
" var jsonData = pm.response.json().body;\r",
" pm.test(\"searchResultList\", function(){\r",
" for (var i = 0; i < jsonData.searchResultList; i++){\r",
" switch (i) {\r",
" case 0 : \r",
" pm.expect(jsonData[i].message).eq(2)\r",
" pm.expect(jsonData[i].roomName).eq(\"chatRoom1\")\r",
" pm.expect(jsonData[i].roomId).eq(98)\r",
" break;\r",
" }\r",
" }\r",
" \r",
" })\r",
" })\r",
" break;\r",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/message?sid={{sid}}&cmd=1&message=nice&roomId=100&userListInRoom=935,936,937&imageFlag=0",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"message"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "1"
},
{
"key": "message",
"value": "nice"
},
{
"key": "roomId",
"value": "100"
},
{
"key": "userListInRoom",
"value": "935,936,937"
},
{
"key": "lineNum",
"value": "0",
"disabled": true
},
{
"key": "keyword",
"value": "h",
"disabled": true
},
{
"key": "imageFlag",
"value": "0"
}
]
}
},
"response": []
}
],
"protocolProfileBehavior": {}
},
{
"name": "ChatAPI",
"item": [
{
"name": "CreateNewRoomAPI「チャットルーム生成」",
"item": [
{
"name": "Login「api_test1」",
"event": [
{
"listen": "test",
"script": {
"id": "bb19329e-f423-4bef-a6b4-28557f22c94f",
"exec": [
"var sid = pm.response.json().sid;\r",
"pm.globals.set(\"sid\", sid);\r",
"\r",
"pm.test(\"Login Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "424ae95b-535c-4920-8c73-159dd8f5f654",
"exec": [
"//userAction\r",
"pm.globals.set(\"JOIN\",\"1\");\r",
"pm.globals.set(\"JOIN_ROOM\",\"2\");\r",
"pm.globals.set(\"INVITEUSERS\",\"3\");\r",
"pm.globals.set(\"GET_GROUP_LIST\",\"4\");\r",
"pm.globals.set(\"GET_USER_LIST_IN_GROUP\",\"5\");\r",
"\r",
"//roomAction\r",
"pm.globals.set(\"GET_ROOM_LIST\",\"1\");\r",
"pm.globals.set(\"CREATE_NEW_ROOM\",\"2\");\r",
"pm.globals.set(\"EXIT_ROOM\",\"3\");\r",
"pm.globals.set(\"DISCONNECT\",\"4\");\r",
"\r",
"//messageAction\r",
"pm.globals.set(\"CREATE_MESSAGE\",\"1\");\r",
"pm.globals.set(\"GET_MESSAGES\",\"2\");\r",
"pm.globals.set(\"ROOM_SEARCH\",\"3\");\r",
"\r",
"//pushAction\r",
"pm.globals.set(\"GET_PUSH_MESSAGE\",\"1\");\r",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"user-agent": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"type": "text",
"value": "Android"
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/nuabvapi/appStoreNewLogin?appId=3&appVersion=1.2.360&deviceToken=dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc&deviceTypeId=3&language=en&loginId=api_test1&ma&password=111111&uid=578529ca22cab829.androidid&urlPath=fermi",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"nuabvapi",
"appStoreNewLogin"
],
"query": [
{
"key": "appId",
"value": "3"
},
{
"key": "appVersion",
"value": "1.2.360"
},
{
"key": "deviceToken",
"value": "dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc"
},
{
"key": "deviceTypeId",
"value": "3"
},
{
"key": "language",
"value": "en"
},
{
"key": "loginId",
"value": "api_test1"
},
{
"key": "ma",
"value": null
},
{
"key": "password",
"value": "111111"
},
{
"key": "uid",
"value": "578529ca22cab829.androidid"
},
{
"key": "urlPath",
"value": "fermi"
}
]
}
},
"response": []
},
{
"name": "Join",
"event": [
{
"listen": "test",
"script": {
"id": "8f44ce4d-56ab-4963-830d-f6f6bf62f4b7",
"exec": [
"pm.test(\"join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
" "
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN}}"
}
]
}
},
"response": []
},
{
"name": "createNewRoom",
"event": [
{
"listen": "prerequest",
"script": {
"id": "c10792df-ffaf-4ade-99ed-e5124daa29d3",
"exec": [
"pm.test(\"url 変数習得\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" var shopMemberId = map.get(\"loginIdList\").split(\",\");\r",
" for (var i = 0; i < shopMemberId.length; i++) {\r",
" pm.globals.set(\"shopMemberId\"+i ,shopMemberId[i]);\r",
" }\r",
"});"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "abd98cc2-215b-4229-ba61-67559e44f016",
"exec": [
"pm.test(\"createNewRoom Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var roomId = pm.response.json().body.roomId;\r",
"pm.globals.set(\"NewroomId\", roomId)\r",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/room?sid={{sid}}&cmd={{CREATE_NEW_ROOM}}&loginIdList=936,937&newRoomName=testRoom",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"room"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{CREATE_NEW_ROOM}}"
},
{
"key": "loginIdList",
"value": "936,937"
},
{
"key": "newRoomName",
"value": "testRoom"
}
]
}
},
"response": []
},
{
"name": "Confirm_join",
"event": [
{
"listen": "test",
"script": {
"id": "a5093004-aa59-4ce7-92d8-0f8a5b2ce849",
"exec": [
"pm.test(\"confirm join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"新しいルーム生成確認テスト\", function(){\r",
" var isCreateNewRoom = false;\r",
" var chatRoomList = pm.response.json().body.chatRoomList;\r",
" for (var i =0 ; i < chatRoomList.length; i++){\r",
" if (chatRoomList[i].roomId == pm.globals.get(\"NewroomId\")) {\r",
" isCreateNewRoom = true;\r",
" break;\r",
" }\r",
" }\r",
" pm.expect(isCreateNewRoom).eq(true)\r",
"})\r",
" "
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN}}"
}
]
}
},
"response": []
}
],
"protocolProfileBehavior": {},
"_postman_isSubFolder": true
},
{
"name": "InviteUsersAPI「招待技能」",
"item": [
{
"name": "Login「api_test1」",
"event": [
{
"listen": "test",
"script": {
"id": "9a6bb7d9-565a-4f41-8335-3f3bca6a6b0b",
"exec": [
"var sid = pm.response.json().sid;\r",
"pm.globals.set(\"sid\",sid);\r",
"\r",
"pm.test(\"Login Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "fb5198e1-9ab9-46ef-a58c-a1a0a7713c61",
"exec": [
"//userAction\r",
"pm.globals.set(\"JOIN\",\"1\");\r",
"pm.globals.set(\"JOIN_ROOM\",\"2\");\r",
"pm.globals.set(\"INVITEUSERS\",\"3\");\r",
"pm.globals.set(\"GET_GROUP_LIST\",\"4\");\r",
"pm.globals.set(\"GET_USER_LIST_IN_GROUP\",\"5\");\r",
"\r",
"//roomAction\r",
"pm.globals.set(\"GET_ROOM_LIST\",\"1\");\r",
"pm.globals.set(\"CREATE_NEW_ROOM\",\"2\");\r",
"pm.globals.set(\"EXIT_ROOM\",\"3\");\r",
"pm.globals.set(\"DISCONNECT\",\"4\");\r",
"\r",
"//messageAction\r",
"pm.globals.set(\"CREATE_MESSAGE\",\"1\");\r",
"pm.globals.set(\"GET_MESSAGES\",\"2\");\r",
"pm.globals.set(\"ROOM_SEARCH\",\"3\");\r",
"\r",
"//pushAction\r",
"pm.globals.set(\"GET_PUSH_MESSAGE\",\"1\");\r",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"user-agent": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"type": "text",
"value": "Android"
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/nuabvapi/appStoreNewLogin?appId=3&appVersion=1.2.360&deviceToken=dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc&deviceTypeId=3&language=en&loginId=api_test1&ma&password=111111&uid=578529ca22cab829.androidid&urlPath=fermi",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"nuabvapi",
"appStoreNewLogin"
],
"query": [
{
"key": "appId",
"value": "3"
},
{
"key": "appVersion",
"value": "1.2.360"
},
{
"key": "deviceToken",
"value": "dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc"
},
{
"key": "deviceTypeId",
"value": "3"
},
{
"key": "language",
"value": "en"
},
{
"key": "loginId",
"value": "api_test1"
},
{
"key": "ma",
"value": null
},
{
"key": "password",
"value": "111111"
},
{
"key": "uid",
"value": "578529ca22cab829.androidid"
},
{
"key": "urlPath",
"value": "fermi"
}
]
}
},
"response": []
},
{
"name": "joinRoom",
"event": [
{
"listen": "test",
"script": {
"id": "ef5f8e8a-b564-4e82-a60d-5ee4dad610a7",
"exec": [
"pm.test(\"Join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var beforeMessagList = pm.response.json().body.messageList;\r",
"pm.globals.set(\"beforeMessagList\", beforeMessagList)\r",
"\r",
"\r",
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "cb5a92d5-28e1-4b5c-be48-fde2cc093016",
"exec": [
"pm.test(\"リクエスト newRoomId 設定\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" pm.globals.set(\"newRoomId\",map.get(\"newRoomId\"));\r",
" pm.globals.set(\"beforeRoomId\",map.get(\"beforeRoomId\"));\r",
"});\r",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN_ROOM}}&newRoomId=115&beforeRoomId=100",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN_ROOM}}"
},
{
"key": "newRoomId",
"value": "115"
},
{
"key": "beforeRoomId",
"value": "100"
}
]
}
},
"response": []
},
{
"name": "getGroupList",
"event": [
{
"listen": "test",
"script": {
"id": "ed446c1e-431f-4890-bd0b-37c1a0998c6e",
"exec": [
"pm.test(\"getGroupList Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var groupList = pm.response.json().body.groupList\r",
"pm.globals.set(\"groupList\", groupList)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{GET_GROUP_LIST}}&newRoomId={{newRoomId}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{GET_GROUP_LIST}}"
},
{
"key": "newRoomId",
"value": "{{newRoomId}}"
}
]
}
},
"response": []
},
{
"name": "getUserListInGroup",
"event": [
{
"listen": "test",
"script": {
"id": "8247f4fb-36d8-4305-86dc-d258b7df9e33",
"exec": [
"pm.test(\"getUserListInGroup Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"var groupUserList = pm.response.json().body.groupUserList;\r",
"pm.globals.set(\"groupUserList\", groupUserList);\r",
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "4a2a6cfe-0665-4a98-867a-9ec0b6b7c6c7",
"exec": [
"pm.test(\"リクエスト groupId 設定\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" pm.globals.set(\"groupId\",map.get(\"groupId\"));\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{GET_USER_LIST_IN_GROUP}}&newRoomId={{newRoomId}}&groupId=1413",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{GET_USER_LIST_IN_GROUP}}"
},
{
"key": "newRoomId",
"value": "{{newRoomId}}"
},
{
"key": "groupId",
"value": "1413"
}
]
}
},
"response": []
},
{
"name": "inviteUsers",
"event": [
{
"listen": "test",
"script": {
"id": "e9f4e954-0a6e-4538-941c-ca15d75c3d8e",
"exec": [
"pm.test(\"inviteUsers Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var userList = pm.response.json().body.userList;\r",
"pm.globals.set(\"userList\",userList);"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "6c21eced-aa06-49d5-bfd4-65adb972e642",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{INVITEUSERS}}&newRoomId={{newRoomId}}&newRoomName=testRoom&loginIdList=941",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{INVITEUSERS}}"
},
{
"key": "newRoomId",
"value": "{{newRoomId}}"
},
{
"key": "newRoomName",
"value": "testRoom"
},
{
"key": "loginIdList",
"value": "941"
}
]
}
},
"response": []
},
{
"name": "Confirm_joinRoom",
"event": [
{
"listen": "test",
"script": {
"id": "4b7d7b36-26a2-4d52-b55e-21179c20a6df",
"exec": [
"pm.test(\"confirm joinRoom Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
" var afterMessageList = pm.response.json().body.messageList;\r",
" var beforeMessagList = pm.globals.get(\"beforeMessagList\");\r",
" \r",
" pm.test(\"招待後メッセージ一致確認\", function () {\r",
" for (var i = 0; i < afterMessageList.length; i++) {\r",
" pm.expect(afterMessageList[i].message).eq(beforeMessagList[i].message)\r",
" pm.expect(afterMessageList[i].shopMemberId).eq(beforeMessagList[i].shopMemberId)\r",
" pm.expect(afterMessageList[i].loginId).eq(beforeMessagList[i].loginId)\r",
" }\r",
" })\r",
"\r",
" pm.test(\"招待したユーザーがチャットルームに参加している確認\", function () {\r",
" var inviteUserList = pm.globals.get(\"userList\");\r",
" var roomUserList = pm.response.json().body.userListNewRoom; \r",
" for (var i = 0; i < roomUserList.length; i++) {\r",
" pm.expect(roomUserList[i]).eq(inviteUserList[i])\r",
" }\r",
" })"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "4d3e225d-2a45-4d3f-90c6-c1335289682d",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOINROOM}}&newRoomId={{newRoomId}}&beforeRoomId={{beforeRoomId}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOINROOM}}"
},
{
"key": "newRoomId",
"value": "{{newRoomId}}"
},
{
"key": "beforeRoomId",
"value": "{{beforeRoomId}}"
}
]
}
},
"response": []
},
{
"name": "Confirm_getGroupList",
"event": [
{
"listen": "test",
"script": {
"id": "a477e860-7f07-42e0-808d-5c02921dd958",
"exec": [
"pm.test(\"GetGroutList Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"招待したユーザーの属しているグループカウンターが減っているか確認\", function () {\r",
" var beforeGroupList = pm.globals.get(\"groupList\");\r",
" var afterGroupList = pm.response.json().body.groupList;\r",
" \r",
" //変更があるグループ変数\r",
" //var inviteGroupInfo = Array();\r",
" \r",
" //変更があるか判断する変数\r",
" var isGetGroupListCheck = false; \r",
" \r",
" //招待前後を比較し、変更した判断\r",
" for (var i = 0; i < afterGroupList.length; i++) {\r",
" if (beforeGroupList[i].memberCnt != afterGroupList[i].memberCnt){\r",
" isGetGroupListCheck = true;\r",
" //inviteGroupInfo = afterGroupList[i];\r",
" }\r",
" }\r",
" pm.expect(isGetGroupListCheck).eq(true)\r",
"})\r",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{GET_GROUP_LIST}}&newRoomId={{newRoomId}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{GET_GROUP_LIST}}"
},
{
"key": "newRoomId",
"value": "{{newRoomId}}"
}
]
}
},
"response": []
},
{
"name": "Confirm_getUserListInGroup",
"event": [
{
"listen": "test",
"script": {
"id": "25aeea64-f25f-475d-bf80-0f0d8742a8f6",
"exec": [
"pm.test(\"confirm getUserListInGroup Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var beforeGroupUserList = pm.globals.get(\"groupUserList\");\r",
"var afterGrouptUserList = pm.response.json().body.groupUserList;\r",
"\r",
"pm.test(\"招待されたユーザーがグループに属してないか判断\", function () {\r",
" var isGetUserListInGroupCheck = -1;\r",
" \r",
" //招待後shopMemberIdを配列に格納\r",
" var afterShopMemberIds = Array();\r",
" for (var i = 0; i < afterGrouptUserList.length; i++) {\r",
" afterShopMemberIds[i] = afterGrouptUserList[i].shopMemberId;\r",
" }\r",
" //招待前後を比較し、招待したユーザーのshopMemberIdを格納\r",
" var shopMemberId = new Array();\r",
" for (var i = 0; i < beforeGroupUserList.length; i++) {\r",
" var count = 0;\r",
" for (var j = 0 ; j < afterShopMemberIds.length; j++){\r",
" if (beforeGroupUserList[i].shopMemberId == afterShopMemberIds[j]) {\r",
" count++;\r",
" } \r",
" }\r",
" if(count == 0){\r",
" shopMemberId.push(beforeGroupUserList[i].shopMemberId);\r",
" }\r",
" }\r",
"\r",
" //招待後ユーザーshopMemberIdがないのを確認\r",
" for (var i = 0; i < shopMemberId.length; i++) {\r",
" pm.expect(isGetUserListInGroupCheck).eq(afterShopMemberIds.indexOf(shopMemberId[i]))\r",
" }\r",
" }) "
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{GET_USER_LIST_IN_GROUP}}&newRoomId={{newRoomId}}&groupId={{groupId}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{GET_USER_LIST_IN_GROUP}}"
},
{
"key": "newRoomId",
"value": "{{newRoomId}}"
},
{
"key": "groupId",
"value": "{{groupId}}"
}
]
}
},
"response": []
}
],
"protocolProfileBehavior": {},
"_postman_isSubFolder": true
},
{
"name": "CreateMessageAPI「チャットメッセージ送信」",
"item": [
{
"name": "Login「api_test1」",
"event": [
{
"listen": "test",
"script": {
"id": "805884d1-3e94-421a-b3fd-c40c9de6f59c",
"exec": [
"var sid = pm.response.json().sid;\r",
"pm.globals.set(\"sid\",sid);\r",
"\r",
"pm.test(\"Login Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "ab11c938-82f8-4a62-8664-110df1aa7e85",
"exec": [
"//userAction\r",
"pm.globals.set(\"JOIN\",\"1\");\r",
"pm.globals.set(\"JOIN_ROOM\",\"2\");\r",
"pm.globals.set(\"INVITEUSERS\",\"3\");\r",
"pm.globals.set(\"GET_GROUP_LIST\",\"4\");\r",
"pm.globals.set(\"GET_USER_LIST_IN_GROUP\",\"5\");\r",
"\r",
"//roomAction\r",
"pm.globals.set(\"GET_ROOM_LIST\",\"1\");\r",
"pm.globals.set(\"CREATE_NEW_ROOM\",\"2\");\r",
"pm.globals.set(\"EXIT_ROOM\",\"3\");\r",
"pm.globals.set(\"DISCONNECT\",\"4\");\r",
"\r",
"//messageAction\r",
"pm.globals.set(\"CREATE_MESSAGE\",\"1\");\r",
"pm.globals.set(\"GET_MESSAGES\",\"2\");\r",
"pm.globals.set(\"ROOM_SEARCH\",\"3\");\r",
"\r",
"//pushAction\r",
"pm.globals.set(\"GET_PUSH_MESSAGE\",\"1\");\r",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"user-agent": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"type": "text",
"value": "Android"
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/nuabvapi/appStoreNewLogin?appId=3&appVersion=1.2.360&deviceToken=dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc&deviceTypeId=3&language=en&loginId=api_test1&ma&password=111111&uid=578529ca22cab829.androidid&urlPath=fermi",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"nuabvapi",
"appStoreNewLogin"
],
"query": [
{
"key": "appId",
"value": "3"
},
{
"key": "appVersion",
"value": "1.2.360"
},
{
"key": "deviceToken",
"value": "dxDH1UITl-E%3AAPA91bHwZrP6-fXgAXiiApiPdH7Ai1cQFrc1FiTwWz85w5spAK56O1VHk0aV7BrB0uCvAccd2pkWaVQU-HORHLVpRt54xvyWKdh9mJ3Pg06tDFqFw0X6xaVTQ20rA8zeUdX6ZS-BVtzc"
},
{
"key": "deviceTypeId",
"value": "3"
},
{
"key": "language",
"value": "en"
},
{
"key": "loginId",
"value": "api_test1"
},
{
"key": "ma",
"value": null
},
{
"key": "password",
"value": "111111"
},
{
"key": "uid",
"value": "578529ca22cab829.androidid"
},
{
"key": "urlPath",
"value": "fermi"
}
]
}
},
"response": []
},
{
"name": "Join",
"event": [
{
"listen": "test",
"script": {
"id": "e641118a-cb64-4f0d-9ba3-28d0968ea9c8",
"exec": [
"pm.test(\"join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var chatRoomList = pm.response.json().body.chatRoomList;\r",
"pm.globals.set(\"chatRoomList\", chatRoomList)\r",
" "
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN}}"
}
]
}
},
"response": []
},
{
"name": "getMessage",
"event": [
{
"listen": "test",
"script": {
"id": "f6c7e435-c3b2-4be5-b0b9-7703e41d20e1",
"exec": [
"pm.test(\"getMessage Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var userList = pm.response.json().body.userList;\r",
"var shopMemberIds = new Array;\r",
"//createMessageにパラメータuserListInRoomの渡す実装\r",
"for (var i = 0; i < userList.length; i++) {\r",
" shopMemberIds = userList[i].shopMemberId\r",
"}\r",
"pm.globals.set(\"shopMemberIds\", shopMemberIds);\r",
"\r",
"//テスト確認の最新メッセージ情報を送る \r",
"var messageInfo = pm.response.json().body.messageList[0];\r",
"pm.globals.set(\"messageInfo\", messageInfo)\r",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"value": "android",
"type": "text",
"disabled": true
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/message?sid={{sid}}&cmd={{GET_MESSAGES}}&roomId=115&lineNum=0",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"message"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{GET_MESSAGES}}"
},
{
"key": "roomId",
"value": "115"
},
{
"key": "lineNum",
"value": "0"
}
]
}
},
"response": []
},
{
"name": "createMessage",
"event": [
{
"listen": "prerequest",
"script": {
"id": "2c92d38a-fbfc-4319-ade0-3c484ac41e69",
"exec": [
"pm.test(\"リクエスト RoomId, message 設定\",function(){\r",
" var url = request.url;\r",
" let map = new Map();\r",
" var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');\r",
" for (var i = 0; i < parameters.length; i++) { \r",
" var param = parameters[i].split('=');\r",
" map.set(param[0],param[1])\r",
" }\r",
" pm.globals.set(\"roomId\",map.get(\"roomId\"));\r",
" pm.globals.set(\"createMessage\",map.get(\"message\"));\r",
"});\r",
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "e91524cf-8b94-4634-a596-1877f7738762",
"exec": [
"pm.test(\"createMessage Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var createMessageTime = pm.response.json().body.time;\r",
"pm.globals.set(\"createMessageTime\", createMessageTime)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/message?sid={{sid}}&cmd={{CREATE_MESSAGE}}&roomId=115&userListInRoom={{shopMemberIds}}&message=hello world&imageFlag=0",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"message"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{CREATE_MESSAGE}}"
},
{
"key": "roomId",
"value": "115"
},
{
"key": "userListInRoom",
"value": "{{shopMemberIds}}"
},
{
"key": "message",
"value": "hello world"
},
{
"key": "imageFlag",
"value": "0"
}
]
}
},
"response": []
},
{
"name": "Confirm_join",
"event": [
{
"listen": "test",
"script": {
"id": "5a7ccada-f1ac-4a12-b04f-ccbf90de7b5d",
"exec": [
"pm.test(\"confirm join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"メッセージ送信後チャット一覧のメッセージ更新テスト\", function () {\r",
"\r",
" var beforeChatRoomList = pm.globals.get(\"chatRoomList\")\r",
" var afterChatRoomList = pm.response.json().body.chatRoomList;\r",
" var sendMessageRoomId= pm.globals.get(\"roomId\")\r",
"\r",
" var beforeRoomInfoMessage;\r",
" var beforeRoomInfoTime;\r",
" var afterRoomInfoMessage;\r",
" var afterRoomInfoTime;\r",
"\r",
" var isJoinCheck = false;\r",
"\r",
" //更新前のルーム最新メッセージ\r",
" for (var i = 0; i < beforeChatRoomList.length; i++) {\r",
" if (beforeChatRoomList[i].roomId == sendMessageRoomId) {\r",
" berforeRoomInfoMessage = beforeChatRoomList[i].message;\r",
" beforeRoomInfoTime = beforeChatRoomList[i].time.time;\r",
" }\r",
" }\r",
" \r",
" //更新後のルーム最新メッセージ\r",
" for (var i = 0; i < afterChatRoomList.length; i++) {\r",
" if (afterChatRoomList[i].roomId == sendMessageRoomId) {\r",
" afterRoomInfoMessage = afterChatRoomList[i].message;\r",
" afterRoomInfoTime = afterChatRoomList[i].time.time;\r",
" }\r",
" }\r",
"\r",
" //メッセージ送信したルームの情報が更新したかテスト\r",
" if (beforeRoomInfoMessage != afterRoomInfoMessage && beforeRoomInfoTime != afterRoomInfoTime) {\r",
" isJoinCheck = true;\r",
" } \r",
" pm.expect(isJoinCheck).eq(true)\r",
"})\r",
"\r",
" "
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN}}"
}
]
}
},
"response": []
},
{
"name": "Confirm_getMessage",
"event": [
{
"listen": "test",
"script": {
"id": "f7814cc8-2231-45ce-b247-a42083565386",
"exec": [
"pm.test(\"Confirm getMessage Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"チャットルームにメッセージが更新できたのかテスト\", function () {\r",
" var SEND_MESSAGE = 0;\r",
" var BEFORE_MESSAGE = 1;\r",
" var isCreateMessageCheck = false;\r",
"\r",
" //送信したメッセージ情報\r",
" var createMessage= pm.globals.get(\"createMessage\");\r",
" var createMessageTime = pm.globals.get(\"createMessageTime\");\r",
" //既存最新メッセージ情報\r",
" var beforeMessageInfo = pm.globals.get(\"messageInfo\");\r",
" //チャットルームに入場し、メッセージ情報\r",
" var afterMessgeInfo0 = pm.response.json().body.messageList[SEND_MESSAGE];\r",
" var afterMessgeInfo1 = pm.response.json().body.messageList[BEFORE_MESSAGE]\r",
"\r",
" //メッセージが更新されたかテスト\r",
" if ((createMessage == afterMessgeInfo0.message) \r",
" && (createMessageTime == afterMessgeInfo0.time.time)\r",
" && (beforeMessageInfo.message == afterMessgeInfo1.message) \r",
" && (beforeMessageInfo.time.time == afterMessgeInfo1.time.time)) {\r",
" \r",
" isCreateMessageCheck = true;\r",
" }\r",
"\r",
" //pm.expect(isCreateMessageCheck).eq(true)\r",
"})"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"value": "android",
"type": "text",
"disabled": true
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/message?sid={{sid}}&cmd={{GET_MESSAGES}}&roomId={{roomId}}&lineNum=0",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"message"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{GET_MESSAGES}}"
},
{
"key": "roomId",
"value": "{{roomId}}"
},
{
"key": "lineNum",
"value": "0"
}
]
}
},
"response": []
}
],
"protocolProfileBehavior": {},
"_postman_isSubFolder": true
},
{
"name": "ExitRoomAPI「ルーム脱退技能」",
"item": [
{
"name": "Login「api_test5」",
"event": [
{
"listen": "test",
"script": {
"id": "56a79d01-e28c-4824-ba50-ab5ab21f311c",
"exec": [
"var sid = pm.response.json().sid;\r",
"pm.globals.set(\"sid\",sid);\r",
"\r",
"pm.test(\"Losgin Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"user-agent": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "User-Agent",
"type": "text",
"value": "Android"
}
],
"url": {
"raw": "https://chatdev2.abook.bz/acms/nuabvapi/appStoreNewLogin?appId=3&appVersion=1.2.360&deviceToken=esSLc-NBwXc:APA91bFB13z_Zv7esMHAXwo5VvVZgETRLPqR4DvEyPtvCPNAw8ScCAfpiM53xos-PmOd98a-0eqvAN6rRIq1XaCBy64CXf-fQdNsW9yAE6F59RN57-l8Vk4utH1U0VPmIxWl3-0uw-er&deviceTypeId=3&language=en&loginId=api_test5&ma&password=111111&uid=3e40eb7cba223936.androidid&urlPath=fermi",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"nuabvapi",
"appStoreNewLogin"
],
"query": [
{
"key": "appId",
"value": "3"
},
{
"key": "appVersion",
"value": "1.2.360"
},
{
"key": "deviceToken",
"value": "esSLc-NBwXc:APA91bFB13z_Zv7esMHAXwo5VvVZgETRLPqR4DvEyPtvCPNAw8ScCAfpiM53xos-PmOd98a-0eqvAN6rRIq1XaCBy64CXf-fQdNsW9yAE6F59RN57-l8Vk4utH1U0VPmIxWl3-0uw-er"
},
{
"key": "deviceTypeId",
"value": "3"
},
{
"key": "language",
"value": "en"
},
{
"key": "loginId",
"value": "api_test5"
},
{
"key": "ma",
"value": null
},
{
"key": "password",
"value": "111111"
},
{
"key": "uid",
"value": "3e40eb7cba223936.androidid"
},
{
"key": "urlPath",
"value": "fermi"
}
]
}
},
"response": []
},
{
"name": "Join",
"event": [
{
"listen": "test",
"script": {
"id": "b154200f-032c-4f1e-a61e-17d02ff45b56",
"exec": [
"pm.test(\"Join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"var chatRoomList = pm.response.json().body.chatRoomList;\r",
"pm.globals.set(\"chatRoomList\", chatRoomList)\r",
" "
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN}}"
}
]
}
},
"response": []
},
{
"name": "exitRoom",
"event": [
{
"listen": "test",
"script": {
"id": "e549a9cb-eda0-4cc4-a67e-c340da4c5bf1",
"exec": [
"pm.test(\"ExitRoom Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/room?sid={{sid}}&cmd={{EXIT_ROOM}}&roomId=115",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"room"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{EXIT_ROOM}}"
},
{
"key": "roomId",
"value": "115"
}
]
}
},
"response": []
},
{
"name": "Confirm_join",
"event": [
{
"listen": "test",
"script": {
"id": "b4964df3-3434-42ae-9574-91b7a1a42075",
"exec": [
"pm.test(\"Confirm join Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"脱退確認テスト\", function () {\r",
" var beforeChatRoomList = pm.globals.get(\"chatRoomList\")\r",
" var afterChatRoomList = pm.response.json().body.chatRoomList;\r",
" var changeRoomId;\r",
" var afterChatRoomIds = new Array;\r",
" var isExitRoomCheck = false;\r",
" \r",
" //脱退後チャットルームIDを配列に格納\r",
" for (var i = 0; i < afterChatRoomList.length; i++) {\r",
" afterChatRoomIds = afterChatRoomList[i].roomId\r",
" }\r",
"\r",
" //脱退確認の比較\r",
" for (var i = 0; i < beforeChatRoomList.length; i++) {\r",
" //一致確認変数\r",
" var count = 0; \r",
" for(var j = 0; i < afterChatRoomList.length; j++) { \r",
" if (beforeChatRoomList[i].roomId == afterChatRoomList[j].roomId) {\r",
" count++;\r",
" return;\r",
" }\r",
" }\r",
" //脱退したルームIDを格納\r",
" if (count == 0) {\r",
" changeRoomId = beforeChatRoomList[i].roomId\r",
" }\r",
" }\r",
" //脱退成功し、ルームチャットが削除されたらtrueに変更\r",
" if (afterChatRoomIds.indexOf(changeRoomId) == -1) {\r",
" isExitRoomCheck = true;\r",
" }\r",
" pm.expect(isExitRoomCheck).eq(true)\r",
"})"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://chatdev2.abook.bz/acms/fermi/chatapi/user?sid={{sid}}&cmd={{JOIN}}",
"protocol": "https",
"host": [
"chatdev2",
"abook",
"bz"
],
"path": [
"acms",
"fermi",
"chatapi",
"user"
],
"query": [
{
"key": "sid",
"value": "{{sid}}"
},
{
"key": "cmd",
"value": "{{JOIN}}"
}
]
}
},
"response": []
}
],
"protocolProfileBehavior": {},
"_postman_isSubFolder": true
}
],
"protocolProfileBehavior": {}
}
],
"protocolProfileBehavior": {}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment