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 XF_Meeting_0001:
    tags = ['展厅巡检','讯飞测试']

    def teststeps(self):
        wd = GSTORE['wd']
        safe_click((By.XPATH, "//span[contains(text(),'已预订会议')]"), wd)
        sleep(1)
        safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字搜索']"), "展厅巡检测试", wd)
        send_keyboard((By.XPATH, "//input[@placeholder='输入关键字搜索']"), wd)
        sleep(2)
        safe_click((By.XPATH, "//span[contains(text(),'更多操作')]"),wd)
        sleep(1)
        safe_click((By.XPATH, "//li[contains(text(),'讯飞纪要')]"), wd)
        sleep(3)
        wd.switch_to.window(wd.window_handles[1])

        INFO("请检查讯飞系统是否正确单点登录")
        SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "XF_meeting", "讯飞纪要界面截屏")

        # 结束这场会议
        wd.switch_to.window(wd.window_handles[0])
        sleep(2)
        safe_click((By.XPATH, "//span[contains(text(),'已预订会议')]"),wd)
        sleep(1)
        safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字搜索']"), "展厅巡检测试", wd)
        send_keyboard((By.XPATH, "//input[@placeholder='输入关键字搜索']"), wd)
        sleep(2)

        safe_click((By.XPATH, "//span[contains(text(),'更多操作')]"), wd)
        sleep(2)
        safe_click((By.XPATH, "//li[contains(text(),'会议状态')]"),wd)
        sleep(2)
        safe_click((By.XPATH, "//span[contains(text(),'提前结束')]"), wd)
        sleep(2)
        safe_click((By.XPATH, "//div[@slot='footer']//span[contains(text(),'确定')]"), wd)
        sleep(2)