Browse Source

Merge branch 'dev/v1.0.1' of Test/jianyu_auto_api into master

lizhikun 6 months ago
parent
commit
1845356197
86 changed files with 1648 additions and 116 deletions
  1. 1 1
      cases/app/登录/留资/app_new_uer_sales.py
  2. 1 1
      cases/app/登录/留资/new_uer_sales.py
  3. 16 0
      cases/app/登录/订阅/distribution_details.py
  4. 20 0
      cases/fragmentation/login_wxapi.py
  5. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_buyer_getList.py
  6. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_buyer_getSearchList.py
  7. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_getAdList.py
  8. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_getAllBusiness.py
  9. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_getAssName.py
  10. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_getPriceList.py
  11. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_getconfig.py
  12. 16 0
      cases/fragmentation/未登录/小程序信息获取/debrisproduct_location.py
  13. 8 0
      cases/fragmentation/登录/__st__.py
  14. 16 0
      cases/fragmentation/登录/情报/information_buzzword.py
  15. 16 0
      cases/fragmentation/登录/情报/information_details.py
  16. 16 0
      cases/fragmentation/登录/情报/information_search.py
  17. 16 0
      cases/fragmentation/登录/情报/information_subscription.py
  18. 28 0
      cases/fragmentation/登录/我的/debrisproduct_orderDetail.py
  19. 28 0
      cases/fragmentation/登录/我的/debrisproduct_orderList.py
  20. 16 0
      cases/fragmentation/登录/我的/myuser_information.py
  21. 16 0
      cases/fragmentation/登录/搜索/bidding_project_search.py
  22. 16 0
      cases/fragmentation/登录/搜索/purchase_intention_search.py
  23. 16 0
      cases/fragmentation/登录/监控/monitor_list.py
  24. 16 0
      cases/fragmentation/登录/监控/monitor_operate.py
  25. 16 0
      cases/fragmentation/登录/订阅/purchase_intention_subscription.py
  26. 16 0
      cases/fragmentation/登录/订阅/subscription_query.py
  27. 16 0
      cases/fragmentation/登录/订阅/subscription_region_modification.py
  28. 16 0
      cases/fragmentation/登录/订阅/subscription_service_type_changes.py
  29. 16 0
      cases/fragmentation/登录/订阅/tender_subscription.py
  30. 16 0
      cases/fragmentation/登录/详情/detail_page_information.py
  31. 16 0
      cases/fragmentation/登录/详情/detailed_information.py
  32. 16 0
      cases/fragmentation/登录/详情/purchasing_analysis.py
  33. 1 1
      cases/pc/未登录功能/三级页/nologin_proposed_construction_content.py
  34. 15 0
      cases/pc/未登录功能/三级页/nzj_details.py
  35. 0 1
      cases/pc/未登录功能/对外接口/bid_search_api.py
  36. 2 2
      cases/pc/登录功能/商机管理客户关注/customer_attention.py
  37. 1 1
      cases/pc/登录功能/定制化分析报告/behavior_acquisition.py
  38. 1 1
      cases/pc/登录功能/定制化分析报告/reports_advanced_projects.py
  39. 1 1
      cases/pc/登录功能/密码校验/password_check.py
  40. 20 0
      cases/pc/登录功能/工作台首页/workdesk_intelligence.py
  41. 17 0
      cases/pc/登录功能/工作台首页/workdesk_unread_messages.py
  42. 17 0
      cases/pc/登录功能/我的资产/goods_points.py
  43. 1 1
      cases/pc/登录功能/投标决策分析/bidding_decision_analysis_content.py
  44. 1 1
      cases/pc/登录功能/投标决策分析/buyer_name_lenovo.py
  45. 1 1
      cases/pc/登录功能/投标决策分析/project_name_lenovo.py
  46. 1 1
      cases/pc/登录功能/搜索功能/bidsearch.py
  47. 1 1
      cases/pc/登录功能/搜索功能/buyersearch.py
  48. 15 0
      cases/pc/登录功能/搜索功能/conditions.py
  49. 1 1
      cases/pc/登录功能/搜索功能/enterpriseSearch.py
  50. 1 1
      cases/pc/登录功能/搜索功能/rc_search.py
  51. 1 1
      cases/pc/登录功能/搜索功能/supplySearch.py
  52. 17 0
      cases/pc/登录功能/数据/check_mailverify.py
  53. 14 0
      cases/pc/登录功能/数据/send_mailverify.py
  54. 22 0
      cases/pc/登录功能/数据/sievedata.py
  55. 16 0
      cases/pc/登录功能/机构中心/add_personnel.py
  56. 17 0
      cases/pc/登录功能/机构中心/enterprise_information.py
  57. 16 0
      cases/pc/登录功能/机构中心/subdepartment.py
  58. 18 0
      cases/pc/登录功能/消息中心/clearunreadmsg.py
  59. 18 0
      cases/pc/登录功能/消息中心/message_markRead.py
  60. 16 0
      cases/pc/登录功能/消息中心/messagedetail.py
  61. 1 1
      cases/pc/登录功能/消息中心/messagelist.py
  62. 16 0
      cases/pc/登录功能/消息中心/msgopenlog.py
  63. 1 1
      cases/pc/登录功能/用户中台/actionMode_commonlyList.py
  64. 1 1
      cases/pc/登录功能/用户信息获取/authorised_info.py
  65. 1 1
      cases/pc/登录功能/留资/sample_report_information.py
  66. 14 0
      cases/pc/登录功能/登录/set_keeplogin.py
  67. 1 1
      cases/pc/登录功能/监控/new_project_attention.py
  68. 1 1
      cases/pc/登录功能/监控/project_screenarea.py
  69. 17 0
      cases/pc/登录功能/订阅/distribution_list.py
  70. 17 0
      cases/pc/登录功能/订阅/distribution_update.py
  71. 16 0
      cases/pc/登录功能/订阅/entnichenew_area.py
  72. 16 0
      cases/pc/登录功能/订阅/entnichenew_buyerclass.py
  73. 16 0
      cases/pc/登录功能/订阅/entnichenew_info_type.py
  74. 21 0
      cases/pc/登录功能/订阅/entnichenew_pushset_update.py
  75. 21 0
      cases/pc/登录功能/订阅/keywords_get.py
  76. 17 0
      cases/pc/登录功能/订阅/ntnichenew_info_update.py
  77. 20 0
      cases/pc/登录功能/订阅/pushset_get.py
  78. 21 0
      cases/pc/登录功能/订阅/update_keyword_entnichenew.py
  79. 1 1
      cases/pc/登录功能/身份信息获取/Identity_list.py
  80. 1 1
      cases/pc/登录功能/身份信息获取/Identity_switch.py
  81. BIN
      cases/未登录功能/__pycache__/bidsearch.cpython-38.pyc
  82. BIN
      cases/未登录功能/__pycache__/buyersearch.cpython-38.pyc
  83. 1 0
      cfg/cfg.py
  84. 33 90
      doc/zbsousuo.py
  85. 353 1
      lib/webapi.py
  86. 287 0
      lib/wxapi.py

