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, "初始化浏览器")
    browser_init()

    wd = GSTORE['wd']
    admin_login()
    enter_the_backend()

    INFO("打开会议室管理下拉菜单")
    safe_click((By.XPATH, "//div[@class='el-submenu__title']//span[contains(text(),'会议室管理')]"), wd)
    sleep(1)

    INFO("进入功能管理模块")
    safe_click((By.XPATH, "//li[contains(text(),'会议室管理')]"), wd)
    sleep(1)

def suite_teardown():
    wd = GSTORE['wd']
    wd.quit()