liumiaomiao 5 ヶ月 前
コミット
c7d296fdca

+ 1 - 1
cases/pc/登录功能/搜索功能/rc_search.py

@@ -8,7 +8,7 @@ class c6:
     def teststeps(self):
         INFO('测试步骤')
         STEP(1,'第一步调用函数')    #会出现在测试报告中
-        apimgr.Identity_list(5)
+        apimgr.Identity_list(1)
         apimgr.Identity_switch()
         res = apimgr.rc_search()
         response_data=json.loads(res.text)

+ 10 - 0
cases/pc/登录功能/电销/__st__.py

@@ -0,0 +1,10 @@
+from hytest import *
+from lib.webapi import apimgr
+def suite_setup():
+    INFO('切换用户身份到北京剑鱼企业下')
+    apimgr.Identity_list(5)
+    apimgr.Identity_switch()
+def suite_teardown():
+    INFO('将用户切回到闫培珠新版商机管理企业')
+    apimgr.Identity_list(1)
+    apimgr.Identity_switch()

+ 16 - 0
cases/pc/登录功能/电销/个人信息查询.py

@@ -0,0 +1,16 @@
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c6:
+    #测试用例名称
+    name = '电销个人信息查询'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+
+        res = apimgr.personal_info()
+
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查融创用户招标搜索接口是否正常',count > 0)

+ 23 - 0
lib/webapi.py

@@ -69,6 +69,19 @@ class APIMgr():
                                     })
         # 把response对象返回出去
         return response
+    #登录后获取session
+    def get_session(self):
+        response=self.mgr_login()
+        # 检查登录是否成功
+        if response.status_code == 200:
+            # 通过 response.cookies 获取 session 信息
+            session_id = self.s.cookies.get('SESSIONID')  # 假设 session ID 存储在 cookie 中
+            print(f"Session ID: {session_id}")
+            return session_id
+        else:
+            print("Login failed!")
+            return None
+
 
     # app登录接口
     def mgr_login_app(self, phone='18211989987', password='#80Z!RVv52',useproxies=False):
@@ -1401,6 +1414,16 @@ class APIMgr():
         header = GSTORE['headers']
         response = self.s.post(f"{cfg.target_host}/front/hasSign",headers=header)
         return response
+    #电销
+    #个人信息查询
+    def personal_info(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jyapi/biService/myInfo",headers=header)
+        session=self.get_session()
+        json = {
+            "sid":session
+        }
+        return response
 
 apimgr = APIMgr()