32 lines
1001 B
Python
32 lines
1001 B
Python
import sys
|
||
import time
|
||
from framework.business.data_management import DataManagement
|
||
from framework.config.settings import Config
|
||
|
||
def main():
|
||
"""全业务流程 UI 测试统一入口 (PO模式)"""
|
||
# 自动化环境下不使用 input,防止进程挂起
|
||
import os
|
||
is_auto = os.getenv('ROBOGO_TASK_ID') is not None
|
||
account = getattr(Config, 'AUTH_ACCOUNT', None)
|
||
if not account and not is_auto: account = input("请输入账号:")
|
||
|
||
password = getattr(Config, 'AUTH_PASSWORD', None)
|
||
if not password and not is_auto: password = input("请输入密码:")
|
||
|
||
if not account or not password:
|
||
print("❌ 错误: 未提供登录账号或密码")
|
||
sys.exit(1)
|
||
|
||
dm = DataManagement(headless=False)
|
||
try:
|
||
dm.run(account, password)
|
||
print("✅ 巡检任务执行成功")
|
||
except Exception as e:
|
||
print(f"❌ 巡检任务执行失败: {e}")
|
||
sys.exit(1)
|
||
|
||
if __name__ == "__main__":
|
||
import time
|
||
main()
|