修复不能滑动的bug

This commit is contained in:
2025-11-03 19:08:25 +08:00
parent 0ccd4ee97c
commit 740f45b88b
12 changed files with 33 additions and 77 deletions

View File

@@ -65,8 +65,6 @@ class AiUtils(object):
@classmethod
def findImageInScreen(cls, target, udid):
try:
print("参数", target, udid)
# 加载原始图像和模板图像
image_path = AiUtils.imagePathWithName(udid, "bgv")
template_path = AiUtils.imagePathWithName("", target)
@@ -119,9 +117,7 @@ class AiUtils(object):
# 选择截图
@classmethod
def screenshot(cls):
client = wda.USBClient("eca000fcb6f55d7ed9b4c524055214c26a7de7aa",wdaFunctionPort)
session = client.session()
def screenshot(cls, session):
image = session.screenshot()
image_path = "screenshot.png"
image.save(image_path)
@@ -243,9 +239,7 @@ class AiUtils(object):
# uuid 设备id
# click 是否点击该按钮
@classmethod
def findHomeButton(cls, udid="eca000fcb6f55d7ed9b4c524055214c26a7de7aa"):
client = wda.USBClient(udid,wdaFunctionPort)
session = client.session()
def findHomeButton(cls, session):
session.appium_settings({"snapshotMaxDepth": 10})
homeButton = session.xpath("//XCUIElementTypeButton[@name='a11y_vo_home' or @label='Home' or @label='首页']")
try: