Эх сурвалжийг харах

免费用户采购单位搜索

liuyali@topnet.net.cn 5 сар өмнө
parent
commit
f04b8d882e

+ 32 - 0
cases/pc/登录功能/搜索功能/buyersearch_free.py

@@ -0,0 +1,32 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='免费用户采购单位搜索'
+    #单个用例初始化
+    def suite_setup(self):
+        INFO('切换用户身份到免费企业下')
+        apimgr.Identity_list(7)
+        apimgr.Identity_switch()
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.buyersearch_free()
+        actual = res.json()
+        error_code = actual["error_code"]
+        STEP(stepNo=2, desc='第二步设置检查点')
+        CHECK_POINT(desc='免费用户采购单位搜索是否正常', condition=error_code == 0)
+    #单个用例清除
+    def suite_teardown(self):
+        INFO('将用户切回到闫培珠新版商机管理企业')
+        apimgr.Identity_list(1)
+        apimgr.Identity_switch()
+
+
+
+
+
+

+ 16 - 0
lib/webapi.py

@@ -1561,6 +1561,22 @@ class APIMgr():
                 }
         response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/addUsePerson", headers=headers,json=json)
         return response
+    #采购单位搜索-免费用户
+    def buyersearch_free(self):
+        headers = GSTORE['headers']
+        json = {
+            "buyerName": "",
+            "pageNum": 1,
+            "pageSize": 10,
+            "isCheckFollow": True,
+            "isCheckReceive": True,
+            "buyerClass": [],
+            "province": [],
+            "city": [],
+            "isContact": 0
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/fType/buyerList", headers=headers, json=json)
+        return response
 
 apimgr = APIMgr()