待补平差检查和上传逻辑
This commit is contained in:
22
actions.py
22
actions.py
@@ -48,6 +48,11 @@ class DeviceAutomation:
|
||||
self.driver = driver
|
||||
self.wait = wait
|
||||
self.device_id = device_id
|
||||
|
||||
if not self.device_id:
|
||||
logging.error("设备 ID 为空,无法初始化自动化")
|
||||
return
|
||||
|
||||
# 初始化权限
|
||||
if driver_utils.grant_appium_permissions(self.device_id):
|
||||
logging.info(f"设备 {self.device_id} 授予Appium权限成功")
|
||||
@@ -303,16 +308,19 @@ class DeviceAutomation:
|
||||
|
||||
# 主执行逻辑
|
||||
if __name__ == "__main__":
|
||||
create_link.setup_adb_wireless()
|
||||
device_id = create_link.setup_adb_wireless()
|
||||
automation = None
|
||||
try:
|
||||
automation = DeviceAutomation()
|
||||
success = automation.run_automation()
|
||||
|
||||
if success:
|
||||
logging.info(f"设备 {automation.device_id} 自动化流程执行成功")
|
||||
if not device_id:
|
||||
logging.error("未能获取设备 ID,无法继续执行自动化流程")
|
||||
else:
|
||||
logging.error(f"设备 {automation.device_id} 自动化流程执行失败")
|
||||
automation = DeviceAutomation(device_id=device_id)
|
||||
success = automation.run_automation()
|
||||
|
||||
if success:
|
||||
logging.info(f"设备 {automation.device_id} 自动化流程执行成功")
|
||||
else:
|
||||
logging.error(f"设备 {automation.device_id} 自动化流程执行失败")
|
||||
except Exception as e:
|
||||
logging.error(f"设备执行出错: {str(e)}")
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user