控件搜索测试
This commit is contained in:
parent
2f7abfec96
commit
b019fc0aaf
4
main.py
4
main.py
@ -99,7 +99,9 @@ async def douyin_task(item: Device):
|
|||||||
return Response(code=500, msg="设备 {} 不存在".format(item.serial))
|
return Response(code=500, msg="设备 {} 不存在".format(item.serial))
|
||||||
d = devices[item.serial]
|
d = devices[item.serial]
|
||||||
d.app_start("com.ss.android.ugc.aweme", stop=False)
|
d.app_start("com.ss.android.ugc.aweme", stop=False)
|
||||||
tasks.douyin.click_search(d)
|
tasks.douyin.click_search_icon(d)
|
||||||
|
tasks.douyin.input_search_text(d, "老耗")
|
||||||
|
d.xpath("老耗游戏").click()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
from uiautomator2 import Device
|
from uiautomator2 import Device
|
||||||
|
|
||||||
|
|
||||||
def click_search(d: Device):
|
def click_search_icon(d: Device):
|
||||||
(d
|
(d
|
||||||
.xpath('//*[@resource-id="com.ss.android.ugc.aweme:id/ybv"]/android.widget.Button[1]/android.widget.FrameLayout[1]')
|
.xpath('//*[@resource-id="com.ss.android.ugc.aweme:id/ybv"]/android.widget.Button[1]/android.widget.FrameLayout[1]')
|
||||||
.click())
|
.click())
|
||||||
|
|
||||||
|
def input_search_text(d: Device, text: str):
|
||||||
|
(d
|
||||||
|
.xpath('//*[@resource-id="com.ss.android.ugc.aweme:id/et_search_kw"]').set_text(text))
|
||||||
|
Loading…
Reference in New Issue
Block a user