+ 1 - 1
cases/app/登录/留资/app_new_uer_sales.py

@@ -15,4 +15,4 @@ class c1:
         # # INFO(length)
         # # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  code==200)
+        CHECK_POINT('检查app新用户报表提交接口是否正常',  code==200)

+ 1 - 1
cases/app/登录/留资/new_uer_sales.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0)
+        CHECK_POINT('检查获取新用户留资报表接口是否正常',  actural == 0)

+ 16 - 0
cases/app/登录/订阅/distribution_details.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='商机管理分发规则详情'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.distribution_details()
+        res = r.json()
+        actural  = res['error_code']
+        actural1 = res['data']['persons'][0]['id']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查商机管理分发规则详情接口是否正常',actural ==0 and actural1 ==96208)

+ 20 - 0
cases/fragmentation/login_wxapi.py

@@ -0,0 +1,20 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='小程序登录接口验证'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'打印接口返回值')    #会出现在测试报告中
+        r = apimgr.mgr_login_wxapi()
+        res = r.json()
+        INFO(res)
+        actural = res['data']['status']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查小程序登录接口是否正常',actural == 1)
+    #清除方法
+    def teardown(self):
+        INFO('用户退出app')
+        apimgr.mgr_logout_wxapi()

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_buyer_getList.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '业主单位列表'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getAssName()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查业主单位列表接口是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_buyer_getSearchList.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '业主搜索历史'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_buyer_getSearchList()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查业主搜索历史接口是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_getAdList.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '获取小程序广告位'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getAdList()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查广告位是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_getAllBusiness.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '所有商机获取'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getAllBusiness()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查获取商机接口是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_getAssName.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '业主单位名称联想'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getAssName()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查业主单位名称联想接口是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_getPriceList.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '获取产品价格'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getPriceList()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查获取产品价格接口是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_getconfig.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '获取小程序配置'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getLocation()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查获取小程序配置接口是否正常',actural1 == 0)

+ 16 - 0
cases/fragmentation/未登录/小程序信息获取/debrisproduct_location.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '获取地理位置'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.debrisproduct_getLocation()
+        r = res.json()
+        INFO(r)
+
+        actural1=r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查获取位置接口是否正常',actural1 == 0)

+ 8 - 0
cases/fragmentation/登录/__st__.py

@@ -0,0 +1,8 @@
+from hytest import *
+from lib.wxapi import apimgr
+def suite_setup():
+    INFO('用户登录')
+    apimgr.mgr_login_wxapi()
+def suite_teardown():
+    INFO('用户退出')
+    apimgr.mgr_logout_wxapi()

+ 16 - 0
cases/fragmentation/登录/情报/information_buzzword.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='情报热词'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.information_buzzword()
+        r = res.json()
+        INFO(r)
+        actural = r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查情报热词接口是否正常', actural == 0)

+ 16 - 0
cases/fragmentation/登录/情报/information_details.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='情报详情'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.information_details()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['id']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查情报详情接口是否正常', actural == "61cbb70345a326c6c34a5e0e")

+ 16 - 0
cases/fragmentation/登录/情报/information_search.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='情报列表/搜索-搜索'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.information_search()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查情报列表/搜索接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/情报/information_subscription.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='情报列表/搜索-订阅'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.information_subscription()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查情报列表/搜索-订阅接口是否正常', actural >= 0)

+ 28 - 0
cases/fragmentation/登录/我的/debrisproduct_orderDetail.py

@@ -0,0 +1,28 @@
+from hytest import *
+from lib.wxapi import apimgr
+
+class c1:
+    name = '获取订单详情'
+
+    def teststeps(self):
+        INFO('测试步骤')
+
+        # STEP 1: 调用获取订单详情接口
+        STEP(1, '调用获取订单详情接口')
+        try:
+            # 确保传递正确的 orderCode 参数
+            orderCode = '262059625763'  # 你可以替换为实际的订单号
+            res = apimgr.debrisproduct_orderDetail(orderCode=orderCode)  # 调用接口并传递参数
+            r = res.json()  # 解析返回的 JSON
+            INFO(f"返回数据: {r}")  # 打印返回数据,帮助调试
+
+        except Exception as e:
+            INFO(f'获取订单详情失败: {e}')  # 打印异常信息
+            raise
+
+        # STEP 2: 设置检查点
+        STEP(2, '设置检查点')
+        # 获取 error_code,默认值为 -1,防止没有该字段时报错
+        actual_error_code = r.get('error_code', -1)
+        CHECK_POINT('检查获取订单详情接口是否正常', actual_error_code == 0)
+

+ 28 - 0
cases/fragmentation/登录/我的/debrisproduct_orderList.py

