讯飞系统巡检.py 2.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
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:
14
    tags = ['展厅巡检','讯飞测试']
15 16 17 18 19

    def teststeps(self):
        wd = GSTORE['wd']
        safe_click((By.XPATH, "//span[contains(text(),'已预订会议')]"), wd)
        sleep(1)
20 21 22
        safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字搜索']"), "展厅巡检测试", wd)
        send_keyboard((By.XPATH, "//input[@placeholder='输入关键字搜索']"), wd)
        sleep(2)
23 24
        safe_click((By.XPATH, "//span[contains(text(),'更多操作')]"),wd)
        sleep(1)
25
        safe_click((By.XPATH, "//li[contains(text(),'讯飞纪要')]"), wd)
26
        sleep(3)
27
        wd.switch_to.window(wd.window_handles[1])
28 29 30 31 32
        sleep(5)
        app_id = os.getenv("APP_ID", "a98a124c6c3252f6612fc544a0d0fa79")
        app_secret = os.getenv("APP_SECRET", "88bc1ec4eba624f47b2200a4ce8c3852")
        device_sn = os.getenv("DEVICE_SN", "W703BB44444")
        play_cloud_voice(app_id, app_secret, device_sn)
33

34
        INFO("请检查讯飞系统是否正确单点登录,并查看讯飞语音转录是否成功!!!")
35
        SELENIUM_LOG_SCREEN(wd, "75%", "Exhibit_Inspect", "XF_meeting", "讯飞纪要界面截屏")
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

        # 结束这场会议
        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)
53 54 55
        sleep(2)
        # 点击二次确认按钮
        safe_click((By.XPATH, "//button[@class='el-button el-button--default el-button--small el-button--primary ']//span[contains(text(),'确定')]"), wd)
56
        sleep(2)