Selaa lähdekoodia

移动端首页商机推荐

yuanyuan 4 kuukautta sitten
vanhempi
commit
b3b0369e2d
2 muutettua tiedostoa jossa 31 lisäystä ja 0 poistoa
  1. 20 0
      cases/app/登录/首页/latest_news.py
  2. 11 0
      lib/webapi.py

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

@@ -0,0 +1,20 @@
+
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+
+    name='移动端首页商机推荐'   #测试用例名称
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.latestnews()
+        actual = res.json()
+        error_code = actual["error_code"]
+        STEP(stepNo=2, desc='第二步设置检查点')
+        CHECK_POINT('移动端首页商机推荐接口是否正常', error_code == 0)
+
+
+
+

+ 11 - 0
lib/webapi.py

@@ -1829,6 +1829,17 @@ class APIMgr():
             print("无法将 show_search 的响应解析为 JSON。")
             return None
 
+    #移动端首页商机推荐-原最新标讯
+    def latestnews(self):
+        headers = GSTORE['headers']
+        json = {
+            "city": "",
+            "isSearch": 1
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/jybx/base/newest",headers = headers ,json = json)
+        return response
+
+
 apimgr = APIMgr()