@@ -0,0 +1,28 @@
+from hytest import *
+from lib.wxapi import apimgr
+
+class c1:
+    name = '获取订单列表'
+
+    def teststeps(self):
+        INFO('测试步骤')
+
+        # STEP 1: 调用获取订单详情接口
+        STEP(1, '调用获取订单列表接口')
+        try:
+            # 确保传递正确的 orderCode 参数
+            orderCode = '262059625763'  # 你可以替换为实际的订单号
+            res = apimgr.debrisproduct_orderDetail(orderCode=orderCode)  # 调用接口并传递参数
+            r = res.json()  # 解析返回的 JSON
+            INFO(f"返回数据: {r}")  # 打印返回数据,帮助调试
+
+        except Exception as e:
+            INFO(f'获取订单详情失败: {e}')  # 打印异常信息
+            raise
+
+        # STEP 2: 设置检查点
+        STEP(2, '设置检查点')
+        # 获取 error_code,默认值为 -1,防止没有该字段时报错
+        actual_error_code = r.get('error_code', -1)
+        CHECK_POINT('检查获取订单列表接口是否正常', actual_error_code == 0)
+

+ 16 - 0
cases/fragmentation/登录/我的/myuser_information.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='我的用户信息'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'打印接口返回值')    #会出现在测试报告中
+        r = apimgr.myuser_information()
+        res = r.json()
+        INFO(res)
+        actural = res['error_code']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查我的用户信息接口是否正常',actural == 0)

+ 16 - 0
cases/fragmentation/登录/搜索/bidding_project_search.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='招标项目搜索-搜索入口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.bidding_project_search()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查招标项目搜索-搜索入口接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/搜索/purchase_intention_search.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='采购意向搜索-搜索入口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.purchase_intention_search()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查采购意向搜索-搜索入口接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/监控/monitor_list.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='监控列表'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.monitor_list()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['count']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查监控列表接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/监控/monitor_operate.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='监控操作'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.monitor_operate()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['status']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查监控操作接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/订阅/purchase_intention_subscription.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='采购意向搜索-订阅入口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.purchase_intention_subscription()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查采购意向搜索-订阅入口接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/订阅/subscription_query.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='订阅查询'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.subscription_query()
+        r = res.json()
+        INFO(r)
+        actural = r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查订阅查询接口是否正常', actural == 0)

+ 16 - 0
cases/fragmentation/登录/订阅/subscription_region_modification.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='订阅区域修改'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.subscription_region_modification()
+        r = res.json()
+        INFO(r)
+        actural = r['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查订阅区域修改接口是否正常', actural == 0)

+ 16 - 0
cases/fragmentation/登录/订阅/subscription_service_type_changes.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='订阅业务类型修改'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.subscription_service_type_changes()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['status']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查订阅业务类型修改接口是否正常', actural == 1)

+ 16 - 0
cases/fragmentation/登录/订阅/tender_subscription.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='招标项目搜索-订阅入口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.tender_subscription()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['total']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查招标项目搜索-订阅入口接口是否正常', actural >= 0)

+ 16 - 0
cases/fragmentation/登录/详情/detail_page_information.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='详情页信息'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.detail_page_information()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['ErrorCode']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查详情页信息接口是否正常', actural == 0)

+ 16 - 0
cases/fragmentation/登录/详情/detailed_information.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+class c1:
+    #测试用例名称
+    name='详情页信息-投标'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.detailed_information()
+        r = res.json()
+        INFO(r)
+        actural = r['data']['ErrorCode']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查详情页信息-投标接口是否正常', actural == 0)

+ 16 - 0
cases/fragmentation/登录/详情/purchasing_analysis.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.wxapi import apimgr
+
+class c1:
+    name = '采购单位分析'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.purchasing_analysis()
+        r = res.json()
+        INFO(r)
+        actural=r['error_code']
+        # INFO(length)
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查采购单位分析接口是否正常',  actural == 0)

+ 1 - 1
cases/pc/未登录功能/三级页/nologin_proposed_construction_content.py

@@ -14,4 +14,4 @@ class c1:
         actural = r['data']
         actural = r['data']
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查数据导出接口是否正常', len(actural) >1)
+        CHECK_POINT('检查未登录拟在建详情页接口是否正常', len(actural) >1)

+ 15 - 0
cases/pc/未登录功能/三级页/nzj_details.py

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '未登录拟在建项目详情页'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.nzj_details()#调用 webapi.apimgr 模块中的 nzj_details 方法
+        r = res.json()#将 API 响应内容解析为 JSON 格式,并存储在变量 r 中
+        INFO(r)#输出完整的 API 响应内容,方便调试和查看
+        actural=r['error_code']#actural:用来存储从 API响应的 JSON 数据中提取的 'error_code' 键对应的值
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('未登录拟在建项目详情页接口是否正常',  actural == 0 )#断言检查,设置了一个检查点,用来验证 'error_code' 是否等于 0

+ 0 - 1
cases/pc/未登录功能/对外接口/bid_search_api.py

@@ -9,7 +9,6 @@ class c2:
         STEP(1,'第一步调用函数')    #会出现在测试报告中
         STEP(1,'第一步调用函数')    #会出现在测试报告中
         res = apimgr.bid_search_api()
         res = apimgr.bid_search_api()
         actural = res.json()
         actural = res.json()
-        INFO(actural)
         error_msg = actural["error_msg"]
         error_msg = actural["error_msg"]
         page_count = actural["data"]["pageCount"]
         page_count = actural["data"]["pageCount"]
         STEP(2,'第二步设置检查点')
         STEP(2,'第二步设置检查点')

+ 2 - 2
cases/pc/登录功能/商机管理客户关注/customer_attention.py

@@ -10,7 +10,7 @@ class c2:
         res = apimgr.customer_attention()
         res = apimgr.customer_attention()
         actural = res.json()
         actural = res.json()
         INFO(actural)
         INFO(actural)
-        limit_count=actural["data"]["limit_count"]
+        limit_count=actural["error_code"]
         STEP(2,'第二步设置检查点')
         STEP(2,'第二步设置检查点')
         #设置检查点
         #设置检查点
-        CHECK_POINT('商机管理用户关注接口是否正常',limit_count>0)
+        CHECK_POINT('商机管理用户关注接口是否正常',limit_count == 0)

+ 1 - 1
cases/pc/登录功能/定制化分析报告/behavior_acquisition.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0 )
+        CHECK_POINT('检查行为采集接口是否正常',  actural == 0 )

+ 1 - 1
cases/pc/登录功能/定制化分析报告/reports_advanced_projects.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0)
+        CHECK_POINT('检查定制化分析报告_超前项目接口是否正常',  actural == 0)

