Pārlūkot izejas kodu

新增剑鱼对外接口,商机管理客户关注接口

lizhikun 10 mēneši atpakaļ
vecāks
revīzija
94d5d782c3

+ 16 - 0
cases/pc/未登录功能/对外接口/bid_annex.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='招标采购信息附件下载接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.bid_annex()
+        actural = res.headers.get('Content-Type')
+        INFO(actural)
+        # error_msg = actural["error_msg"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('招标采购信息附件下载接口返回信息为zip', condition=actural == 'application/zip')

+ 16 - 0
cases/pc/未登录功能/对外接口/bid_ordinarypkg.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='招标采购搜索信息普通字段包对外接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.bid_ordinarypkg()
+        actural = res.json()
+        # INFO(actural)
+        error_msg = actural["error_msg"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('招标采购搜索信息普通字段包对外接口',error_msg == '请求成功' )

+ 17 - 0
cases/pc/未登录功能/对外接口/bid_search_api.py

@@ -0,0 +1,17 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='招标采购搜索信息对外接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.bid_search_api()
+        actural = res.json()
+        INFO(actural)
+        error_msg = actural["error_msg"]
+        page_count = actural["data"]["pageCount"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('招标采购搜索信息对外接口',error_msg == '请求成功' and  page_count >0 )

+ 16 - 0
cases/pc/未登录功能/对外接口/bid_seniorpkg.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='招标采购搜索信息高级字段包对外接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.bid_seniorpkg()
+        actural = res.json()
+        # INFO(actural)
+        error_msg = actural["error_msg"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('招标采购搜索信息高级字段包对外接口',error_msg == '请求成功' )

+ 16 - 0
cases/pc/登录功能/商机管理客户关注/customer_attention.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='商机管理用户关注'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.customer_attention()
+        actural = res.json()
+        INFO(actural)
+        limit_count=actural["data"]["limit_count"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('商机管理用户关注接口是否正常',limit_count>0)

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

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='客户标签分类获取'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.customer_getLabel()
+        actural = res.json()
+        INFO(actural)
+        lanme=actural["data"][0]["lanme"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('客户标签分类获取接口是否正常',lanme=="剑鱼测试")

+ 1 - 0
cfg/cfg.py

@@ -1,2 +1,3 @@
 target_host = 'https://www.jianyu360.cn'
 target_host = 'https://www.jianyu360.cn'
 target_host_app = 'https://app-a1.jianyu360.cn'
 target_host_app = 'https://app-a1.jianyu360.cn'
+target_host_api = 'https://api.jianyu360.com'

+ 62 - 3
lib/webapi.py

@@ -121,7 +121,7 @@ class APIMgr():
               "reqType": "lastNews",
               "reqType": "lastNews",
               "pageNum": 1,
               "pageNum": 1,
               "pageSize": 50,
               "pageSize": 50,
-              "keyWords": "",
+              "keyWords": "科技",
               "searchMode": 0,
               "searchMode": 0,
               "bidField": "",
               "bidField": "",
               "publishTime": "1689573022-1721195422",
               "publishTime": "1689573022-1721195422",
@@ -141,7 +141,7 @@ class APIMgr():
               "buyerTel": "",
               "buyerTel": "",
               "winnerTel": ""
               "winnerTel": ""
             }
             }
-        response = session.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList", headers=headers, json=data)
+        response = session.post(f"{cfg.target_host}/jyapi/jybx/core/mType/searchList", headers=headers, data=data)
         return response
         return response
 
 
      # 企业搜索
      # 企业搜索
@@ -763,7 +763,66 @@ class APIMgr():
             "vt": "s"
             "vt": "s"
         })
         })
         return response
         return response
-
+    #招标采购搜索信息对外接口
+    def bid_search_api(self):
+        headers = {
+   'Accept-Charset': 'utf-8',
+   'timestamp': '1726207205',
+   'sign': '1058A958B8D562EA9F2234AC42716778',
+   'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+   'Content-Type': 'application/json'
+}
+        response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/search?appid=jianyuDev", headers=headers, json={
+    "releaseTimeStart": 1695456870,"keyWord": ["市政粮食"],"searchMode":1})
+        return response
+    #招标采购搜索信息普通字段包对外接口
+    def bid_ordinarypkg(self):
+        headers = {
+                'Accept-Charset': 'utf-8',
+                'timestamp': '1726207205',
+                'sign': '1058A958B8D562EA9F2234AC42716778',
+                'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+                'Content-Type': 'application/json'
+            }
+        response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/ordinarypkg?appid=jianyuDev",
+                                   headers=headers, json={"id": "040654015b5f500a1b4774135a57015651085a585c4f4c7605dc"})
+        return response
+    # 招标采购搜索信息高级字段包对外接口
+    def bid_seniorpkg(self):
+        headers = {
+                    'Accept-Charset': 'utf-8',
+                    'timestamp': '1726207205',
+                    'sign': '1058A958B8D562EA9F2234AC42716778',
+                    'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+                    'Content-Type': 'application/json'
+                }
+        response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/seniorpkg?appid=jianyuDev",
+                                       headers=headers,
+                                       json={"id": "040654015b5f500a1b4774135a57015651085a585c4f4c7605dc"})
+        return response
+    #招标采购信息附件下载接口
+    def bid_annex(self):
+                    headers = {
+                        'Accept-Charset': 'utf-8',
+                        'timestamp': '1726207205',
+                        'sign': '1058A958B8D562EA9F2234AC42716778',
+                        'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+                        'Content-Type': 'application/json'
+                    }
+                    response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/annex?appid=jianyuDev",
+                                           headers=headers,
+                                           json={"fid":"040507510f0a075618137614500208530c095c500f1814785d44030451"})
+                    return response
+    #客户标签类型获取
+    def customer_getLabel(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/customer/getLabel", headers=headers, json={})
+        return response
+    #商机管理客户关注
+    def customer_attention(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/publicapply/customer/attention", headers=headers, json={"name":"石嘴山市交通工程建设管理中心","mold":1,"D":True})
+        return response
 apimgr = APIMgr()
 apimgr = APIMgr()