ai 开始测试

This commit is contained in:
2025-08-29 20:48:33 +08:00
parent 3fcd72bfd5
commit b75c517488
8 changed files with 213 additions and 126 deletions

View File

@@ -203,7 +203,7 @@ class AiUtils(object):
print("1.找到了")
return homeButton
else:
print("没找到")
print("1.没找到")
return None
except Exception as e:
print(e)
@@ -241,23 +241,34 @@ class AiUtils(object):
# 获取关注按钮
@classmethod
def getFollowButton(cls, session: Client):
followButton = session.xpath("//Window[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[2]/Other[1]/Other[1]/Other[3]/Other[1]/Other[1]/Button[1]")
# followButton = session.xpath("//Window[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[2]/Other[1]/Other[1]/Other[3]/Other[1]/Other[1]/Button[1]")
followButton = session.xpath(
'//XCUIElementTypeOther[@name="cta_social_interaction"]//XCUIElementTypeButton[@name="关注"]')
if followButton.exists:
print("2.找到了")
print("2.关注找到了")
LogManager.info("2.关注找到了")
return followButton
else:
print("没找到")
print("2.关注没找到")
print("2.关注没找到")
return None
# 查找发消息按钮
@classmethod
def getSendMesageButton(cls, session: Client):
msgButton = session.xpath("//Window[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[2]/Other[1]/Other[1]/Other[3]/Other[1]/Other[1]")
# msgButton = session.xpath("//Window[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[2]/Other[1]/Other[1]/Other[3]/Other[1]/Other[1]")
msgButton = session.xpath(
'//XCUIElementTypeOther[@name="cta_social_interaction"]//XCUIElementTypeButton[@name="发消息"]')
if msgButton.exists:
print("3.找到了")
print("3.发消息按钮找到了")
LogManager.info("3.发消息按钮找到了")
return msgButton
else:
print("没找到")
print("3.发消息按钮没找到")
LogManager.info("3.发消息按钮没找到")
return None
# 获取当前屏幕上的节点