修复不能滑动的bug
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -286,9 +286,8 @@ class ControlUtils(object):
|
||||
|
||||
# 向上滑动 脚本内部使用
|
||||
@classmethod
|
||||
def swipe_up(cls, udid):
|
||||
dev = wda.USBClient(udid, wdaFunctionPort)
|
||||
dev.swipe(200, 350, 200, 250, 0.05)
|
||||
def swipe_up(cls, client):
|
||||
client.swipe(200, 350, 200, 250, 0.05)
|
||||
|
||||
# 向下滑动,脚本内使用
|
||||
@classmethod
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user