浏览代码

创建会话

liuyali@topnet.net.cn 3 月之前
父节点
当前提交
db2288da61
共有 2 个文件被更改,包括 26 次插入0 次删除
  1. 14 0
      cases/pc/登录功能/在线客服/create_chatSession.py
  2. 12 0
      lib/webapi.py

+ 14 - 0
cases/pc/登录功能/在线客服/create_chatSession.py

@@ -0,0 +1,14 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '创建会话'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.create_chatSession()
+        actual = res.json()
+        error_code = actual["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查创建会话是否正常',error_code == 0)

+ 12 - 0
lib/webapi.py

@@ -1890,6 +1890,18 @@ class APIMgr():
         }
         response = self.s.post(f"{cfg.target_host}/jyapi/biService/call", headers=headers, json=json)
         return response
+    #创建会话
+    def create_chatSession(self):
+        headers = GSTORE['headers']
+        json = {
+            "userType": 2,
+            "msgType": 4,
+            "receiveEntId": "465d475c52"
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/message/createChatSession", headers=headers, json=json)
+        return response
+
+
 
 apimgr = APIMgr()