Browse Source

数据导出,剑鱼文库,企业情报监控,项目进度监控接口

jialuyao 2 years ago
parent
commit
33926b46b3

+ 15 - 0
cases/登录功能/剑鱼文库/libarary_my.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '我的文库'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.My_library()
+        r = res.json()
+        actural = r['data']['total']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查我的文库接口是否正常', actural >= 0 and actural1 == 0)

+ 15 - 0
cases/登录功能/剑鱼文库/library_collection.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '剑鱼文库收藏'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.Library_collection()
+        r = res.json()
+        actural = r['data']['total']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查剑鱼文库收藏接口是否正常', actural >= 0 and actural1 == 0)

+ 15 - 0
cases/登录功能/剑鱼文库/library_search.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '剑鱼文库搜索'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.Library_search()
+        r = res.json()
+        actural = r['data']['total']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查剑鱼文库搜索接口是否正常', actural != 0 and actural1 == 0)

+ 16 - 0
cases/登录功能/数据/data_export.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '数据导出'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.get_dataExport()
+        r = res.json()
+        actural = r['data']['total']
+        actural1=r['error_code']
+        # length = len(r['data']['list'])
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查数据导出接口是否正常', actural >= 0 and actural1 == 0)

+ 15 - 0
cases/登录功能/数据/export_recordlist.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '数据导出记录'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.Export_recordList()
+        r = res.json()
+        actural = r['data']['total']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查数据导出记录接口是否正常', actural >= 0 and actural1 == 0)

+ 15 - 0
cases/登录功能/监控/ent_list.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '企业情报监控'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.Enterprise_monitoring()
+        r = res.json()
+        actural = r['data']['hasNext']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查企业情报监控接口是否正常', actural == False and actural1 == 0)

+ 15 - 0
cases/登录功能/监控/project_list.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '项目进度监控'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.Project_monitoring()
+        r = res.json()
+        actural = r['data']['hasNext']
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查项目进度监控接口是否正常', actural == False and actural1 == 0)

+ 102 - 3
lib/webapi.py

@@ -59,6 +59,7 @@ class APIMgr():
         # 把response对象返回出去
         return response
 
+    """退出登录"""
     def mgr_logout(self):
         url = f"{cfg.target_host}/front/signOut"
         headers = GSTORE['headers']
@@ -142,7 +143,7 @@ class APIMgr():
                             "vt": ""})
         return  response
 
-    #不登录招标搜索
+    # 不登录招标搜索
     def notloggedin_search(self, keyword='科技', publishtime='thisyear', selectType='content,title'):
         headers = GSTORE['headers']
         params={"keywords": keyword , "publishtime": publishtime, "timeslot": "", "area": "", "subtype": "",
@@ -170,14 +171,14 @@ class APIMgr():
                     {"needFilter":"1","msgType":"0","isRead":"-1","offset":"1","pageSize":"5"})
         return response
 
-    # 用户中台
+    """用户中台"""
     def get_userCenter(self):
         hearders = GSTORE['headers']
         s = GSTORE['s']
         response = s.post(f"{cfg.target_host}/userCenter/workDesktop/menuInfo", headers=hearders)
         return response
 
-    # 我的订单
+    """我的订单"""
     def get_myOrder(self):
         hearders = GSTORE['headers']
         s = GSTORE['s']
@@ -190,6 +191,104 @@ class APIMgr():
         response = s.post(f"{cfg.target_host}/subscribepay/orderListDetails/myOrder", headers=hearders, params=params)
         return response
 
+    """数据自动导出"""
+    def get_dataExport(self,publishtime=1672502400_1688951529,keyword='数据',selectType='title'):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "publishtime":publishtime,
+            "area":"",
+            "city":"",
+            "region":"",
+            "industry":"",
+            "buyerclass":"",
+            "keyword": [{"keyword":keyword,"appended":[],"exclude":[]}],
+            "selectType":selectType,
+            "minprice":"",
+            "maxprice":"",
+            "subtype":"",
+            "buyer":"",
+            "winner":"",
+            "dataType": 2
+        }
+        response = s.post(f"{cfg.target_host}/front/dataExport/sieveData", headers=hearders, params=params)
+        return response
+
+
+    """数据导出记录"""
+    def Export_recordList(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "pageNum": 0,
+            "pageSize": 10
+        }
+        response = s.post(f"{cfg.target_host}/subscribepay/dataExportPack/recordList", headers=hearders, params=params)
+        return response
+
+    """剑鱼文库搜索"""
+    def Library_search(self,keyWord='数据'):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "keyWord":keyWord,
+            "tag":"",
+            "sort": "tSort",
+            "num": 1,
+            "size": 10
+        }
+        response = s.post(f"{cfg.target_host}/jydocs/search", headers=hearders, params=params)
+        return response
+
+    """剑鱼文库收藏"""
+    def Library_collection(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "sign": 1,
+            "num": 1,
+            "size": 10
+        }
+        response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
+        return response
+
+    """剑鱼文库我的文库"""
+    def My_library(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "sign": 0,
+            "num": 1,
+            "size": 10
+        }
+        response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
+        return response
+
+    """项目进度监控"""
+    def Project_monitoring(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "pageNum": 0,
+            "pageSize": 500
+        }
+        response = s.post(f"{cfg.target_host}/bigmember/follow/project/list", headers=hearders, params=params)
+        return response
+
+    """企业情报监控"""
+    def Enterprise_monitoring(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params={
+            "pageNum": 0,
+            "pageSize": 10,
+            "match":"",
+            "group":"",
+        }
+        response = s.post(f"{cfg.target_host}/bigmember/follow/ent/list", headers=hearders, params=params)
+        return response
+
+
 apimgr = APIMgr()