Browse Source

搜索结果数据导出

liuyali@topnet.net.cn 5 months ago
parent
commit
e5de1b96be
2 changed files with 30 additions and 0 deletions
  1. 19 0
      cases/pc/登录功能/搜索功能/searchexport.py
  2. 11 0
      lib/webapi.py

+ 19 - 0
cases/pc/登录功能/搜索功能/searchexport.py

@@ -0,0 +1,19 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='搜索结果数据导出'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.searchexport()
+        actual_result = res.json()
+        result_id = actual_result["_id"]
+        STEP(stepNo=2, desc='第二步设置检查点')
+        CHECK_POINT(desc='搜索结果数据导出是否正常', condition = result_id is not None)
+
+
+

+ 11 - 0
lib/webapi.py

@@ -1425,6 +1425,17 @@ class APIMgr():
         }
         }
         response = self.s.post(f"{cfg.target_host}/jyapi/biService/myInfo", headers=header,json=json)
         response = self.s.post(f"{cfg.target_host}/jyapi/biService/myInfo", headers=header,json=json)
         return response
         return response
+    #搜索结果数据导出
+    def searchexport(self):
+        hearders = GSTORE['headers']
+        data ={
+            "searchvalue":"软件",
+            "selectIds":"ABCY1xWZC4%2FMD8vM3dzc1w4PiRfTBZmYUFkKD8jJiEgaGdzYFJUCnA%3D"
+        }
+        response = self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport", headers=hearders,data=data)
+        return response
+
+
 
 
 apimgr = APIMgr()
 apimgr = APIMgr()