Răsfoiți Sursa

Merge branch 'feature/v1.0.1' of https://jygit.jydev.jianyu360.cn/Test/jianyu_auto_api into feature/v1.0.1

zangyamei 6 luni în urmă
părinte
comite
9fb324c9b3

+ 17 - 0
cases/pc/登录功能/数据/check_mailverify.py

@@ -0,0 +1,17 @@
+from hytest import *
+from lib.webapi import apimgr
+
+
+class c1:
+    name = "验证数据导出邮箱验证码"
+    def teststeps(self):
+        INFO("测试步骤")
+        STEP(1,"第一步调用函数")
+        res = apimgr.check_mailverify() #调用函数webapi里的check_mailverify函数
+        r = res.json() #用json格式返回
+        actural = r["success"]
+        STEP(2,"设置检查点")
+        CHECK_POINT("输入错误的邮箱验证码,返回值若为False,则代表此接口调用成功",actural == False)
+
+
+

+ 14 - 0
cases/pc/登录功能/数据/send_mailverify.py

@@ -0,0 +1,14 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = "发送邮箱验证码"
+    def teststeps(self):
+        INFO("测试步骤")
+        STEP(1, '第一步调用函数')
+        res=apimgr.send_mailverify()
+        r = res.json()
+        actural = r["success"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查设置发送邮箱验证码接口是否正常', actural == True)

+ 14 - 0
cases/pc/登录功能/数据/sievedata.py

@@ -0,0 +1,14 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = "数据导出筛选预览数据"
+    def teststeps(self):
+        INFO("测试步骤")
+        STEP(1,"第一步调用函数")
+        res = apimgr.preview_sievedata()
+        r = res.json()#用json格式返回
+        actural = r['data']['total']
+        STEP(2,"设置检查点")
+        CHECK_POINT("输入接口调用成功", actural >=1 )
+

+ 14 - 0
cases/pc/登录功能/登录/set_keeplogin.py

@@ -0,0 +1,14 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = "设置登录保持期"
+    def teststeps(self):
+        INFO("测试步骤")
+        STEP(1, '第一步调用函数')
+        res=apimgr.set_keeplogin()
+        r = res.json()
+        actural = r["flag"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查设置登录保持期接口是否正常', actural == True)

+ 16 - 0
cases/pc/登录功能/订阅/entnichenew_area.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    #测试用例名称
+    name='获取区域设置'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.entnichenew_area()
+        res = r.json()
+        actural  = res['error_code']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查大会员推送记录列表是否正常',actural ==0)

+ 16 - 0
cases/pc/登录功能/订阅/entnichenew_buyerclass.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    #测试用例名称
+    name='修改采购单位类型设置'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.entnichenew_buyesclass_update()
+        res = r.json()
+        actural  = res['error_code']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查采购单位类型设置是否正常',actural == 0)

+ 16 - 0
cases/pc/登录功能/订阅/entnichenew_info_type.py

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

+ 21 - 0
cases/pc/登录功能/订阅/keywords_get.py

@@ -0,0 +1,21 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='商机管理-获取关键词设置'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.keywords_get()
+        actural =res.json()
+        error_code=actural["error_code"]
+        status = actural['data']['status']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查商机管理获取关键词设置是否正常',error_code == 0 and status == 1)
+
+
+

+ 17 - 0
cases/pc/登录功能/订阅/ntnichenew_info_update.py

@@ -0,0 +1,17 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    #测试用例名称
+    name='修改信息类型'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.entnichenew_infotype_update()
+        res = r.json()
+        actural  = res['error_code']
+        actural1 = res['data']['status']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查信息类型修改设置是否正常',actural == 0 and actural1 == 1)

+ 20 - 0
cases/pc/登录功能/订阅/pushset_get.py

@@ -0,0 +1,20 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='商机管理-获取推送设置'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res=apimgr.pushset_get()
+        actural =res.json()
+        error_code=actural["error_code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查商机管理获取推送设置是否正常',error_code == 0)
+
+
+

+ 122 - 395
lib/webapi.py

@@ -1100,7 +1100,7 @@ class APIMgr():
         header = GSTORE['headers']
         response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/ClearUnreadMsg",headers = header)
         return response
-    #新商机管理-修改关键词设置
+    #新商机管理-企业订阅-修改关键词设置
     def update_keyword_entnichenew(self):
         header = GSTORE['headers']
         json = {
@@ -1109,407 +1109,15 @@ class APIMgr():
                     "a_key": [
                         {
                             "key": [
-                                "管理修改"
+                                "计算机"
                             ],
                             "notkey": [],
                             "matchway": 1
-                        },
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "软件"
-                            ],
-                            "keyindex": 2,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "科技信息"
-                            ],
-                            "keyindex": 3,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
                         }
                     ],
                     "groupIndex": 0,
                     "opened": True,
-                    "s_item": "科技信息",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "工程技术"
-                            ],
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "智慧屏"
-                            ],
-                            "keyindex": 1,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [
-                                "智能设备"
-                            ],
-                            "key": [
-                                "智能"
-                            ],
-                            "keyindex": 2,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "智能"
-                            ],
-                            "keyindex": 3,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 1,
-                    "opened": True,
-                    "s_item": "智能",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "物业"
-                            ],
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 2,
-                    "opened": True,
-                    "s_item": "物业",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "计算机"
-                            ],
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 3,
-                    "opened": True,
-                    "s_item": "计算机",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [
-                                "景观",
-                                "苗木",
-                                "栽植",
-                                "灌木",
-                                "室外",
-                                "公路绿化"
-                            ],
-                            "key": [
-                                "绿化"
-                            ],
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 4,
-                    "opened": True,
-                    "s_item": "绿化",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "groupIndex": 0,
-                            "groupName": "1",
-                            "key": [
-                                "造价表"
-                            ],
-                            "keyIndex": 0,
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [
-                                ""
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "groupIndex": 0,
-                            "groupName": "1",
-                            "key": [
-                                "天气预报"
-                            ],
-                            "keyIndex": 1,
-                            "keyindex": 1,
-                            "matchway": 1,
-                            "notkey": [
-                                ""
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "groupIndex": 0,
-                            "groupName": "1",
-                            "key": [
-                                "鼠标"
-                            ],
-                            "keyIndex": 2,
-                            "keyindex": 2,
-                            "matchway": 1,
-                            "notkey": [
-                                ""
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 5,
-                    "opened": True,
-                    "s_item": "1",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [],
-                    "groupIndex": 6,
-                    "opened": True,
-                    "s_item": "收不到推送",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "groupIndex": 2,
-                            "groupName": "测试",
-                            "key": [
-                                "软件工程"
-                            ],
-                            "keyIndex": 0,
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [
-                                ""
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "groupIndex": 2,
-                            "groupName": "测试",
-                            "key": [
-                                "测试"
-                            ],
-                            "keyIndex": 1,
-                            "keyindex": 1,
-                            "matchway": 1,
-                            "notkey": [
-                                ""
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "groupIndex": 2,
-                            "groupName": "测试",
-                            "key": [
-                                "修改"
-                            ],
-                            "keyIndex": 2,
-                            "keyindex": 2,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 7,
-                    "opened": True,
-                    "s_item": "测试",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "医疗"
-                            ],
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "医院"
-                            ],
-                            "keyindex": 1,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "工程"
-                            ],
-                            "keyindex": 2,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [],
-                            "groupIndex": 3,
-                            "groupName": "信息类",
-                            "key": [
-                                "信息"
-                            ],
-                            "keyIndex": 0,
-                            "keyindex": 3,
-                            "matchway": 1,
-                            "notkey": [
-                                ""
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [
-                                "技术"
-                            ],
-                            "groupIndex": 3,
-                            "groupName": "信息类",
-                            "key": [
-                                "信息"
-                            ],
-                            "keyIndex": 1,
-                            "keyindex": 4,
-                            "matchway": 0,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [
-                                "造价"
-                            ],
-                            "groupIndex": 3,
-                            "groupName": "信息类",
-                            "key": [
-                                "工程"
-                            ],
-                            "keyIndex": 2,
-                            "keyindex": 5,
-                            "matchway": 0,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 8,
-                    "opened": True,
-                    "s_item": "信息类",
-                    "showForm": False,
-                    "updatetime": 0
-                },
-                {
-                    "a_key": [
-                        {
-                            "appendkey": [],
-                            "key": [
-                                "旅游"
-                            ],
-                            "keyindex": 0,
-                            "matchway": 1,
-                            "notkey": [
-                                "游玩"
-                            ],
-                            "showForm": False,
-                            "updatetime": 0
-                        },
-                        {
-                            "appendkey": [
-                                "分析"
-                            ],
-                            "groupIndex": 4,
-                            "groupName": "软件工程",
-                            "key": [
-                                "测试"
-                            ],
-                            "keyIndex": 0,
-                            "keyindex": 1,
-                            "matchway": 1,
-                            "notkey": [],
-                            "showForm": False,
-                            "updatetime": 0
-                        }
-                    ],
-                    "groupIndex": 9,
-                    "opened": True,
-                    "s_item": "软件工程",
+                    "s_item": "测试分组",
                     "showForm": False,
                     "updatetime": 0
                 }
@@ -1519,6 +1127,125 @@ class APIMgr():
         response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/key/update", headers=header,json=json)
         return response
 
+    #获取区域设置
+    def entnichenew_area(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get",headers = headers)
+        return response
+
+    #商机管理-企业订阅-获取关键词设置
+    def keywords_get(self):
+        headers = GSTORE['headers']
+        data ={
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/key/get", headers=headers, data =data)
+        return response
+    #商机管理-企业订阅-获取推送设置
+    def pushset_get(self):
+        headers = GSTORE['headers']
+        data={
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/pushset/get", headers=headers, data=data)
+        return response
+
+    #设置登录保持期
+    def set_keeplogin(self):
+        headers = GSTORE['headers']
+        data = {
+            "isAutoLogin" : "true" ,
+            "loginER" : "NSg7BAFFBQMHBkZXRFpXRAsDBQJHBzwN___NjcAJDRFBQMHBkZXRFpXRAsDBQJHGTE8"
+        }
+        response = self.s.post(f"{cfg.target_host}/free/setKeepLogin",headers = headers ,data = data)
+        return response
+
+    #发送邮箱验证码
+    def send_mailverify(self):
+        headers = GSTORE["headers"]
+        data = {
+            "email" : "luwenna@topnet.net.cn"
+        }
+        response = self.s.post(f"{cfg.target_host}/front/dataExport/sendMailVerify",headers = headers , data = data)
+        return response
+
+    #验证数据导出邮箱验证码
+    def check_mailverify(self):
+        headers = GSTORE["headers"]
+        data = {
+            "emailVerity" : "YQ09Z1",
+            "email" : "luwenna@topnet.net.cn"
+        }
+        response = self.s.post(f"{cfg.target_host}/front/dataExport/checkMailVerify", headers = headers ,data = data)
+        return  response
+
+    #数据导出筛选预览数据
+    def preview_sievedata(self):
+        headers = GSTORE["headers"]
+        data = {
+            "publishtime": "1566214955 _1660909355",
+            "area": "北京",
+            "city": "成都市",
+            "region": "成都市,北京",
+            "industry": "建筑工程_勘察设计, 建筑工程_工程施工, 建筑工程_监理咨询, 建筑工程_材料设备, 建筑工程_机电安装",
+            "buyerclass": "党委办, 财政",
+            "keyword": [{
+                "keyword": "软件",
+                "appended": [],
+                "exclude": []
+            }],
+            "selectType": "filetext, title, detail, title",
+            "minprice": "0.1",
+            "maxprice": "1000000",
+            "subtype": "中标, 成交, 废标, 流标"
+        }
+        response =self.s.post(f"{cfg.target_host}/front/dataExport/sieveData",headers = headers ,data =data)
+        return response
+
+    # 修改采购单位类型设置
+    def entnichenew_buyesclass_update(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "buyer": [
+                "法院",
+                "发改"
+            ],
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get", headers=headers,json=json)
+        return response
+
+    # 获取信息类型
+    def entnichenew_infotype(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/index", headers=headers,json=json)
+        return response
+
+    # 修改信息类型
+    def entnichenew_infotype_update(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "msg": [
+                "预告",
+                "预审",
+                "预审结果",
+                "论证意见",
+                "需求公示"
+            ],
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/infotype/update", headers=headers,json=json)
+        return response
+
+
+
 apimgr = APIMgr()