浏览代码

页面检测title,接口新增

lizhikun 1 年之前
父节点
当前提交
e3953f6d9e

+ 18 - 0
cases/未登录功能/搜索列表/Proposed_construction_search.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c5:
+    #测试用例名称
+    tags = ['不登录拟在建搜索']
+    name = '不登录拟在建搜索'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.nologin_Proposed_construction_search()
+        response_data = json.loads(r.text)
+        error_code = response_data["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查不登录拟在建搜索是否正常', error_code == 0)

+ 18 - 0
cases/未登录功能/搜索列表/Tender_search.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c5:
+    #测试用例名称
+    tags = ['不登录招标搜索']
+    name = '不登录招标搜索'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.nologin_Tender_search()
+        response_data = json.loads(r.text)
+        error_code = response_data["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查不登录招标搜索列表,超前项目搜索,是否正常', error_code == 0)

+ 18 - 0
cases/未登录功能/搜索列表/buyerList.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c5:
+    #测试用例名称
+    tags = ['采购单位搜索列表']
+    name = '采购单位搜索列表'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.nologin_buyer_list()
+        response_data = json.loads(r.text)
+        error_code = response_data["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查采购单位搜索列表是否正常', error_code == 0)

+ 18 - 0
cases/未登录功能/搜索列表/enterpriseSearch.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c5:
+    #测试用例名称
+    tags = ['未登录企业搜索']
+    name = '未登录企业搜索'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.nologin_enterpriseSearch()
+        response_data = json.loads(r.text)
+        error_code = response_data["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查未登录企业搜索是否正常', error_code == 0)

+ 18 - 0
cases/未登录功能/搜索列表/supplySearch.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c5:
+    #测试用例名称
+    tags = ['不登录供应搜索列表']
+    name = '不登录供应搜索列表'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.nologin_supplySearch()
+        response_data = json.loads(r.text)
+        error_code = response_data["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查不登录供应搜索列表是否正常', error_code == 0)

+ 47 - 0
cases/未登录功能/链接验证/check_pc_title.py

@@ -0,0 +1,47 @@
+from hytest import *
+from lib.linkapi import apilink
+import csv
+class c1:
+    tags = ['未登录页面验证']
+    file_path = './doc/yemian.csv'
+
+    @classmethod
+    def load_cases(cls):
+        ddt_cases = []
+        with open(cls.file_path, 'r', encoding='GBK') as f:
+            reads = csv.reader(f)
+            for d in reads:
+                ddt_cases.append(
+                    {
+                        'name': d[0],
+                        'para': d[1],
+                        'expected_result': d[2]
+                    }
+                )
+        return ddt_cases
+
+    @classmethod
+    def teststeps(cls):
+        ddt_cases = cls.load_cases()
+        print(f"共有 {len(ddt_cases)} 个测试用例")
+        for index, case in enumerate(ddt_cases):
+            print(f"正在执行第 {index+1} 个测试用例: {case['name']}")
+            cls.run_test_case(case)
+
+    @staticmethod
+    def run_test_case(case):
+        name = case['name']
+        para = case['para']
+        expected_result = case['expected_result']
+
+        url = para
+        result = apilink.obtain_url_title(url)
+
+        # 打印调试信息
+        print(f"检查点 {name}")
+        print(f"URL: {url}")
+        print(f"实际结果: {result}")
+        print(f"预期结果: {expected_result}")
+
+        # 设置检查点
+        CHECK_POINT(name, result == expected_result)

+ 17 - 0
cases/登录功能/链接验证/check_pc_purchase_intention.py

@@ -0,0 +1,17 @@
+from hytest import *
+from lib.linkapi import apilink
+
+
+class c1:
+    tags = ['验证未登录采购意向页面是否能打开']
+
+    def teststeps(self):  # Method should be named 'teststeps'
+        INFO("测试步骤")
+        STEP(1, "定义检查连接")
+
+        # 定义检查的连接
+        url = "https://www.jianyu360.cn/list/stype/CGYX.html"
+        result = apilink.obtain_url_title(url)
+
+        # 定义检查点(result)
+        CHECK_POINT("pc端采购意向", result == "剑鱼标讯官网-全国采购意向信息")

+ 37 - 0
doc/yemian.csv

@@ -0,0 +1,37 @@
+采购意向列表,https://www.jianyu360.cn/list/stype/CGYX.html,剑鱼标讯官网-全国采购意向信息
+招标公告列表,https://www.jianyu360.cn/list/stype/ZBGG.html,剑鱼标讯官网_全国招标公告信息
+招标预告列表,https://www.jianyu360.cn/list/stype/ZBYG.html,剑鱼标讯官网_全国招标预告信息
+招标结果列表,https://www.jianyu360.cn/list/stype/ZBJG.html,剑鱼标讯官网_全国招标结果信息
+项目分包列表,https://www.jianyu360.cn/list/stype/XMFB.html,剑鱼标讯官网-全国项目分包信息
+招标信用列表,https://www.jianyu360.cn/list/stype/ZBXYXX.html,剑鱼标讯官网_全国招标信用信息
+企业直采列表,https://www.jianyu360.cn/list/stype/QYZC.html,剑鱼标讯官网-全国企业直采信息
+政府采购列表,https://www.jianyu360.cn/list/stype/ZFCG.html,剑鱼标讯官网-全国政府采购信息
+拟在建项目列表,https://www.jianyu360.cn/list/nzjxm,剑鱼标讯官网-全国拟在建项目信息
+审批项目列表,https://www.jianyu360.cn/list/spxm,剑鱼标讯官网-全国审批项目信息
+推荐项目列表,https://www.jianyu360.cn/list/tjxm,剑鱼标讯官网-全国推荐项目信息
+业主委托项目列表,https://www.jianyu360.cn/list/yzxm,剑鱼标讯官网-全国业主委托项目信息
+热门项目列表,https://www.jianyu360.cn/list/rmxm,剑鱼标讯官网-全国热门项目信息
+新兴项目列表,https://www.jianyu360.cn/list/xxxm,剑鱼标讯官网-全国新兴项目信息
+国家级项目列表,https://www.jianyu360.cn/list/gjxm,剑鱼标讯官网-国家级项目信息
+省级项目列表,https://www.jianyu360.cn/list/sjxm,剑鱼标讯官网-全国省级项目信息
+数据导出页面,https://www.jianyu360.cn/front/dataExport/toSieve,数据导出_拟建项目导出_招标采购数据导出_中标数据导出-剑鱼标讯
+数据超市页面,https://www.jianyu360.cn/datasmt/index,剑鱼标讯数据超市-分享全行业招标采购数据
+数据定制导出页面,https://www.jianyu360.cn/front/dataMarket/customExport,数据定制导出_剑鱼标讯,专业招标大数据服务平台
+数据api接口对接页面,https://www.jianyu360.cn/front/dataMarket/dataInterface,数据API接口_剑鱼标讯,专业招标大数据服务平台
+企业工商数据页面,https://www.jianyu360.cn/datasmt/qygssj_1,企业工商数据超市-剑鱼标讯
+业主数据页面,https://www.jianyu360.cn/datasmt/cgdwsj_1,采购单位数据超市-剑鱼标讯
+市场分析报告落地页,https://www.jianyu360.cn/big/page/sc,剑鱼大会员_招标商机_人工智能预测_招标大数据_企业情报-剑鱼标讯
+业务拓展分析页面,https://www.jianyu360.cn/big/page/yw,剑鱼大会员_招标商机_人工智能预测_招标大数据_企业情报-剑鱼标讯
+投标决策分析落地页,https://www.jianyu360.cn/big/page/tb,剑鱼大会员_招标商机_人工智能预测_招标大数据_企业情报-剑鱼标讯
+标书制作页面,https://www.jianyu360.cn/swordfish/frontPage/bidedoc/free/index,标书编写__剑鱼标讯,全行业招标信息智能推送领导者!
+广告合作落地页,https://www.jianyu360.cn/front/advservices.html,广告服务_剑鱼标讯,专业招标大数据服务平台
+企业认证服务落地页,https://www.jianyu360.cn/swordfish/frontPage/enterpriseCertificatio/free/index,企业认证服务-剑鱼标讯
+中标必听课页面,https://www.jianyu360.cn/jyxspc,剑鱼学堂-专属投标人的职业课堂
+渠道及商务合作落地页,https://www.jianyu360.cn/swordfish/frontPage/cooperation/free/index,渠道及商务合作_剑鱼合作伙伴联盟-剑鱼标讯
+供需信息发布落地页,https://www.jianyu360.cn/swordfish/frontPage/InformationDistribution/free/index,信息发布_招标采购供应信息发布-剑鱼标讯
+行业展会落地页,https://www.jianyu360.cn/exhibition/list/pc/index.html,行业展会-剑鱼标讯
+剑鱼文库页面,https://www.jianyu360.cn/swordfish/docs,剑鱼文库_剑鱼标讯,全行业招标信息智能推送领导者
+数字化营销落地页,https://www.jianyu360.cn/swordfish/frontPage/digitalMarketing/free/index,数字化营销_企业营销数字化产品-剑鱼标讯
+医械通落地页,https://clpages.cn/yxtsjgwyxy,医械通官网营销页
+客户管理落地页,https://www.jianyu360.cn/swordfish/frontPage/customanage/free/index,客户管理_客户管理领域解决方案-剑鱼标讯
+投标项目管理落地页,https://www.jianyu360.cn/swordfish/frontPage/biddingProject/free/index,投标项目管理_投标项目全流程可视化管理-剑鱼标讯

+ 31 - 1
lib/webapi.py

@@ -149,7 +149,7 @@ class APIMgr():
         return response
 
     #采购单位搜索
-    def buyersousuo(self, buyerName, province=None, city=None, buyerClass=None, isCheckFollow=True, isCheckReceive=True,
+    def buyer_search(self, buyerName, province=None, city=None, buyerClass=None, isCheckFollow=True, isCheckReceive=True,
                     isContact=0, pageSize=10, pageNum=1):
         if buyerClass is None:
             buyerClass = []
@@ -436,6 +436,36 @@ class APIMgr():
         s = GSTORE['s']
         response =s.post(f"{cfg.target_host}/resourceCenter/waitEmpowerDetail",headers=headers)
         return response
+    def nologin_buyer_list(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        data = {"buyerName":"","province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
+        response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList",headers=headers,json=data)
+        return response
+    def nologin_supplySearch(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        data = {"keywords":"信息","searchType":"title","province":"","city":"","time":"","status":"0","pageSize":50,"pageIndex":1}
+        response =s.post(f"{cfg.target_host}/jyinfo/supplySearch",headers=headers,json=data)
+        return response
+    def nologin_enterpriseSearch(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        params = {"match":"科技"}
+        response =s.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery",headers=headers, params=params)
+        return response
+    def nologin_Tender_search(self ):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        params = {"match":"科技"}
+        response =s.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList",headers=headers, params=params)
+        return response
+    def nologin_Proposed_construction_search(self ):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        params = {"match":"科技"}
+        response =s.post(f"{cfg.target_host}/front/project/nzj/search",headers=headers, params=params)
+        return response
 apimgr = APIMgr()