ai 开始测试

This commit is contained in:
2025-09-03 19:03:34 +08:00
parent 8317470fb5
commit b555712749
7 changed files with 251 additions and 64 deletions

View File

@@ -55,7 +55,12 @@ class ControlUtils(object):
@classmethod
def clickBack(cls, session: Client):
try:
back = session.xpath("//*[@label='返回']")
back = session.xpath(
"//*[@label='返回']"
" | "
"//XCUIElementTypeButton[@visible='true' and @name='TTKProfileNavBarBaseItemComponent' and @label='IconChevronLeftOffsetLTR']"
)
if back.exists:
back.click()
return True
@@ -118,8 +123,7 @@ class ControlUtils(object):
# '//Window/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[1]/ScrollView[1]/Other[1]/CollectionView[1]/Cell[2]')
videoCell = session.xpath(
'(//XCUIElementTypeCollectionView//XCUIElementTypeCell[.//XCUIElementTypeImage[@name="profile_video"]])[1]').get(
timeout=5)
'(//XCUIElementTypeCollectionView//XCUIElementTypeCell[.//XCUIElementTypeImage[@name="profile_video"]])[1]')
tab = session.xpath('//XCUIElementTypeButton[@name="TTKProfileTabVideoButton_0"]').get(timeout=2)
# 某些版本 tab.value 可能就是数量;或者 tab.label 类似 “作品 7”
@@ -132,7 +136,7 @@ class ControlUtils(object):
num = int(m.group())
print("作品数量为:", num)
if videoCell is not None:
if videoCell.exists:
videoCell.click()
# 点击视频
print("找到主页的第一个视频")