DriverFreightFlowPage (APP): - 流程方法拆为单一职责的细粒度操作(open_freight_tab/fill_quantity/upload_photo_from_album/...), 流程方法仅做编排,公共 API 不变,用例零改动 - 移除全部 implicitly_wait 全局副作用,每步显式等待目标元素 - 容错点击(已知晓/确定)改为 _tap_by_text_if_present,跳过时记录 warning FreightAccountingPage (Web): - _go/_click_search 改显式等待(搜索框出现/列表数据行或空态),替代固定 2s/1s sleep - 表格等待升级为 td:visible,避开 vxe-table 固定列隐藏占位单元格 - 点击行操作按钮后显式等待弹窗出现,替代固定 800ms - 车队长下拉选择改显式等待下拉项渲染 - 可选弹窗操作统一收敛到 _try_click,跳过时记录 warning;关键确认按钮保持严格 两条 E2E 用例在真实环境回归通过(TC-D2S-001 116s / TC-D2S-002 112s)。
130 lines
11 KiB
XML
130 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="4" skipped="0" tests="5" time="383.862" timestamp="2026-09-02T09:53:58.487570+08:00" hostname="yunba-126"><testcase classname="cross_end.test_driver_to_settlement.TestDriverToSettlement" name="test_driver_to_settlement_full_flow" time="73.097"><failure message="RuntimeError: 运费核算 SQL 重试失败!单号: RHJC040026090100010951040132, 错误: 'database'">tests\cross_end\test_driver_to_settlement.py:126: in <lambda>
|
||
retry_sql=lambda: update_risk_control_status(transport_order_no, status=1),
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:75: in update_risk_control_status
|
||
return execute_sql(sql, (status, order_code), config)
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:32: in execute_sql
|
||
conn = get_connection(config)
|
||
^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:27: in get_connection
|
||
return pymysql.connect(**_resolve_config(config))
|
||
^^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:20: in _resolve_config
|
||
cfg = dict(load_config()["database"])
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
E KeyError: 'database'
|
||
|
||
During handling of the above exception, another exception occurred:
|
||
tests\cross_end\test_driver_to_settlement.py:124: in test_driver_to_settlement_full_flow
|
||
admin_accounting.do_freight_accounting(
|
||
tests\pages\admin\freight_accounting_page.py:149: in do_freight_accounting
|
||
raise RuntimeError(f"运费核算 SQL 重试失败!单号: {order_no}, 错误: {e}")
|
||
E RuntimeError: 运费核算 SQL 重试失败!单号: RHJC040026090100010951040132, 错误: 'database'</failure></testcase><testcase classname="cross_end.test_driver_to_settlement.TestDriverToSettlementTeamLeader" name="test_driver_to_settlement_team_leader_flow" time="65.581"><failure message="RuntimeError: 运费核算 SQL 重试失败!单号: RHJC040026090100010952080133, 错误: 'database'">tests\cross_end\test_driver_to_settlement.py:239: in <lambda>
|
||
retry_sql=lambda: update_risk_control_status(transport_order_no, status=1),
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:75: in update_risk_control_status
|
||
return execute_sql(sql, (status, order_code), config)
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:32: in execute_sql
|
||
conn = get_connection(config)
|
||
^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:27: in get_connection
|
||
return pymysql.connect(**_resolve_config(config))
|
||
^^^^^^^^^^^^^^^^^^^^^^^
|
||
tests\core\db_helper.py:20: in _resolve_config
|
||
cfg = dict(load_config()["database"])
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
E KeyError: 'database'
|
||
|
||
During handling of the above exception, another exception occurred:
|
||
tests\cross_end\test_driver_to_settlement.py:237: in test_driver_to_settlement_team_leader_flow
|
||
admin_accounting.do_freight_accounting(
|
||
tests\pages\admin\freight_accounting_page.py:149: in do_freight_accounting
|
||
raise RuntimeError(f"运费核算 SQL 重试失败!单号: {order_no}, 错误: {e}")
|
||
E RuntimeError: 运费核算 SQL 重试失败!单号: RHJC040026090100010952080133, 错误: 'database'</failure></testcase><testcase classname="cross_end.tests.test_driver_to_settlement.TestDriverToSettlement" name="test_driver_to_settlement_full_flow" time="100.261" /><testcase classname="cross_end.tests.test_driver_to_settlement.TestDriverToSettlementTeamLeader" name="test_driver_to_settlement_team_leader_flow" time="102.671"><failure message="playwright._impl._errors.TimeoutError: Page.wait_for_selector: Timeout 5000ms exceeded. Call log: - waiting for locator("table tbody tr") to be visible 14 × locator resolved to 5 elements. Proceeding with the first one: <tr>…</tr>">tests\cross_end\tests\test_driver_to_settlement.py:239: in test_driver_to_settlement_team_leader_flow
|
||
admin_accounting.do_finance_payment(transport_order_no, verify_code="1234")
|
||
tests\cross_end\pages\admin\freight_accounting_page.py:266: in do_finance_payment
|
||
self._click_table_action(button_index=2)
|
||
tests\cross_end\pages\admin\freight_accounting_page.py:82: in _click_table_action
|
||
self.page.wait_for_selector("table tbody tr", timeout=5_000)
|
||
C:\Users\23184\AppData\Local\Programs\Python\Python312\Lib\site-packages\playwright\sync_api\_generated.py:9033: in wait_for_selector
|
||
self._sync(
|
||
C:\Users\23184\AppData\Local\Programs\Python\Python312\Lib\site-packages\playwright\_impl\_page.py:427: in wait_for_selector
|
||
return await self._main_frame.wait_for_selector(**locals_to_params(locals()))
|
||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
C:\Users\23184\AppData\Local\Programs\Python\Python312\Lib\site-packages\playwright\_impl\_frame.py:394: in wait_for_selector
|
||
await self._channel.send(
|
||
C:\Users\23184\AppData\Local\Programs\Python\Python312\Lib\site-packages\playwright\_impl\_connection.py:76: in send
|
||
return await self._connection.wrap_api_call(
|
||
C:\Users\23184\AppData\Local\Programs\Python\Python312\Lib\site-packages\playwright\_impl\_connection.py:632: in wrap_api_call
|
||
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
|
||
E playwright._impl._errors.TimeoutError: Page.wait_for_selector: Timeout 5000ms exceeded.
|
||
E Call log:
|
||
E - waiting for locator("table tbody tr") to be visible
|
||
E 14 × locator resolved to 5 elements. Proceeding with the first one: <tr>…</tr></failure></testcase><testcase classname="cross_end.tests.test_freight_full_flow.TestFreightFullFlow" name="test_full_freight_flow" time="41.624"><failure message="AssertionError: Locator expected to be visible Actual value: hidden Call log: - Expect "to_be_visible" with timeout 30000ms - waiting for get_by_text("运输管理").first 60 × locator resolved to <span>运输管理</span> - unexpected value "hidden" Aria snapshot: - text: - heading "系统布局配置" [level=3] - text: 主题色 开启 Tags-View - switch [checked]: - checkbox [checked] - text: 固定 Header - switch: - checkbox - text: 侧边栏 Logo - switch [checked]: - checkbox [checked] - img - link: - /url: "#/" - img - menubar: - link "首页": - /url: "#/home" - menuitem "首页" - menuitem "基础信息 " - menuitem "整车运输 " - menuitem "管理服务 " - menuitem "同城运输 " - menuitem "增值服务 " - menuitem "财务统计 " - menuitem "系统管理 " - link "资源控制": - /url: "#/resourceController" - menuitem "资源控制" - img - navigation "Breadcrumb": - link "首页" - textbox "搜索" - button "超级管理员 ": - text: 超级管理员 - emphasis: - text: 首页 RELEASE SOURSE 发布货源 ORDER MANAGEMENT 订单管理 CUSTOMER SERVICE 客服管理 - link "BIG DATA CENTER 大数据中心": - /url: https://ybxcx.ynyun8.com:8000/Bigdata/ - link "ZHONGMIN BIG DATA 中闽大数据": - /url: https://ybxcx.ynyun8.com:8000/zm/ - img - text: ZHONGMIN BIG DATA 中闽大数据 - text: 运输流程 官网 货源发布 货源审核 货源管理 运输核算 运单管理 预付 财务打款 - link: - /url: https://www.ynyun8.com/ - text: 平台车辆 平台订单 平台车辆总计 12,832 平台车辆 153,938 平台运力(吨) 货源单总数: 9948 1763 未接单 116 已接单 1347 已结算 30 已撤销 运输单总数: 29939 10073 待运输 460 运输中 7189 已卸货 货源单类型 9519 正常单 138 内容报价单 交易数据 充值总额(元) 158,232 交易总额(元) 117,687,373 运费总额(元) 37,980,387 开票总额(元) 838,947">tests\cross_end\tests\test_freight_full_flow.py:67: in test_full_freight_flow
|
||
navbar.go_to_submenu("运输管理", "货源管理")
|
||
tests\web\admin\pages\components\navbar.py:42: in go_to_submenu
|
||
self.go_to(parent_menu)
|
||
tests\web\admin\pages\components\navbar.py:33: in go_to
|
||
self.click_when_ready(menu_item)
|
||
tests\web\admin\pages\base_page.py:53: in click_when_ready
|
||
self.wait_visible(locator)
|
||
tests\web\admin\pages\base_page.py:33: in wait_visible
|
||
expect(locator).to_be_visible(timeout=timeout_ms or self.timeout)
|
||
E AssertionError: Locator expected to be visible
|
||
E Actual value: hidden
|
||
E Call log:
|
||
E - Expect "to_be_visible" with timeout 30000ms
|
||
E - waiting for get_by_text("运输管理").first
|
||
E 60 × locator resolved to <span>运输管理</span>
|
||
E - unexpected value "hidden"
|
||
E
|
||
E Aria snapshot:
|
||
E - text:
|
||
E - heading "系统布局配置" [level=3]
|
||
E - text: 主题色 开启 Tags-View
|
||
E - switch [checked]:
|
||
E - checkbox [checked]
|
||
E - text: 固定 Header
|
||
E - switch:
|
||
E - checkbox
|
||
E - text: 侧边栏 Logo
|
||
E - switch [checked]:
|
||
E - checkbox [checked]
|
||
E - img
|
||
E - link:
|
||
E - /url: "#/"
|
||
E - img
|
||
E - menubar:
|
||
E - link "首页":
|
||
E - /url: "#/home"
|
||
E - menuitem "首页"
|
||
E - menuitem "基础信息 "
|
||
E - menuitem "整车运输 "
|
||
E - menuitem "管理服务 "
|
||
E - menuitem "同城运输 "
|
||
E - menuitem "增值服务 "
|
||
E - menuitem "财务统计 "
|
||
E - menuitem "系统管理 "
|
||
E - link "资源控制":
|
||
E - /url: "#/resourceController"
|
||
E - menuitem "资源控制"
|
||
E - img
|
||
E - navigation "Breadcrumb":
|
||
E - link "首页"
|
||
E - textbox "搜索"
|
||
E - button "超级管理员 ":
|
||
E - text: 超级管理员
|
||
E - emphasis:
|
||
E - text: 首页 RELEASE SOURSE 发布货源 ORDER MANAGEMENT 订单管理 CUSTOMER SERVICE 客服管理
|
||
E - link "BIG DATA CENTER 大数据中心":
|
||
E - /url: https://ybxcx.ynyun8.com:8000/Bigdata/
|
||
E - link "ZHONGMIN BIG DATA 中闽大数据":
|
||
E - /url: https://ybxcx.ynyun8.com:8000/zm/
|
||
E - img
|
||
E - text: ZHONGMIN BIG DATA 中闽大数据
|
||
E - text: 运输流程 官网 货源发布 货源审核 货源管理 运输核算 运单管理 预付 财务打款
|
||
E - link:
|
||
E - /url: https://www.ynyun8.com/
|
||
E - text: 平台车辆 平台订单 平台车辆总计 12,832 平台车辆 153,938 平台运力(吨) 货源单总数: 9948 1763 未接单 116 已接单 1347 已结算 30 已撤销 运输单总数: 29939 10073 待运输 460 运输中 7189 已卸货 货源单类型 9519 正常单 138 内容报价单 交易数据 充值总额(元) 158,232 交易总额(元) 117,687,373 运费总额(元) 37,980,387 开票总额(元) 838,947</failure></testcase></testsuite></testsuites> |