修改了上传页面点击的逻辑;增加循环
This commit is contained in:
@@ -56,7 +56,7 @@ class ScreenshotPage:
|
||||
self.logger.info("向上滑动列表")
|
||||
|
||||
# 执行滑动
|
||||
self.driver.swipe(start_x, start_y, start_x, end_y, 1000)
|
||||
self.driver.swipe(start_x, start_y, start_x, end_y, 500)
|
||||
|
||||
|
||||
# 向上滑动时,检查是否滑动到顶
|
||||
@@ -1342,27 +1342,31 @@ class ScreenshotPage:
|
||||
retry_count += 1
|
||||
continue
|
||||
|
||||
# 点击返回按钮并处理弹窗
|
||||
if not self.execute_back_navigation_steps(device_id):
|
||||
self.logger.error(f"设备 {device_id} 处理返回按钮确认失败")
|
||||
retry_count += 1
|
||||
continue
|
||||
# 检查在不在测量列表页面,不在就点击返回按钮并处理弹窗
|
||||
if self.check_measurement_list(device_id):
|
||||
self.logger.error(f"设备 {device_id} 未在测量列表页面")
|
||||
# 点击返回按钮并处理弹窗
|
||||
if not self.execute_back_navigation_steps(device_id):
|
||||
self.logger.error(f"设备 {device_id} 处理返回按钮确认失败")
|
||||
retry_count += 1
|
||||
continue
|
||||
|
||||
# 成功处理完一个断点,添加到已处理列表
|
||||
processed_breakpoints.append(item)
|
||||
# add_breakpoint_to_upload_list(item, line_code)
|
||||
self.logger.info(f"成功处理断点: {item}")
|
||||
break # 跳出重试循环
|
||||
|
||||
# 检查是否重试次数用完仍未成功
|
||||
if retry_count >= max_retry_attempts:
|
||||
if retry_count == max_retry_attempts-1:
|
||||
self.logger.error(f"断点 {item} 经过 {max_retry_attempts} 次重试后仍然失败")
|
||||
|
||||
# 重新获取当前页面项目,因为可能有新的项目加载
|
||||
break
|
||||
continue
|
||||
# 向下滑动列表以加载更多项目
|
||||
if not self.scroll_list(direction="down"):
|
||||
self.logger.error("向下滑动列表失败")
|
||||
break
|
||||
continue
|
||||
|
||||
# 检查是否到达底部:连续两次获取的项目相同
|
||||
if current_items == previous_items and len(current_items) > 0:
|
||||
|
||||
Reference in New Issue
Block a user