فهرست منبع

大会员用户和超级订阅用户采购单位搜索

liuyali@topnet.net.cn 5 ماه پیش
والد
کامیت
3454ed9be9
3فایلهای تغییر یافته به همراه99 افزوده شده و 1 حذف شده
  1. 33 0
      cases/pc/登录功能/搜索功能/buyersearch_member.py
  2. 33 0
      cases/pc/登录功能/搜索功能/buyersearch_vip.py
  3. 33 1
      lib/webapi.py

+ 33 - 0
cases/pc/登录功能/搜索功能/buyersearch_member.py

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

+ 33 - 0
cases/pc/登录功能/搜索功能/buyersearch_vip.py

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

+ 33 - 1
lib/webapi.py

@@ -1,7 +1,7 @@
 import json
 import requests
 from hytest.common import *
-from pandas.io.formats.style import properties_args
+#from pandas.io.formats.style import properties_args
 from sympy.physics.vector.printing import params
 
 from cfg import cfg
@@ -1577,6 +1577,38 @@ class APIMgr():
         }
         response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/fType/buyerList", headers=headers, json=json)
         return response
+    # 采购单位搜索-大会员用户
+    def buyersearch_member(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/mType/buyerList", headers=headers, json=json)
+        return response
+    # 采购单位搜索-超级订阅用户
+    def buyersearch_vip(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/vType/buyerList", headers=headers, json=json)
+        return response
 
 apimgr = APIMgr()