Commit 1acf7239 authored by wushanjing's avatar wushanjing

标记智能接单菜单验证来源

parent 2eddc652
......@@ -9270,8 +9270,12 @@ class WanyoujiFulfillmentPage(TenantAuthPage):
def open_auto_accept_assignment_config(self) -> Frame:
self.goto(WANYOUJI_CONSOLE_URL)
self.wait_for_enterprise_console_shell()
menu_paths = [
# verified: 2026-07-02 member screenshot, 丸友集 -> 工作室基础应用 -> 基础配置 -> 智能接单配置
verified_paths = [
("工作室基础应用", "基础配置", "智能接单配置"),
]
# unverified fallback: keep only as diagnostics-friendly compatibility, do not treat these as validated paths.
fallback_paths = [
("工作室履约应用", "智能接单配置"),
("工作室履约应用", "自动接单配置"),
("工作室履约应用", "接单配置"),
......@@ -9280,14 +9284,36 @@ class WanyoujiFulfillmentPage(TenantAuthPage):
("工作室管理", "自动接单配置"),
("工作室管理", "接单配置"),
]
for menu_path in menu_paths:
for menu_path in verified_paths:
if self.open_sidebar_menu_path(list(menu_path)):
self.page.wait_for_timeout(2500)
self.retry_if_app_load_timeout()
return self.best_wanyouji_frame(["自动接单", "智能接单", "智能派单", "订单列表", "商家", "工作室"])
for menu_path in fallback_paths:
if self.open_sidebar_menu_path(list(menu_path)):
print(f"[E2E][WARN] 命中未验证智能接单配置菜单兜底:{' > '.join(menu_path)}")
self.page.wait_for_timeout(2500)
self.retry_if_app_load_timeout()
return self.best_wanyouji_frame(["自动接单", "智能接单", "智能派单", "订单列表", "商家", "工作室"])
page_text = self.page.locator("body").inner_text(timeout=5000)
raise AssertionError(f"未找到丸友集智能接单配置入口;text={page_text[:1500]}")
sidebar_text = self.left_sidebar_snapshot()
raise AssertionError(f"未找到丸友集智能接单配置入口;sidebar={sidebar_text[:1500]}; text={page_text[:1500]}")
def left_sidebar_snapshot(self) -> str:
try:
return str(
self.page.evaluate(
"""() => Array.from(document.querySelectorAll('taro-view-core, div, span, a, button'))
.map(el => ({ text: (el.innerText || el.textContent || '').trim(), r: el.getBoundingClientRect() }))
.filter(item => item.text && item.r.width > 0 && item.r.height > 0)
.filter(item => item.r.x >= 0 && item.r.x < 260 && item.r.y > 40)
.map(item => item.text)
.join('\\n')"""
)
)
except Exception as exc:
return f"<sidebar snapshot failed: {exc}>"
def open_sidebar_menu_path(self, texts: list[str]) -> bool:
for index, text in enumerate(texts):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment