liumiaomiao 1 年之前
父节点
当前提交
c507fbd2e7

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

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='超前项目搜索接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.advanced_search()
+        actural = res.json()
+        count=actural["data"]["count"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查超前项目搜索接口是否正常',count > 0)

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

@@ -1,4 +1,3 @@
-
 from hytest import *
 from lib.webapi import apimgr
 class c2:

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

@@ -1,7 +1,4 @@
 import json
-from logging import ERROR
-
-import requests
 from hytest import *
 from lib.webapi import apimgr
 class c5:

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

@@ -1,4 +1,3 @@
-import json
 from hytest import *
 from lib.webapi import apimgr
 class c3:

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

@@ -1,5 +1,4 @@
 import json
-
 from hytest import *
 from lib.webapi import apimgr
 class c6:

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

@@ -1,7 +1,4 @@
 import json
-from logging import ERROR
-
-import requests
 from hytest import *
 from lib.webapi import apimgr
 class c4:

+ 17 - 0
cases/pc/登录功能/身份信息获取/isadd.py

@@ -0,0 +1,17 @@
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c6:
+    #测试用例名称
+    name = '用户信息获取isadd接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.isadd()
+        response_data=json.loads(res.text)
+        #任意选取返回值中 基本不会改变的值 作为验证点
+        error_code = response_data["error_code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查用户信息获取isadd接口是否正常',error_code ==0)

+ 40 - 1
lib/webapi.py

@@ -111,6 +111,39 @@ class APIMgr():
         response = session.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
         self.printResponse(response)
         return response
+    #超前项目搜索
+    def advanced_search(self):
+        #使用全局变量
+        headers = GSTORE['headers']
+        #保存session
+        session = self.s
+        data={
+              "searchGroup": 2,
+              "reqType": "lastNews",
+              "pageNum": 1,
+              "pageSize": 50,
+              "keyWords": "",
+              "searchMode": 0,
+              "bidField": "",
+              "publishTime": "1689573022-1721195422",
+              "selectType": "title,content",
+              "subtype": "",
+              "exclusionWords": "",
+              "buyer": "",
+              "winner": "",
+              "agency": "",
+              "industry": "",
+              "province": "",
+              "city": "",
+              "district": "",
+              "buyerClass": "",
+              "fileExists": "",
+              "price": "",
+              "buyerTel": "",
+              "winnerTel": ""
+            }
+        response = session.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList", headers=headers, json=data)
+        return response
 
      # 企业搜索
     def enterpriseSearch(self, match="北京剑鱼信息技术有限公司河南分公司", matchType="A", pageSize="10", pageNum="0"):
@@ -127,7 +160,7 @@ class APIMgr():
         self.printResponse(response)
         return response
 
-        # 供应搜索
+    # 供应搜索
     def supplySearch(self, keywords="PH计", searchType="title", province="", city="", time="", status="0",
                          pageSize=50, pageIndex=1):
         headers = GSTORE['headers']
@@ -273,6 +306,12 @@ class APIMgr():
         }
         response = s.post(f"{cfg.target_host}/bigmember/follow/project/cancel", headers=headers, params=params)
         return response
+    """用户信息获取isadd接口"""
+    def isadd(self):
+        headers = GSTORE['headers']
+        s = GSTORE["s"]
+        response = s.get(f"{cfg.target_host}/bigmember/use/isAdd", headers=headers)
+        return response
 
     #接口数据传值常用三种方式:urlencoded---params,键值对---data,json格式---json
     #获取推送记录接口