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:
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="1" failures="1" skipped="0" tests="2" time="10.769" timestamp="2026-07-29T08:45:34.712886+08:00" hostname="Y8126"><testcase classname="cross_end.tests.test_driver_to_settlement.TestDriverToSettlement" name="test_driver_to_settlement_full_flow" time="9.577"><failure message="selenium.common.exceptions.WebDriverException: Message: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details Stacktrace: UnknownError: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details at UIA2Proxy.command (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\jsonwp-proxy\proxy.js:274:19) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async AndroidUiautomator2Driver.doFindElementOrEls (file:///C:/Users/23184/.appium/node_modules/appium-uiautomator2-driver/build/lib/commands/find.js:20:13) at async doFind (C:\Users\23184\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-android-driver\build\lib\commands\find.js:24:23) at async wrappedCondFn (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\timeout.js:93:20) at async spin (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\build\lib\asyncbox.js:261:24) at async waitForCondition (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\build\lib\asyncbox.js:279:12) at async AndroidUiautomator2Driver.implicitWaitForCondition (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\timeout.js:95:16) at async AndroidUiautomator2Driver.findElOrEls (C:\Users\23184\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-android-driver\build\lib\commands\find.js:45:9) at async AndroidUiautomator2Driver.findElOrElsWithProcessing (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\find.js:12:16) at async AndroidUiautomator2Driver.findElement (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\find.js:28:16) at async runCommandPromise (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\driver.js:119:24)">tests\cross_end\tests\test_driver_to_settlement.py:76: in test_driver_to_settlement_full_flow
|
||||
ensure_driver_login(app_driver)
|
||||
tests\cross_end\conftest.py:161: in <lambda>
|
||||
return lambda d: fn(d)
|
||||
^^^^^
|
||||
tests\app\_shared.py:100: in _ensure_logged_in
|
||||
wait.until(EC.visibility_of_element_located(mine_tab))
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\support\wait.py:112: in until
|
||||
value = method(self._driver)
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\support\expected_conditions.py:188: in _predicate
|
||||
return _element_if_visible(driver.find_element(*locator))
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:899: in find_element
|
||||
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:492: in execute
|
||||
self.error_handler.check_response(response)
|
||||
D:\Python\Python312\Lib\site-packages\appium\webdriver\errorhandler.py:125: in check_response
|
||||
raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
|
||||
E selenium.common.exceptions.WebDriverException: Message: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
|
||||
E Stacktrace:
|
||||
E UnknownError: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
|
||||
E at UIA2Proxy.command (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\jsonwp-proxy\proxy.js:274:19)
|
||||
E at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
E at async AndroidUiautomator2Driver.doFindElementOrEls (file:///C:/Users/23184/.appium/node_modules/appium-uiautomator2-driver/build/lib/commands/find.js:20:13)
|
||||
E at async doFind (C:\Users\23184\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-android-driver\build\lib\commands\find.js:24:23)
|
||||
E at async wrappedCondFn (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\timeout.js:93:20)
|
||||
E at async spin (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\build\lib\asyncbox.js:261:24)
|
||||
E at async waitForCondition (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\build\lib\asyncbox.js:279:12)
|
||||
E at async AndroidUiautomator2Driver.implicitWaitForCondition (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\timeout.js:95:16)
|
||||
E at async AndroidUiautomator2Driver.findElOrEls (C:\Users\23184\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-android-driver\build\lib\commands\find.js:45:9)
|
||||
E at async AndroidUiautomator2Driver.findElOrElsWithProcessing (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\find.js:12:16)
|
||||
E at async AndroidUiautomator2Driver.findElement (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\commands\find.js:28:16)
|
||||
E at async runCommandPromise (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\driver.js:119:24)</failure></testcase><testcase classname="cross_end.tests.test_driver_to_settlement.TestDriverToSettlement" name="test_driver_to_settlement_full_flow" time="0.704"><error message="failed on teardown with "selenium.common.exceptions.WebDriverException: Message: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details Stacktrace: UnknownError: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details at UIA2Proxy.command (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\jsonwp-proxy\proxy.js:274:19) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async AndroidUiautomator2Driver.getScreenshot (file:///C:/Users/23184/.appium/node_modules/appium-uiautomator2-driver/build/lib/commands/screenshot.js:61:19) at async runCommandPromise (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\driver.js:119:24)"">tests\cross_end\conftest.py:100: in app_driver
|
||||
save_failure_screenshot(d, cfg, "android", request)
|
||||
tests\app\_shared.py:190: in save_failure_screenshot
|
||||
driver.save_screenshot(path)
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:979: in save_screenshot
|
||||
return self.get_screenshot_as_file(filename)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:956: in get_screenshot_as_file
|
||||
png = self.get_screenshot_as_png()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:987: in get_screenshot_as_png
|
||||
return b64decode(self.get_screenshot_as_base64().encode("ascii"))
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:997: in get_screenshot_as_base64
|
||||
return self.execute(Command.SCREENSHOT)["value"]
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
D:\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py:492: in execute
|
||||
self.error_handler.check_response(response)
|
||||
D:\Python\Python312\Lib\site-packages\appium\webdriver\errorhandler.py:125: in check_response
|
||||
raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
|
||||
E selenium.common.exceptions.WebDriverException: Message: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
|
||||
E Stacktrace:
|
||||
E UnknownError: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
|
||||
E at UIA2Proxy.command (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\jsonwp-proxy\proxy.js:274:19)
|
||||
E at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
E at async AndroidUiautomator2Driver.getScreenshot (file:///C:/Users/23184/.appium/node_modules/appium-uiautomator2-driver/build/lib/commands/screenshot.js:61:19)
|
||||
E at async runCommandPromise (C:\Users\23184\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\build\lib\basedriver\driver.js:119:24)</error></testcase></testsuite></testsuites>
|
||||
Reference in New Issue
Block a user