Browse Source

情报热词,情报列表

jialuyao 7 tháng trước cách đây
mục cha
commit
ea27e8a63d

+ 16 - 0
cases/fragmentation/情报/information.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='情报列表'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.information()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查用户中台接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/情报/information_buzzword.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='情报热词'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.information_buzzword()
+        r = res.json()
+        INFO(r)
+        actural = r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查用户中台接口是否正常', actural == 0)

+ 18 - 0
lib/wxapi.py

@@ -143,6 +143,24 @@ class APIMgr():
         response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/search/buyPurposeSubscribeList", headers=hearders, json=json)
         return response
 
+    """情报热词"""
+    def information_buzzword(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        response = s.get(f"{cfg.target_host_wxapi}/debrisproduct/info/getHotInfo", headers=hearders)
+        return response
+
+    """情报列表"""
+    def information(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "page_size": 1,
+            "page_num": 1,
+            "keyWords": "科技"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/info/getInfoList", headers=hearders, json=json)
+        return response
 
 
 apimgr = APIMgr()