import sys
import os
from time import sleep

# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..','..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
try:
    from 预定系统.Base.base import *
except ModuleNotFoundError as e:
    print(f"ModuleNotFoundError: {e}")
    print("尝试使用绝对路径导入")
    from 预定系统.Base.base import *

def suite_setup():
    STEP(1, "初始化浏览器")
    login_exhibit_url = 'http://192.168.5.200:8080/#/login/logindf'
    login_exhibit_ngrok_url = 'http://nat.ubainsyun.com:11060/#/login/logindf'
    browser_init(login_exhibit_url)

    wd = GSTORE['wd']
    admin_login("Test02", "ubains@123")
    sleep(5)

    STEP(2, "无纸化会议信息")
    SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","无纸化会议信息截图")
    SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","无纸化首页截图")

    STEP(3, "无纸化议题信息")
    INFO("请查看议题显示")
    SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件截图")
    INFO("请查看议题文件1显示")
    SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件1截图")
    INFO("请查看议题文件2显示")
    SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件2截图")
    INFO("请查看议题文件3显示")
    SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件3截图")

def suite_teardown():
    browser_quit()