diff --git a/globals/driver_utils.py b/globals/driver_utils.py index 601baa9..cdd0cf5 100644 --- a/globals/driver_utils.py +++ b/globals/driver_utils.py @@ -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: diff --git a/page_objects/more_download_page.py b/page_objects/more_download_page.py index c1be441..c105577 100644 --- a/page_objects/more_download_page.py +++ b/page_objects/more_download_page.py @@ -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)