lizhikun пре 5 месеци
родитељ
комит
cd80271f64

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


+ 15 - 0
cases/pc/登录功能/是否登录/hasSign.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '是否登录'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.hassign()#调用 webapi.apimgr 模块中的 hassign 方法
+        r = res.json()#将 API 响应内容解析为 JSON 格式,并存储在变量 r 中
+        INFO(r)#输出完整的 API 响应内容,方便调试和查看
+        actural=r['encryptId']#actural:用来存储从 API响应的 JSON 数据中提取的 'encryptId' 键对应的值
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('是否登录接口是否正常',  actural == "QlwRWlQVUwVSUUMKEV9VRwoJUwcVVxZd" )#断言检查,设置了一个检查点,用来验证

+ 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()

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

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

+ 16 - 0
cases/pc/登录功能/采购单位画像/latest_project_news.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='最新项目动态'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.latest_project_news()
+        res = r.json()
+        actural  = res['error_code']
+        actural1 = res['data']['count']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查最新项目动态是否正常',actural ==0 and actural1 >=0)

+ 16 - 0
cases/pc/登录功能/采购单位画像/prchasing_profile_data.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='采购单位画像数据'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.prchasing_profile_data()
+        res = r.json()
+        actural  = res['error_code']
+        actural1 = res['data']['buyerclass']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查采购单位画像数据是否正常',actural ==0 and actural1 =="能源化工")

+ 47 - 0
lib/webapi.py

@@ -1374,6 +1374,53 @@ class APIMgr():
         response = s.get(f"{cfg.target_host_app}/entnicheNew/distribute/detail?id=67820b98e7364a57c3b7eaf5", headers=hearders, data=data)
         return response
 
+    """采购单位画像数据"""
+    def prchasing_profile_data(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params= {
+            "buyer":"黎明化工研究设计院有限责任公司",
+            "exactMatch":0
+        }
+        response = s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/getData", headers=hearders, params=params)
+        return response
+
+    """最新项目动态"""
+
+    def latest_project_news(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params = {
+            "buyer": "黎明化工研究设计院有限责任公司",
+            "PageNum": 1,
+            "pageSize": 5
+        }
+        response = s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/getNewMsg", headers=hearders, params=params)
+        return response
+    #搜索结果数据导出
+    def searchexport(self):
+        hearders = GSTORE['headers']
+        data ={
+            "searchvalue":"软件",
+            "selectIds":"ABCY1xWZC4%2FMD8vM3dzc1w4PiRfTBZmYUFkKD8jJiEgaGdzYFJUCnA%3D"
+        }
+        response = self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport", headers=hearders,data=data)
+        return response
+    #电销
+    #个人信息查询
+    def personal_info(self):
+        header = GSTORE['headers']
+        session=self.get_session()
+        json = {
+            "sid":session
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/biService/myInfo", headers=header,json=json)
+        return response
+    #是否登录
+    def hassign(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/front/hasSign",headers=header)
+        return response
 apimgr = APIMgr()