From 80fdc75c26749b64d88e0389b1410af98d2befd4 Mon Sep 17 00:00:00 2001 From: YiLin <482244139@qq.com> Date: Wed, 11 Feb 2026 17:42:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E5=90=AF=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8=E8=AE=BE=E7=BD=AE=E6=89=8B=E6=9C=BA=E4=B8=8D=E7=86=84?= =?UTF-8?q?=E5=B1=8F=EF=BC=9B=E8=AE=BE=E7=BD=AE=E4=B8=8B=E8=BD=BD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=BA3=E4=B8=AA=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- globals/driver_utils.py | 2 +- page_objects/more_download_page.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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)