20250916-正式上线测试
This commit is contained in:
@@ -368,17 +368,19 @@ class ScriptManager():
|
||||
|
||||
# 定位 "关注" 按钮 通过关注按钮的位置点击主播首页
|
||||
|
||||
session.appium_settings({"snapshotMaxDepth": 23})
|
||||
session.appium_settings({"snapshotMaxDepth": 25})
|
||||
|
||||
try:
|
||||
# 点击进入首页
|
||||
ControlUtils.clickFollow(session, aid)
|
||||
LogManager.method_info("点击进入主播首页", "关注打招呼", udid)
|
||||
except wda.WDAElementNotFoundError:
|
||||
LogManager.method_info("未找到进入主播首页的按钮,跳过点击。", "关注打招呼", udid)
|
||||
goBack(2)
|
||||
session.appium_settings({"snapshotMaxDepth": 15})
|
||||
continue
|
||||
LogManager.method_info("未找到进入主播首页的按钮,使用第二个方案。", "关注打招呼", udid)
|
||||
enter_room = ControlUtils.userClickProfile(session, aid)
|
||||
if not enter_room:
|
||||
goBack(2)
|
||||
session.appium_settings({"snapshotMaxDepth": 15})
|
||||
continue
|
||||
|
||||
time.sleep(2)
|
||||
|
||||
@@ -510,26 +512,25 @@ class ScriptManager():
|
||||
goBack(1)
|
||||
|
||||
# 点击关注按钮
|
||||
followButton = AiUtils.getFollowButton(session).get(timeout=5)
|
||||
if followButton is not None:
|
||||
# LogManager.method_info("找到关注按钮了", "关注打招呼", udid)
|
||||
# followButton.click()
|
||||
x, y, w, h = followButton.bounds
|
||||
cx = int(x + w / 2)
|
||||
cy = int(y + h / 2)
|
||||
# 随机偏移 ±5 px(可自己改范围)
|
||||
cx += random.randint(-5, 5)
|
||||
cy += random.randint(-5, 5)
|
||||
|
||||
ControlUtils.tap_mini_cluster(cx, cy, session)
|
||||
|
||||
|
||||
else:
|
||||
LogManager.method_info("没找到关注按钮", "关注打招呼", udid)
|
||||
time.sleep(1)
|
||||
goBack(4)
|
||||
session.appium_settings({"snapshotMaxDepth": 15})
|
||||
continue
|
||||
# followButton = AiUtils.getFollowButton(session).get(timeout=5)
|
||||
# if followButton is not None:
|
||||
# # LogManager.method_info("找到关注按钮了", "关注打招呼", udid)
|
||||
# # followButton.click()
|
||||
# x, y, w, h = followButton.bounds
|
||||
# cx = int(x + w / 2)
|
||||
# cy = int(y + h / 2)
|
||||
# # 随机偏移 ±5 px(可自己改范围)
|
||||
# cx += random.randint(-5, 5)
|
||||
# cy += random.randint(-5, 5)
|
||||
#
|
||||
# ControlUtils.tap_mini_cluster(cx, cy, session)
|
||||
#
|
||||
# else:
|
||||
# LogManager.method_info("没找到关注按钮", "关注打招呼", udid)
|
||||
# time.sleep(1)
|
||||
# goBack(4)
|
||||
# session.appium_settings({"snapshotMaxDepth": 15})
|
||||
# continue
|
||||
|
||||
session.appium_settings({"snapshotMaxDepth": 15})
|
||||
goBack(3)
|
||||
|
||||
Reference in New Issue
Block a user