import sys
import os

# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..','..','..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
from 预定系统.Base.base import *

class Operation_maintenance_0001:
    tags = ['展厅巡检','运维系统巡检']

    def teststeps(self):
        wd = GSTORE['wd']

        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "首页界面")
        safe_click((By.XPATH, "(//span[contains(text(),'进入系统')])[4]"), wd)
        sleep(4)
        # 检查会议室数据展示界面并截图
        INFO("请查看会议室的数据展示情况")
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "进入系统界面")

        INFO("请查看设备列表的连接状态")
        # 检查五大系统的设备连接状态并截图
        safe_click((By.XPATH, "//span[contains(text(),'设备列表')]"), wd)
        sleep(4)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "设备连接状态")

        INFO("请查看视频系统设备的连接状态")
        safe_click((By.XPATH, "(//img)[11]"), wd)
        sleep(4)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "视频系统")

        INFO("请查看音频系统设备的连接状态")
        safe_click((By.XPATH, "(//img)[12]"), wd)
        sleep(4)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "音频系统")

        INFO("请查看控制系统设备的连接状态")
        safe_click((By.XPATH, "(//img)[13]"),wd)
        sleep(4)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "控制系统")

        INFO("请查看网络系统设备的连接状态")
        safe_click((By.XPATH, "(//img)[14]"),wd)
        sleep(4)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "网络系统")

        INFO("请查看电源系统设备的连接状态")
        safe_click((By.XPATH, "(//img)[15]"),wd)
        sleep(4)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "电源系统")

        INFO("请查看运维系统的告警数据展示")
        safe_click((By.XPATH, "//li[contains(text(),'数据展示')]"), wd)
        sleep(20)
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Operation_maintenance", "告警数据展示")