zangyamei 5 bulan lalu
induk
melakukan
38dcb5bda9
2 mengubah file dengan 23 tambahan dan 1 penghapusan
  1. 16 0
      cases/pc/登录功能/医械通/userauthInfo.py
  2. 7 1
      lib/webapi.py

+ 16 - 0
cases/pc/登录功能/医械通/userauthInfo.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '医械通获取用户认证信息'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.userauthInfo() #调用了apimgr对象的userauthInfo()方法,并将返回结果存储在变量res中
+        resp = res.json() #res是一个HTTP响应对象,使用.json()方法将其内容解析为JSON格式。然后将解析后的结果赋值给变量resp
+        error_code = resp['error_code'] #从resp字典中提取出error_code字段的值。通常,error_code用于表示操作的结果状态
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查医械通获取用户认证信息接口是否正常', error_code==0)

+ 7 - 1
lib/webapi.py

@@ -1435,12 +1435,18 @@ class APIMgr():
         response = self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport", headers=hearders,data=data)
         return response
 
-#我认领的经销商
+#医械通我认领的经销商
     def distributor(self):
         header = GSTORE['headers']
         response = self.s.post(f"{cfg.target_host}/jyapi/domain/claim/distributor",headers=header)
         return response
 
+#医械通获取用户认证信息
+    def userauthInfo(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jyapi/domain/userAuthInfo",headers=header)
+        return response
+
 apimgr = APIMgr()