Selaa lähdekoodia

用户信息获取

lizhikun 1 vuosi sitten
vanhempi
commit
a1293d748d
2 muutettua tiedostoa jossa 22 lisäystä ja 0 poistoa
  1. 16 0
      cases/登录功能/用户信息获取/getuser.py
  2. 6 0
      lib/webapi.py

+ 16 - 0
cases/登录功能/用户信息获取/getuser.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '用户信息获取'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.Getuser()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['phone']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查用户信息',actural=='18211989987' and  actural1 == 0)

+ 6 - 0
lib/webapi.py

@@ -364,6 +364,12 @@ class APIMgr():
         return response
 
     """标讯收藏"""
+    #信息获取
+    def Getuser(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        response = s.get(f"{cfg.target_host}/jypay/user/getAccountInfo", headers=headers)
+        return response
 apimgr = APIMgr()