liumiaomiao 9 ヶ月 前
コミット
33fa1fbde9

+ 17 - 0
cases/pc/登录功能/三级页/business_Details.py

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

+ 17 - 0
cases/pc/登录功能/三级页/important_News.py

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

+ 16 - 0
cases/pc/登录功能/供应信息附件下载/supplyInfo_attachment.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c2:
+    #测试用例名称
+    name='供应信息附件获取'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.supplyInfo_attachment()
+        actural = res.json()
+        INFO(actural)
+        limit_count=actural["error_code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('供应信息附件获取接口是否正常',limit_count==0)

+ 17 - 0
cases/pc/登录功能/剑鱼文库/jydocs_detail.py

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

+ 21 - 0
cases/pc/登录功能/剑鱼文库/jydocs_indexTag.py

@@ -0,0 +1,21 @@
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c7:
+    #测试用例名称
+    name = '文库分类'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.jydocs_indexTag()
+        response_data=res.json()
+        #任意选取返回值中 基本不会改变的值 作为验证点
+        services = response_data["error_code"]
+        STEP(2, '第二步设置检查点')
+
+        # 验证 "办公文档" 是否存在于 data 中
+        data_contains_office_docs = "办公文档" in response_data["data"]
+
+        # 设置检查点
+        CHECK_POINT('检查文库分类接口是否正常', services == 0 and data_contains_office_docs)

+ 0 - 0
cases/pc/登录功能/剑鱼文库/jydocs_search.py


+ 18 - 0
cases/pc/登录功能/留资信息/salesLeads_collectInfo.py

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

+ 34 - 0
cases/pc/登录功能/留资信息/salesLeads_retainedCapital.py

@@ -0,0 +1,34 @@
+import json
+from hytest import *
+from lib.webapi import apimgr
+class c7:
+    #测试用例名称
+    name = '留资信息反显'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.salesLeads_retainedCapital()
+        INFO(res.text)
+        response_data=res.json()
+        # 设置检查点
+        response_data = {
+            "data": {
+                "fource": False,
+                "retainedCapital": True
+            },
+            "info": {
+                "MESSAGEID": "7a79ad119a364ceea67a69a584210ae2",
+                "agree": True,
+                "attr2": ["建筑工程", "信息技术", "弱电安防"],
+                "birthday": "2024-02-13",
+                "company": "质量部测试企业",
+            },
+            "error_code": 0,
+        }
+
+        services = response_data["error_code"]
+
+        # 设置检查点
+        company_name = response_data["info"]["company"]
+        CHECK_POINT('检查留资信息反显接口是否正常', services == 0 and company_name == "质量部测试企业")

+ 17 - 0
cases/pc/登录功能/监控/me_Monitoring.py

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

+ 53 - 0
lib/webapi.py

@@ -956,7 +956,60 @@ class APIMgr():
         }
         response = self.s.post(f"{cfg.target_host_app}/salesLeads/appNewUerSales", headers=headers, json=json)
         return response
+        # 商机情报详情页
 
+    def business_intelligence(self):
+        headers = GSTORE['headers'] = GSTORE['headers']
+        response = self.s.post(
+            f"{cfg.target_host}/bigmember/project/businessDetails?id=ABCY1xZdSlYKD0sAnd6cAcSMTI4DRZjV3diPB40OS8NfGpzZQFUCYI%3D",
+            headers=headers)
+        return response
+
+    def me_Monitoring(self):
+        headers = GSTORE['headers']
+        response = self.s.get(f"{cfg.target_host}/bigmember/project/meMonitoring", headers=headers)
+        return response
+        # 要闻
+
+    def important_News(self):
+        heards = GSTORE['headers']
+        response = self.s.get(f"{cfg.target_host}/front/project/importantNews", headers=heards)
+        return response
+        # 文库分类
+
+    def jydocs_indexTag(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jydocs/indexTag", headers=headers, json={})
+        return response
+        # 文库搜索
+
+    def jydocs_search(self):
+        headers = GSTORE["headers"]
+        response = self.s.post(f"{cfg.target_host}/jydocs/search?keyWord=法律", headers=headers)
+        return response
+        # 文库详情
+
+    def jydocs_detail(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jydocs/detail?docId=docin-4756450426", headers=headers)
+        return response
+        # 留资提交2.0
+
+    def salesLeads_collectInfo(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/salesLeads/collectInfo", headers=headers,
+                               json={"source": "article_proposed_project", "name": "质量部测试", "phone": "18211989987",
+                                     "mail": "1550987547@qq.com", "industry": "", "company": "质量部测试企业",
+                                     "companyType": "投标企业", "position": "总裁", "workScope": "", "partnerNeeds": "",
+                                     "agree": True, "branch": ""})
+        return response
+        # 留资提交
+
+    def salesLeads_retainedCapital(self):
+        headers = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/salesLeads/retainedCapital", headers=headers,
+                               params={"source": "article_proposed_project"})
+        return response
 apimgr = APIMgr()