修改重启驱动设置手机不熄屏;设置下载数据为3个月

This commit is contained in:
2026-02-11 17:42:20 +08:00
parent 2cee7731b1
commit 80fdc75c26
2 changed files with 6 additions and 4 deletions

View File

@@ -604,7 +604,7 @@ def launch_app_manually(driver, device_id, package_name="com.bjjw.cjgc", activit
# 使用ADB命令设置屏幕永不休眠 # 使用ADB命令设置屏幕永不休眠
screen_timeout_cmd = [ screen_timeout_cmd = [
"adb", "-s", device_id, "adb", "-s", device_id,
"shell", "settings", "put", "system", "screen_off_timeout", "0" "shell", "settings", "put", "system", "screen_off_timeout", "86400000"
] ]
timeout_result = subprocess.run(screen_timeout_cmd, capture_output=True, text=True, timeout=15) timeout_result = subprocess.run(screen_timeout_cmd, capture_output=True, text=True, timeout=15)
if timeout_result.returncode == 0: if timeout_result.returncode == 0:

View File

@@ -177,8 +177,10 @@ class MoreDownloadPage:
def _swipe_year_wheel(self): def _swipe_year_wheel(self):
"""滑动年份选择器的滚轮""" """滑动年份选择器的滚轮"""
try: try:
# 获取年份选择器滚轮元素 # # 获取年份选择器滚轮元素
year_wheel = self.driver.find_element(AppiumBy.ID, "com.bjjw.cjgc:id/wheelView1") # year_wheel = self.driver.find_element(AppiumBy.ID, "com.bjjw.cjgc:id/wheelView1")
# 获取月份选择器滚轮元素
year_wheel = self.driver.find_element(AppiumBy.ID, "com.bjjw.cjgc:id/wheelView2")
# 获取滚轮的位置和尺寸 # 获取滚轮的位置和尺寸
location = year_wheel.location location = year_wheel.location
@@ -191,7 +193,7 @@ class MoreDownloadPage:
# 计算滑动距离 - 滚轮高度的1/5 # 计算滑动距离 - 滚轮高度的1/5
swipe_distance = size['height'] // 5 swipe_distance = size['height'] // 5
for i in range(1): for i in range(3):
# 执行滑动操作 - 从中心向上滑动1/5高度 # 执行滑动操作 - 从中心向上滑动1/5高度
self.driver.swipe(center_x, center_y - swipe_distance, center_x, center_y, 500) self.driver.swipe(center_x, center_y - swipe_distance, center_x, center_y, 500)