+ 1 - 1
cases/pc/登录功能/密码校验/password_check.py

@@ -13,4 +13,4 @@ class c1:
         actural1=r['error_code']
         actural1=r['error_code']
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户信息',actural1 == 0)
+        CHECK_POINT('检查密码检查接口是否正常',actural1 == 0)

+ 20 - 0
cases/pc/登录功能/工作台首页/workdesk_intelligence.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.workdesk_intelligence()
+        #把文本转为json格式
+        #actural =json.loads(res.text)
+        actural =res.json()
+        #INFO(actural),打印
+        code=actural["code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查工作桌面商机情报列表接口是否正常',code == 0)

+ 17 - 0
cases/pc/登录功能/工作台首页/workdesk_unread_messages.py

@@ -0,0 +1,17 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='工作桌面首页未读消息数量接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.workdesk_unread_messages()
+        actural =res.json()
+        unread=actural["unread"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查工作桌面首页未读消息数量接口是否正常',unread >= 0)

+ 17 - 0
cases/pc/登录功能/我的资产/goods_points.py

@@ -0,0 +1,17 @@
+import json
+
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='商品积分查询接口'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        res = apimgr.goods_points()
+        actural =res.json()
+        error_code=actural["error_code"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查工作桌面商机情报列表接口是否正常',error_code == 0)

+ 1 - 1
cases/pc/登录功能/投标决策分析/bidding_decision_analysis_content.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 1004 )
+        CHECK_POINT('检查投标决策分析内容接口是否正常',  actural == 1004 )

+ 1 - 1
cases/pc/登录功能/投标决策分析/buyer_name_lenovo.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0 )
+        CHECK_POINT('检查采购单位名称联想接口是否正常',  actural == 0 )

+ 1 - 1
cases/pc/登录功能/投标决策分析/project_name_lenovo.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0 )
+        CHECK_POINT('检查项目名称联想接口是否正常',  actural == 0 )

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

@@ -12,4 +12,4 @@ class c2:
         INFO(res)
         INFO(res)
         STEP(2,'第二步设置检查点')
         STEP(2,'第二步设置检查点')
         #设置检查点
         #设置检查点
-        CHECK_POINT('检查搜索接口是否正常',code == 200)
+        CHECK_POINT('检查招标搜索接口是否正常',code == 200)

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

@@ -13,4 +13,4 @@ class c5:
         error_code = response_data["error_code"]
         error_code = response_data["error_code"]
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查搜索接口是否正常', error_code == 0)
+        CHECK_POINT('检查采购单位搜索接口是否正常', error_code == 0)

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

@@ -0,0 +1,15 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '拟在建搜索条件接口'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res=apimgr.conditions()#调用 apimgr 模块中的 conditions 方法
+        r = res.json()#将 API 响应内容解析为 JSON 格式,并存储在变量 r 中
+        INFO(r)#输出完整的 API 响应内容,方便调试和查看
+        actural=r['error_code']#actural:用来存储从 API响应的 JSON 数据中提取的 'error_code' 键对应的值
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('拟在建搜索条件接口是否正常',  actural == 0 )#断言检查,设置了一个检查点,用来验证 'error_code' 是否等于 0

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

@@ -20,4 +20,4 @@ class c3:
 
 
         STEP(2,'第二步设置检查点')
         STEP(2,'第二步设置检查点')
         #设置检查点
         #设置检查点
-        CHECK_POINT('检查登录接口是否正常',textactual_legal_person == '田小亮')
+        CHECK_POINT('检查企业搜索接口是否正常',textactual_legal_person == '田小亮')

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

@@ -15,4 +15,4 @@ class c6:
         count = response_data["data"]["count"]
         count = response_data["data"]["count"]
         STEP(2,'第二步设置检查点')
         STEP(2,'第二步设置检查点')
         #设置检查点
         #设置检查点
-        CHECK_POINT('检查搜索接口是否正常',count > 0)
+        CHECK_POINT('检查融创用户招标搜索接口是否正常',count > 0)

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

@@ -13,4 +13,4 @@ class c4:
         res = json.loads(r.content.decode('utf-8'))
         res = json.loads(r.content.decode('utf-8'))
         STEP(2,'第二步设置检查点')
         STEP(2,'第二步设置检查点')
         #设置检查点
         #设置检查点
-        CHECK_POINT('检查搜索接口是否正常',res['data']['ckeys'] == 'PH计')
+        CHECK_POINT('检查供应搜索接口是否正常',res['data']['ckeys'] == 'PH计')

+ 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)

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

@@ -0,0 +1,22 @@
+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格式返回
+        INFO(r)
+
+        # 获取数据中的 _id 字段
+        data_list = r['data']['list']
+
+        # STEP 2: 检查 _id 是否存在
+        STEP(2, "检查 _id 字段是否存在")
+        for item in data_list:
+            _id = item.get('_id')  # 获取 _id 字段
+            CHECK_POINT(f"检查 _id 字段存在: {_id is not None}", _id is not None)

+ 16 - 0
cases/pc/登录功能/机构中心/add_personnel.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '添加人员'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.add_personnel()
+        resp = res.json()
+        error_code = resp['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查添加人员接口是否正常', error_code==0)

+ 17 - 0
cases/pc/登录功能/机构中心/enterprise_information.py

@@ -0,0 +1,17 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '企业信息'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.enterprise_information()
+        resp = res.json()
+        error_code = resp['error_code']
+        actural = resp['data']['admin_system']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查企业信息接口是否正常', error_code==0 and actural==False)

+ 16 - 0
cases/pc/登录功能/机构中心/subdepartment.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '子部门'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.subdepartment()
+        resp = res.json()
+        error_code = resp['error_code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查企业子部门接口是否正常', error_code==0)

+ 18 - 0
cases/pc/登录功能/消息中心/clearunreadmsg.py

