Browse Source

情报列表/搜索-订阅

jialuyao 7 months ago
parent
commit
8609d1c02d

+ 2 - 2
cases/fragmentation/情报/information.py → cases/fragmentation/情报/information_search.py

@@ -2,12 +2,12 @@ from hytest import *
 from lib.wxapi import apimgr
 class c1:
     #测试用例名称
-    name='情报列表'
+    name='情报列表/搜索-搜索'
     #测试步骤
     def teststeps(self):
         INFO('测试步骤')
         STEP(1, '第一步调用函数')
-        res = apimgr.information()
+        res = apimgr.information_search()
         r = res.json()
         INFO(r)
         actural = r['data']['total']

+ 16 - 0
cases/fragmentation/情报/information_subscription.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_subscription()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查用户中台接口是否正常', actural >= 0)

+ 14 - 2
lib/wxapi.py

@@ -150,8 +150,8 @@ class APIMgr():
         response = s.get(f"{cfg.target_host_wxapi}/debrisproduct/info/getHotInfo", headers=hearders)
         return response
 
-    """情报列表"""
-    def information(self):
+    """情报列表/搜索-搜索"""
+    def information_search(self):
         hearders = GSTORE['headers']
         s = GSTORE['s']
         json={
@@ -162,5 +162,17 @@ class APIMgr():
         response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/info/getInfoList", headers=hearders, json=json)
         return response
 
+    """情报列表/搜索-订阅"""
+    def information_subscription(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/subscribeList", headers=hearders, json=json)
+        return response
+
 
 apimgr = APIMgr()