浏览代码

产品列表、使用人员列表

liuyali@topnet.net.cn 5 月之前
父节点
当前提交
ce5a85d958

+ 3 - 0
cases/pc/登录功能/权限管理/__st__.py

@@ -3,6 +3,9 @@ from lib.webapi import apimgr
 def suite_setup():
     INFO('登录演示账号')
     apimgr.mgr_login(phone='20000020001',password='JianYu360')
+    INFO('切换用户身份到剑鱼标讯演示企业下')
+    apimgr.Identity_list(0)
+    apimgr.Identity_switch()
 def suite_teardown():
     INFO('退出')
     apimgr.mgr_logout()

+ 19 - 0
cases/pc/登录功能/权限管理/buy_productlist.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.buy_productlist()
+        actual = res.json()
+        error_code = actual["error_code"]
+        STEP(stepNo=2, desc='第二步设置检查点')
+        CHECK_POINT(desc='已购产品列表是否正常', condition= error_code == 0 )
+
+
+

+ 18 - 0
cases/pc/登录功能/权限管理/usepersonlist.py

@@ -0,0 +1,18 @@
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='使用人员列表'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.usepersonlist()
+        actual = res.json()
+        error_code = actual["error_code"]
+        status = actual["data"][0]["status"]
+        STEP(stepNo=2, desc='第二步设置检查点')
+        CHECK_POINT(desc='使用人员列表是否正常', condition= error_code == 0 and status == 1 )
+
+
+

+ 14 - 0
lib/webapi.py

@@ -1434,6 +1434,20 @@ class APIMgr():
         }
         response = self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport", headers=hearders,data=data)
         return response
+    #已购产品列表
+    def buy_productlist(self):
+        hearders = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/buyProductList", headers=hearders)
+        return response
+    #使用人员列表
+    def usepersonlist(self):
+        hearders = GSTORE['headers']
+        json = {
+            "wait_empower_id": 31142
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/usePersonList", headers=hearders , json= json)
+        return response
+
 
 #医械通我认领的经销商
     def distributor(self):