refactor(pages): PO 层框架化 — 细粒度操作 + 显式等待 + 消除静默吞异常

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)。
This commit is contained in:
xst
2026-09-02 11:59:46 +08:00
parent 6ee7ade67d
commit 2aca405267
310 changed files with 78629 additions and 157 deletions
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="1" skipped="0" tests="1" time="108.050" timestamp="2026-07-29T10:04:55.314436+08:00" hostname="Y8126"><testcase classname="cross_end.tests.test_driver_to_settlement.TestDriverToSettlement" name="test_driver_to_settlement_full_flow" time="107.612"><failure message="playwright._impl._errors.TimeoutError: Page.wait_for_selector: Timeout 5000ms exceeded.&#10;Call log:&#10; - waiting for locator(&quot;table tbody tr&quot;) to be visible&#10; 14 × locator resolved to 5 elements. Proceeding with the first one: &lt;tr&gt;…&lt;/tr&gt;">tests\cross_end\tests\test_driver_to_settlement.py:128: in test_driver_to_settlement_full_flow
admin_accounting.do_shipper_payment(transport_order_no)
tests\cross_end\pages\admin\freight_accounting_page.py:257: in do_shipper_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)
D:\Python\Python312\Lib\site-packages\playwright\sync_api\_generated.py:8928: in wait_for_selector
self._sync(
D:\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()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
D:\Python\Python312\Lib\site-packages\playwright\_impl\_frame.py:394: in wait_for_selector
await self._channel.send(
D:\Python\Python312\Lib\site-packages\playwright\_impl\_connection.py:69: in send
return await self._connection.wrap_api_call(
D:\Python\Python312\Lib\site-packages\playwright\_impl\_connection.py:563: 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: &lt;tr&gt;…&lt;/tr&gt;</failure></testcase></testsuite></testsuites>