修改重启驱动设置手机不熄屏;设置下载数据为3个月
This commit is contained in:
@@ -604,7 +604,7 @@ def launch_app_manually(driver, device_id, package_name="com.bjjw.cjgc", activit
|
||||
# 使用ADB命令设置屏幕永不休眠
|
||||
screen_timeout_cmd = [
|
||||
"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)
|
||||
if timeout_result.returncode == 0:
|
||||
|
||||
@@ -177,8 +177,10 @@ class MoreDownloadPage:
|
||||
def _swipe_year_wheel(self):
|
||||
"""滑动年份选择器的滚轮"""
|
||||
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
|
||||
@@ -191,7 +193,7 @@ class MoreDownloadPage:
|
||||
# 计算滑动距离 - 滚轮高度的1/5
|
||||
swipe_distance = size['height'] // 5
|
||||
|
||||
for i in range(1):
|
||||
for i in range(3):
|
||||
# 执行滑动操作 - 从中心向上滑动1/5高度
|
||||
self.driver.swipe(center_x, center_y - swipe_distance, center_x, center_y, 500)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user