浏览代码

移动端首页热词获取

liuyali@topnet.net.cn 5 月之前
父节点
当前提交
b6f820c7ff
共有 2 个文件被更改,包括 25 次插入0 次删除
  1. 20 0
      cases/app/登录/首页/hotword_mobile.py
  2. 5 0
      lib/webapi.py

+ 20 - 0
cases/app/登录/首页/hotword_mobile.py

@@ -0,0 +1,20 @@
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='移动端首页热词获取'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.hotword_mobile()
+        actual = res.json()
+        error_code = actual["error_code"]
+        keyword =actual["data"][0]["keyword"]
+        STEP(stepNo=2, desc='第二步设置检查点')
+        CHECK_POINT(desc='移动端首页热词获取是否正常', condition=error_code == 0 and keyword=="信息化")
+
+
+
+

+ 5 - 0
lib/webapi.py

@@ -1648,6 +1648,11 @@ class APIMgr():
         }
         response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/relates/information", headers=headers, json=json)
         return response
+    #移动端首页热词获取
+    def hotword_mobile(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host_app}/jyapi/jybx/core/mobileHotWord", headers=headers)
+        return response
 
 apimgr = APIMgr()