chore: 提交现有客户端自动化代码

This commit is contained in:
chengma
2026-08-06 14:07:55 +08:00
parent 956fc727be
commit f7958c6391
7 changed files with 1088 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import time
def wait_goods_page(device, timeout=30):
end_time = time.monotonic() + timeout
while time.monotonic() < end_time:
current = device.app_current()
if current.get("package") != "com.xunmeng.pinduoduo":
time.sleep(1)
continue
ready = any([
bool(device(textContains="发起拼单").exists),
bool(device(textContains="立即购买").exists),
bool(device(textContains="单独购买").exists),
bool(device(textContains="快要抢光").exists),
bool(device(textContains="免拼购买").exists),
])
loading = any([
bool(device(textContains="加载中").exists),
bool(device(textContains="正在加载").exists),
])
if ready and not loading:
return True
time.sleep(1)
return False