工况类型找不到时在列表循环匹配。

This commit is contained in:
2026-03-05 17:34:46 +08:00
parent e285191149
commit 4cc6a3391f
12 changed files with 17025 additions and 17000 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ missing module named multiprocessing.BufferTooShort - imported by multiprocessin
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named posix - imported by os (conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional), posixpath (optional)
missing module named posix - imported by posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), os (conditional, optional)
missing module named resource - imported by posix (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)

Binary file not shown.

View File

@@ -170,9 +170,9 @@ class DeviceAutomation(object):
# 实现连续获取断点列表直到两次相同
previous_breakpoint_list = None
current_breakpoint_list = None
max_attempts = 10 # 最大尝试次数
max_attempts = 5 # 最大尝试次数
attempt_count = 0
while True:
while attempt_count < max_attempts:
# 获取当前页面的断点列表
# 从当前页面获取断点列表名称

View File

@@ -1024,6 +1024,31 @@ class UploadConfigPage:
)
condition_button.click()
self.logger.info(f"成功点击{work_type_name}工况选择按钮")
except TimeoutException:
self.logger.error(f"等待{work_type_name}工况选择按钮超时")
id_list = [
"com.bjjw.cjgc:id/all_point_workinfo_sp_suidao",
"com.bjjw.cjgc:id/all_point_workinfo_sp_luji",
"com.bjjw.cjgc:id/all_point_workinfo_sp_qiaoliang",
"com.bjjw.cjgc:id/all_point_workinfo_sp_handong",
]
for id in id_list:
if id == button_id:
continue
try:
self.wait.until(
EC.element_to_be_clickable((AppiumBy.ID, id))
)
self.driver.find_element(AppiumBy.ID, id).click()
self.logger.info(f"成功点击{work_type_name}其他工况选择按钮: {id}")
except TimeoutException:
self.logger.error(f"等待{work_type_name}其他工况选择按钮超时: {id}")
# return False
except Exception as e:
self.logger.error(f"点击{work_type_name}工况按钮时出错: {str(e)}")
return False
# 检查是否有ListView如果没有就再次点击
try:
@@ -1045,10 +1070,10 @@ class UploadConfigPage:
else:
self.logger.warning(f"未能为{work_type_name}选择主要工况: {workinfo_name}")
except TimeoutException:
self.logger.error(f"等待{work_type_name}工况选择按钮超时")
except Exception as e:
self.logger.error(f"点击{work_type_name}工况按钮时出错: {str(e)}")
# except TimeoutException:
# self.logger.error(f"等待{work_type_name}工况选择按钮超时")
# except Exception as e:
# self.logger.error(f"点击{work_type_name}工况按钮时出错: {str(e)}")
# 第二步:如果有次要工况,滑动页面处理
if minor_conditions_list: