From bdc6414f69b48ce0243cb4c9572bd78dc66988db Mon Sep 17 00:00:00 2001 From: zhangkai <2403741920@qq.com> Date: Fri, 31 Oct 2025 19:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=97=A0=E6=B3=95=E6=92=AD=E6=94=BE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utils/ControlUtils.py | 1 + script/ScriptManager.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Utils/ControlUtils.py b/Utils/ControlUtils.py index eced30d..ba54d42 100644 --- a/Utils/ControlUtils.py +++ b/Utils/ControlUtils.py @@ -70,6 +70,7 @@ class ControlUtils(object): "@name='Back' or @label='Back' or " # 英文 "@name='返回' or @label='返回' or " # 中文 "@label='返回上一屏幕' or " # 中文另一种 + "@name='returnButton' or" "@name='nav_bar_start_back' or " # 内部常见 name "(@name='TTKProfileNavBarBaseItemComponent' and @label='IconChevronLeftOffsetLTR')" # 你给的特例 ")]" diff --git a/script/ScriptManager.py b/script/ScriptManager.py index 4e3daf0..5a05caf 100644 --- a/script/ScriptManager.py +++ b/script/ScriptManager.py @@ -617,7 +617,18 @@ class ScriptManager(): ControlUtils.swipe_up(udid) # 右滑返回 - client.swipe_right() + # client.swipe_right() + session.appium_settings({"snapshotMaxDepth": 12}) + source = session.source() + print(f"fff“:{source}") + + back_btn = ControlUtils.clickBack(session) + + if not back_btn: + print("返回失败,出现问题") + raise Exception("返回失败,出现问题") + + if event.is_set(): LogManager.method_info("viewAnchorVideo 检测到停止,提前退出", "关注打招呼", udid) return