@@ -0,0 +1,18 @@
+import json
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '一键清空未读消息'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.clear_unread_msg()
+        resp = res.json()
+        mes = resp["message"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('验证message是否为空', mes =="")
+
+

+ 18 - 0
cases/pc/登录功能/消息中心/message_markRead.py

@@ -0,0 +1,18 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '点击查看消息消息状态修改成已读'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.get_markread()
+        resp = res.json()
+        error_code = resp['code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查未读消息状态修改成已读接口是否正常', error_code == 0)
+
+    def teardown(self):
+        INFO('清除方法')

+ 16 - 0
cases/pc/登录功能/消息中心/messagedetail.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '查看消息详情'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.messagedetail()
+        resp = res.json()
+        error_code = resp['code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查推送记录接口是否正常', error_code==0)

+ 1 - 1
cases/pc/登录功能/消息中心/messagelist.py

@@ -13,6 +13,6 @@ class c1:
         error_code = resp['code']
         error_code = resp['code']
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查推送记录接口是否正常', error_code==0)
+        CHECK_POINT('检查消息中心列表接口是否正常', error_code==0)
     def teardown(self):
     def teardown(self):
         INFO('清除方法')
         INFO('清除方法')

+ 16 - 0
cases/pc/登录功能/消息中心/msgopenlog.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+import json
+
+class c1:
+    name = '消息查看记录'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.msgopenlog()
+        resp = res.json()
+        error_code = resp['code']
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查推送记录接口是否正常', error_code==0)

+ 1 - 1
cases/pc/登录功能/用户中台/actionMode_commonlyList.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0)
+        CHECK_POINT('检查常用功能列表获取接口是否正常',  actural == 0)

+ 1 - 1
cases/pc/登录功能/用户信息获取/authorised_info.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查权益中台是否正常',  actural == 0)
+        CHECK_POINT('检查功能是否授权是否正常',  actural == 0)

+ 1 - 1
cases/pc/登录功能/留资/sample_report_information.py

@@ -13,4 +13,4 @@ class c1:
         # INFO(length)
         # INFO(length)
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户中台接口是否正常',  actural == 0 )
+        CHECK_POINT('检查获取样例报告信息接口是否正常',  actural == 0 )

+ 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)

+ 1 - 1
cases/pc/登录功能/监控/new_project_attention.py

@@ -14,4 +14,4 @@ class c1:
         error_code = response_data["error_code"]
         error_code = response_data["error_code"]
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查数据导出接口是否正常', error_code == -1 )
+        CHECK_POINT('检查新增项目关注接口是否正常', error_code == -1 )

+ 1 - 1
cases/pc/登录功能/监控/project_screenarea.py

@@ -13,4 +13,4 @@ class c1:
         actural=r['error_code']
         actural=r['error_code']
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查数据导出接口是否正常', actural == 0 )
+        CHECK_POINT('检查关注项目地区筛选接口是否正常', actural == 0 )

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

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

+ 17 - 0
cases/pc/登录功能/订阅/distribution_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.distribution_update()
+        res = r.json()
+        #INFO(res)
+        actural  = res['error_code']
+        actural1 = res['data']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查商机管理分发规则修改接口是否正常',actural ==0 and actural1 ==1)

+ 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/登录功能/订阅/entnichenew_pushset_update.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.entnichenew_pushset_update()
+        actural =res.json()
+        error_code=actural["error_code"]
+        status=actural["data"]["status"]
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查商机管理修改推送设置是否正常',error_code == 0 and status == 1)
+
+
+

+ 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 )
+
+
+

+ 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)
+
+
+

+ 21 - 0
cases/pc/登录功能/订阅/update_keyword_entnichenew.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.update_keyword_entnichenew()
+        actural =res.json()
+        error_code=actural["error_code"]
+        status=actural['data']['status']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查商机管理修改关键词设置是否正常',error_code == 0 and status==1)
+
+
+

+ 1 - 1
cases/pc/登录功能/身份信息获取/Identity_list.py

@@ -11,4 +11,4 @@ class c1:
         actural1=r['error_code']
         actural1=r['error_code']
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户信息',actural1 == 0)
+        CHECK_POINT('检查身份信息获取接口是否正常',actural1 == 0)

+ 1 - 1
cases/pc/登录功能/身份信息获取/Identity_switch.py

@@ -13,4 +13,4 @@ class c1:
         actural1=r['data']
         actural1=r['data']
         STEP(2, '第二步设置检查点')
         STEP(2, '第二步设置检查点')
         # 设置检查点
         # 设置检查点
-        CHECK_POINT('检查用户信息',actural1 == 1)
+        CHECK_POINT('检查身份信息切换接口是否正常',actural1 == 1)

BIN
cases/未登录功能/__pycache__/bidsearch.cpython-38.pyc


BIN
cases/未登录功能/__pycache__/buyersearch.cpython-38.pyc


+ 1 - 0
cfg/cfg.py

@@ -1,3 +1,4 @@
 target_host = 'https://www.jianyu360.cn'
 target_host = 'https://www.jianyu360.cn'
 target_host_app = 'https://app-a1.jianyu360.cn'
 target_host_app = 'https://app-a1.jianyu360.cn'
 target_host_api = 'https://api.jianyu360.com'
 target_host_api = 'https://api.jianyu360.com'
+target_host_wxapi = 'https://jy-applet.jianyu360.cn'

+ 33 - 90
doc/zbsousuo.py

@@ -1,90 +1,33 @@
-import json
-
-import requests
-
-headers1 = {
-    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67"
-}
-
-url = "https://www.jianyu360.cn/phone/login"
-data={
-"reqType": "phoneLogin",
-"isAutoLogin": "false",
-"phone": "18211989987",
-"password": "123456"
-}
-res = requests.post(url=url,headers=headers1,data=data)
-print(res)
-assert res.status_code==200
-assert res.json()["status"] == 1
-assert res.json()["userInfo"]["result"] == "ok"
-assert res.json()["userInfo"]["s_nickname"] == "182****9987"
-cookies=res.cookies
-# print(cookies)
-# print(res.status_code)
-print(res.json())
-cookie_dict = cookies.get_dict()
-session_id = cookie_dict.get("SESSIONID")
-headers = {
-"Content-Type": "application/json",
-"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67",
-    "Cookie": f"SESSIONID={session_id}"
-}
-# print(headers)
-# url = "https://www.jianyu360.cn/jylab/supsearch/index.html"
-# data={
-# "keywords": "建筑",
-# "publishtime": "fiveyear",
-# "selectType": "content"
-# }
-
-# response = requests.post(url=url, headers=headers,data=data)
-# text=response.text
-# print(text)
-# response_text = response.text  # 假设 response 是请求的响应对象,将响应体保存在 response_text 变量中
-
-# 提取 keys 的值
-# keys_value = response_text.split('var keys = "', 1)[-1].split('"', 1)[0]
-
-# 断言 keys 等于 "建筑"
-# assert keys_value == "建筑"
-# url3="https://www.jianyu360.cn/succbi/api/dw/services/queryData"
-# data={"query":
-#           {"resid":"rk6LnRZndKIcnSYLtlpwVG","fields":[{"name":"XMLBDMHZ"}],"sources":"null","filter":[],"params":
-#               [{"name":"searchinput3","value":"科技"}],"sort":[],"options":
-#               {"limit":1,"offset":0,"needResultFilter":"true","queryTotalRowCount":"false"},"queryId":"model6"},
-#                 "resid":"rk6LnRZndKIcnSYLtlpwVG"}
-# rseb=requests.post(url=url,data=data,headers=headers)
-# print(rseb.text)
-# url="https://www.jianyu360.cn/publicapply/enterpriseSearch/doQuery"
-# data={
-# "match": "北京剑鱼信息技术有限公司河南分公司",
-# "matchType": "A",
-# "pageSize": "10",
-# "pageNum": "0"
-# }
-# qq=requests.post(url=url,data=data,headers=headers)
-# print(qq.text)
-
-url2 = "https://www.jianyu360.cn/jyapi/jybx/buyer/eType/buyerList"
-data = {
-    "buyerName": "万达信息股份有限公司",
-    "province": [],
-    "city": [],
-    "buyerClass": [],
-    "isCheckFollow": True,
-    "isCheckReceive": True,
-    "isContact": 0,
-    "pageSize": 10,
-    "pageNum": 1
-}
-
-response = requests.post(url=url2, data=json.dumps(data), headers=headers)
-
-
-print(response.text)
-url3="https://www.jianyu360.cn/jyinfo/supplySearch"
-data={"keywords":"PH计","searchType":"title","province":"","city":"","time":"","status":"0","pageSize":50,"pageIndex":1}
-resa=requests.post(url=url3,headers=headers,data=json.dumps(data))
-res = json.loads(resa.content.decode('utf-8'))
-assert res['data']['ckeys'] == 'PH计'
+from hytest import *
+from lib.webapi import apimgr
+
+
+class c1:
+    name = '我的'
+
+    def teststeps(self):
+        INFO('测试步骤')
+
+        # STEP 1: 调用小程序登录接口,获取 cookies
+        STEP(1, '调用小程序登录接口获取 cookies')
+        try:
+            apimgr.mgr_get_cookie(phone='15037870765', token='8817684142977367381')
+            INFO('Cookies 获取成功')
+        except Exception as e:
+            INFO(f'获取 Cookies 失败: {e}')
+            raise
+
+        # STEP 2: 调用获取订单详情接口
+        STEP(2, '调用获取订单详情接口')
+        try:
+            res = apimgr.debrisproduct_orderDetail(order_id='12345')
+            r = res.json()
+            INFO(r)
+        except Exception as e:
+            INFO(f'调用订单详情接口失败: {e}')
+            raise
+
+        # STEP 3: 设置检查点
+        STEP(3, '设置检查点')
+        actual_error_code = r.get('error_code')
+        CHECK_POINT('检查获取订单详情接口是否正常', actual_error_code == 0)

+ 353 - 1
lib/webapi.py

@@ -42,9 +42,15 @@ class APIMgr():
     headers = {
     headers = {
         "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67;jy-test"
         "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67;jy-test"
     }
     }
-
+    # 定义第二个 headers
+    headers_1 = {
+        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67;jy-test",
+        "Content-Type":"application/json",
+        "MiniprogramCode":"wy_zbxm"
+    }
     #headers设置为全局变量
     #headers设置为全局变量
     GSTORE['headers'] = headers
     GSTORE['headers'] = headers
+    GSTORE['headers_1'] = headers_1
     # session对象设置为全局变量
     # session对象设置为全局变量
     s = requests.Session()
     s = requests.Session()
     GSTORE['s'] = s
     GSTORE['s'] = s
@@ -359,6 +365,16 @@ class APIMgr():
         })
         })
         return response
         return response
 
 
+    #点击查看消息消息状态修改成已读
+    def get_markread(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+           "msgId":285266
+         }
+        response = s.post(f"{cfg.target_host}/jyapi/messageCenter/markRead", headers=hearders,json=json)
+        return response
+
     """用户中台"""
     """用户中台"""
     def get_userCenter(self):
     def get_userCenter(self):
         hearders = GSTORE['headers']
         hearders = GSTORE['headers']
@@ -1029,6 +1045,342 @@ class APIMgr():
         header = GSTORE['headers']
         header = GSTORE['headers']
         response = self.s.post(f"{cfg.target_host}/bigmember/search/buyer/association?name=河南科技大学", headers=header)
         response = self.s.post(f"{cfg.target_host}/bigmember/search/buyer/association?name=河南科技大学", headers=header)
         return response
         return response
