liuyali@topnet.net.cn 7 meses atrás
pai
commit
097c83c3bf

+ 20 - 0
cases/pc/登录功能/工作台首页/workdesk_intelligence.py

@@ -0,0 +1,20 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='工作桌面商机情报列表接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.workdesk_intelligence()
+        #把文本转为json格式
+        #actural =json.loads(res.text)
+        actural =res.json()
+        #INFO(actural),打印
+        code=actural["code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查工作桌面商机情报列表接口是否正常',code == 0)

+ 17 - 0
cases/pc/登录功能/工作台首页/workdesk_unread_messages.py

@@ -0,0 +1,17 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='工作桌面首页未读消息数量接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.workdesk_unread_messages()
+        actural =res.json()
+        unread=actural["unread"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查工作桌面首页未读消息数量接口是否正常',unread >= 0)

+ 17 - 0
cases/pc/登录功能/我的资产/goods_points.py

@@ -0,0 +1,17 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='商品积分查询接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.goods_points()
+        actural =res.json()
+        error_code=actural["error_code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查工作桌面商机情报列表接口是否正常',error_code == 0)

+ 33 - 0
lib/webapi.py

@@ -1030,6 +1030,39 @@ class APIMgr():
         response = self.s.post(f"{cfg.target_host}/bigmember/search/buyer/association?name=河南科技大学", headers=header)
         return response
 
+    # 工作桌面商机情报列表
+    def workdesk_intelligence(self):
+        header = GSTORE['headers']
+        data = {
+            "msgType": 5,
+            "needDealtWithCount": True,
+            "offset": 1,
+            "size": 5
+        }
+        response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/WorkDeskList", headers=header, json=data)
+        return response
+    #商品积分查询
+    def goods_points(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jyintegral/productPoints/introduction",headers=header)
+        return response
+    #工作桌面首页-我的消息-未读消息数量
+    def workdesk_unread_messages(self):
+        header = GSTORE['headers']
+        json ={
+            "size": 20,
+            "msgType": -1,
+            "offset": 1,
+            "isRead": 0,
+            "isColumn": False,
+            "isColumnNewMsg": False,
+            "isContainLetter": False,
+            "isMsgList": False
+        }
+
+        response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=header,json=json)
+        return response
+
 apimgr = APIMgr()