+    #消息查看记录
+    def msgopenlog(self):
+        header = GSTORE['headers']
+        data={
+    "msgLogId":287204,
+    "platform":1}
+        response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/msgOpenLog",headers=header,json=data)
+        return response
+
+    #查看消息详情
+    def messagedetail(self):
+        header = GSTORE['headers']
+        data={
+    "msgLogId":240818
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/messageDetail",headers=header,json=data)
+        return response
+
+    #拟在建搜索条件接口
+    def conditions(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/front/project/nzj/conditions",headers=header)
+        return response
+
+    # 工作桌面商机情报列表
+    def workdesk_intelligence(self):
+        header = GSTORE['headers']
+        data = {
+            "msgType": 5,
+            "needDealtWithCount": True,
+            "offset": 1,
+            "size": 5
+        }
+        response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/WorkDeskList", headers=header, json=data)
+        return response
+    #商品积分查询
+    def goods_points(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jyintegral/productPoints/introduction",headers=header)
+        return response
+    #工作桌面首页-我的消息-未读消息数量
+    def workdesk_unread_messages(self):
+        header = GSTORE['headers']
+        json ={
+            "size": 20,
+            "msgType": -1,
+            "offset": 1,
+            "isRead": 0,
+            "isColumn": False,
+            "isColumnNewMsg": False,
+            "isContainLetter": False,
+            "isMsgList": False
+        }
+
+        response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=header,json=json)
+        return response
+    #一键清空未读消息
+    def clear_unread_msg(self):
+        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 = {
+            "a_items": [
+                {
+                    "a_key": [
+                        {
+                            "key": [
+                                "计算机"
+                            ],
+                            "notkey": [],
+                            "matchway": 1
+                        }
+                    ],
+                    "groupIndex": 0,
+                    "opened": True,
+                    "s_item": "测试分组",
+                    "showForm": False,
+                    "updatetime": 0
+                }
+            ],
+            "identity": "ent"
+        }
+        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
+    #商机管理-企业订阅-修改推送设置
+    def entnichenew_pushset_update(self):
+        headers = GSTORE['headers']
+        data = {
+            "ratemode": 2,
+            "apppush": 1,
+            "mailpush": 1,
+            "matchway": 2,
+            "wxpush": 1,
+            "matchmode": "title,detail",
+            "switch": 1,
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/pushset/update", headers=headers,data=data)
+        return response
+
+    #未登录“拟在建项目”详情页
+    def nzj_details(self):
+        headers = GSTORE['headers']
+        params = {
+           "pid":"040709005b58070d4a46020952075350590c1d4302530802"
+        }
+        response = self.s.get(f"{cfg.target_host}/front/project/nzj/details", headers=headers,params=params)
+        return response
+    #获取小程序广告位
+    def debrisproduct_getAdList(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getAdList", headers=headers_1,data={"Code":"jy-appsearch-home-top"})
+        return response
+    #获取地理位置
+    def debrisproduct_getLocation(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.get(f"{cfg.target_host_wxapi}/debrisproduct/free/location", headers=headers_1)
+        return response
+    #所有商机获取
+    def debrisproduct_getAllBusiness(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getAllBusiness", headers=headers_1)
+        return response
+    #获取小程序配置
+    def debrisproduct_getConfig(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getSetting", headers=headers_1)
+        return response
+    #业主单位名称联想
+    def debrisproduct_getAssName(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getAssName", headers=headers_1,data={"buyerName":"科技"})
+        return response
+    #业主单位列表
+    def debrisproduct_getList(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getList", headers=headers_1,data={"page_num":10,"pagesize":1})
+        return response
+    #业主搜索历史
+    def debrisproduct_buyer_getSearchList(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getSearchList", headers=headers_1)
+        return response
+    #获取价格列表
+    def debrisproduct_getPriceList(self):
+        headers_1 = GSTORE['headers_1']
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/getPriceList", headers=headers_1)
+        return response
+
+    """子部门"""
+    def subdepartment(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        data = {
+            "id":26741
+        }
+        response = s.post(f"{cfg.target_host}/entbase/department/childrens", headers=hearders, data=data)
+        return response
+
+    """添加人员"""
+    def add_personnel(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        data = {
+            "name":"贾路瑶",
+            "phone":"19588533063",
+            "id":26741
+        }
+        response = s.post(f"{cfg.target_host}/entbase/person/add", headers=hearders, data=data)
+        return response
+
+    """企业信息"""
+    def enterprise_information(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        params= {
+            "t":"1736561573400"
+        }
+        response = s.get(f"{cfg.target_host}/entbase/ent/entinfo", headers=hearders, params=params)
+        return response
+
+    """分发设置列表接口"""
+    def distribution_list(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        data= {
+            "identity":"ent"
+        }
+        response = s.get(f"{cfg.target_host}/entnicheNew/distribute/list", headers=hearders, data=data)
+        return response
+
+    """分发规则修改接口"""
+    def distribution_update(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json= {
+            "id": "67820b98e7364a57c3b7eaf5",
+            "buyerclass": ["财政"],
+            "items": ["测试分组"],
+            "persons": [96208],
+            "area": {"安徽": []},
+            "district": {},
+            "identity": "ent"
+        }
+        response = s.get(f"{cfg.target_host}/entnicheNew/distribute/update", headers=hearders, json=json)
+        return response
+
+    """分发规则详情接口"""
+    def distribution_details(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        data= {
+            "identity": "ent"
+        }
+        response = s.get(f"{cfg.target_host_app}/entnicheNew/distribute/detail?id=67820b98e7364a57c3b7eaf5", headers=hearders, data=data)
+        return response
 
 
 apimgr = APIMgr()
 apimgr = APIMgr()
 
 

+ 287 - 0
lib/wxapi.py

@@ -0,0 +1,287 @@
+import json
+import requests
+from hytest.common import *
+from cfg import cfg
+from bs4 import BeautifulSoup
+from requests.packages import urllib3
+
+#存放公用方法
+# 存储 全局共享 数据
+GSTORE = {}
+class APIMgr():
+    #打印https请求与消息
+    def __init__(self):
+        self.ui = None
+        self.token = None
+
+    def printRequest(self,req):
+        if req.body==None:
+            msgBody=''
+        else:
+            msgBody=req.body
+        self.ui.outputWindow.append(
+            '{}\n{}\n{}\n\n{}'.format(
+                '\n\n-------发送请求--------',
+                req.method+''+req.url,
+                '\n'.join('{}:{}'.format(k,v) for k,v in req.headers.items()),
+                msgBody,
+            ))
+
+    # 打印http相应消息的函数
+    def printResponse(self, response):
+        print('\n\n----- https response begin    -----')
+        print(response.status_code)
+        # print(response.headers)
+        for k, v in response.headers.items():
+            print(f'{k}:{v}')
+
+        print(response.content.decode('utf8'))
+        print('----- https response end-----\n\n')
+
+
+    headers = {
+        'Accept-Charset':'utf-8',
+        'Accept':'*/*',
+        'Accept-Encoding':'gzip, deflate, br',
+        'User-Agent':'Apifox/1.0.0 (https://apifox.com)',
+        'Content-Type':'application/json',
+         'MiniprogramCode':'wy_zbxm'
+    }
+
+    #headers设置为全局变量
+    GSTORE['headers'] = headers
+    # session对象设置为全局变量
+    s = requests.Session()
+    GSTORE['s'] = s
+
+    # 小程序登录接口
+    def mgr_login_wxapi(self, useproxies=False):
+        headers=GSTORE['headers']
+        s = GSTORE['s']
+        if useproxies:
+            self.s.proxies.update({'http':'127.0.0.1:8888'})
+        response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/autologin",headers=headers,json=
+                                    {
+                                     'phone':'15037870765',
+                                     'token':'8817684142977367381'
+                                    })
+        self.printResponse(response)
+        # 把response对象返回出去
+        return response
+
+    """退出登录小程序"""
+    def mgr_logout_wxapi(self):
+        url = f"{cfg.target_host_wxapi}/debrisproduct/logout"
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        s.post(url=url, headers=headers)
+
+    """我的用户信息"""
+    def myuser_information(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/myinfo", headers=hearders)
+        return response
+
+    """招标项目搜索-搜索入口"""
+    def bidding_project_search(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "area": "河南",
+            "propertyForm": "医院",
+            "OwnerType": "医疗单位",
+            "Page": 1,
+            "PageSize": 1,
+            "KeyWords": "物业"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/search/bidList", headers=hearders, json=json)
+        return response
+
+    """采购意向搜索-搜索入口"""
+    def purchase_intention_search(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "area": "安徽",
+            "propertyForm": "学校",
+            "OwnerType": "教育单位",
+            "Page": 1,
+            "PageSize": 1,
+            "KeyWords": "数据"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/search/buyPurposeList", headers=hearders, json=json)
+        return response
+
+    """招标项目搜索-订阅入口"""
+    def tender_subscription(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "area": "河南",
+            "propertyForm": "医院",
+            "OwnerType": "医疗单位",
+            "Page": 1,
+            "PageSize": 1,
+            "KeyWords": "物业"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/search/bidSubscribeList", headers=hearders, json=json)
+        return response
+
+    """采购意向搜索-订阅入口"""
+    def purchase_intention_subscription(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "area": "安徽",
+            "propertyForm": "学校",
+            "OwnerType": "教育单位",
+            "Page": 1,
+            "PageSize": 1,
+            "KeyWords": "数据"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/search/buyPurposeSubscribeList", headers=hearders, json=json)
+        return response
+
+    """情报热词"""
+    def information_buzzword(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        response = s.get(f"{cfg.target_host_wxapi}/debrisproduct/info/getHotInfo", headers=hearders)
+        return response
+
+    """情报列表/搜索-搜索"""
+    def information_search(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "page_size": 1,
+            "page_num": 1,
+            "keyWords": "科技"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/info/getInfoList", headers=hearders, json=json)
+        return response
+
+    """情报列表/搜索-订阅"""
+    def information_subscription(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "page_size": 1,
+            "page_num": 1,
+            "keyWords": "科技"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/info/subscribeList", headers=hearders, json=json)
+        return response
+
+    """监控列表"""
+    def monitor_list(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "Size": 1,
+            "Page": 1
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/monitorList", headers=hearders, json=json)
+        return response
+
+    """监控操作"""
+    def monitor_operate(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json={
+            "CompanyName":"东莞市中医院",
+            "OperateType":1
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/monitorOperate", headers=hearders, json=json)
+        return response
+
+    """详情页信息-投标"""
+    def detailed_information(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "_id": "ABCY1xZcDIvJyssAlV1cHU8CicoEjRjYWR1Pw4jIy4wc3xzfTNUCec%3D"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/getBiddingDetail", headers=hearders, json=json)
+        return response
+
+    #获取订单详情
+    def debrisproduct_orderDetail(self, orderCode):
+        headers = GSTORE['headers']
+        s = GSTORE['s']  # 从全局变量中获取 cookie
+        INFO(f"使用的 cookies: {s}")  # 打印 cookie,确保它正确
+        response = s.post(
+            f"{cfg.target_host_wxapi}/debrisproduct/orderDetail",
+            headers=headers,
+            data={"orderCode": orderCode}
+        )
+        return response
+    #获取订单列表
+    def debrisproduct_orderList(self, orderCode):
+        headers = GSTORE['headers']
+        s = GSTORE['s']  # 从全局变量中获取 cookie
+        INFO(f"使用的 cookies: {s}")  # 打印 cookie,确保它正确
+        response = s.post(
+            f"{cfg.target_host_wxapi}/debrisproduct/orderList",
+            headers=headers,
+            data={"orderCode": orderCode}
+        )
+
+    """情报详情"""
+    def information_details(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "id":"61cbb70345a326c6c34a5e0e"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/info/getInfoDetail", headers=hearders, json=json)
+        return response
+
+    """订阅查询"""
+    def subscription_query(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/userInfo", headers=hearders)
+        return response
+
+    """采购单位分析"""
+    def purchasing_analysis(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "Id": "6683afb5fd2a955205279a0e",
+            "Type": 0
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/getBuyerAnalyze", headers=hearders, json=json)
+        return response
+
+    """详情页信息"""
+    def detail_page_information(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "Id": "ABCY1xZcDIvJyssAlV1cHU8CicoEjRjYWR1Pw4jIy4wc3xzfTNUCec%3D",
+            "Type":1
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/getDetailEquity", headers=hearders, json=json)
+        return response
+
+    """订阅区域修改"""
+    def subscription_region_modification(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "ModifyType":"全部"
+        }
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/updateArea", headers=hearders, json=json)
+        return response
+
+    """订阅业务类型修改"""
+    def subscription_service_type_changes(self):
+        hearders = GSTORE['headers']
+        s = GSTORE['s']
+        response = s.post(f"{cfg.target_host_wxapi}/debrisproduct/updateIndustry", headers=hearders)
+        return response
+
+apimgr = APIMgr()