uiautomator2移动端结合后端接口配置通话压力测试

一、框架结构

框架基于python+uiautomator2+selenium;主要分为5个部分:

第1个是入口文件,run.py

第2个是配置文件xml,主要是为了管理用例

第3个是公共文件common,主要存放一些公共方法;如:解析配置文件的方式、生成的测试报告样式、简单的异常判断

第4个是用例文件case,主要存放用例脚本

第5个是结果文件result,主要存放测试报告、log、异常截图

如下图所示:

二、框架demo

1、入口文件run.py

复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
 @Author: 童臻
 @Email: 2684553351@qq.com
 @FileName: run.py
 @DateTime: 2025/08/12 9:46
 @SoftWare: PyCharm
"""
import time
import os
import subprocess
from operator import methodcaller
from case.case import Case
from common.base import pull_devices_logs
from common.parse_xml import Xml
from common.generate_report import Excel

# 设备IP设置
d1_ip = "10.10.5.96:1898"  # 床头屏
d2_ip = "10.10.5.72:1898"  # 床旁屏
d3_ip = "10.10.5.158:1898"  # 护士站主机
d4_ip = "10.10.5.103:1898"  # 门口屏
d7_ip = "10.10.5.122:1898"  # 护士站主机(转呼)
d8_ip = "10.10.5.184:1379"  # 护理交互大屏
d9_ip = "10.10.5.252"  # 走廊屏
d5_ip = "10.10.5.75:1898"  # 探视屏
d6_ip = "10.10.5.187:1898"  # 探视车
d10_ip = "10.10.5.118:1898"  # 床头屏(同床位)
d11_ip = "10.10.5.181:1898"  # 床旁屏(同床位)


class Demo(Xml, Excel):
    def run(self):
        try:
            # 开始抓log
            if not os.path.exists(log_path):
                os.makedirs(log_path)
            # file_name = os.path.join(log_path, '{}.log'.format('low_memory_killer'))
            # with open(file_name, 'w') as file_path:
            #     cmd = "adb -s {} shell logcat -v time | grep -in lowmemorykiller".format(self.device)
            #     p = subprocess.Popen(cmd, stdout=file_path, stderr=subprocess.PIPE)
            #
            # file_name1 = os.path.join(log_path, '{}.log'.format('win_death'))
            # with open(file_name1, 'w') as file_path1:
            #     cmd1 = "adb -s {} shell logcat | grep -E 'WIN DEATH|am_proc_died|DeadSystemException|Watchdog|WINDOW DEATH' ".format(self.device)
            #     p1 = subprocess.Popen(cmd1, stdout=file_path1, stderr=subprocess.PIPE, encoding='utf-8')
            #
            # file_name2 = os.path.join(log_path, '{}.log'.format('crash'))
            # with open(file_name2, 'w') as file_path2:
            #     cmd2 = "adb -s {} shell logcat -b crash ".format(self.device)
            #     p2 = subprocess.Popen(cmd2, stdout=file_path2, stderr=subprocess.PIPE, encoding='utf-8')
            file_name = os.path.join(log_path, '{}.log'.format('ctp_log'))
            with open(file_name, 'w') as file_path:
                "adb -s {} shell logcat -c".format(d1_ip)
                "adb -s {} shell setprop log.main.size 100M".format(d1_ip)
                cmd = "adb -s {} shell logcat -v time | grep -in flutter".format(d1_ip)
                p = subprocess.Popen(cmd, stdout=file_path, stderr=subprocess.PIPE)

            file_name1 = os.path.join(log_path, '{}.log'.format('cpp_log'))
            with open(file_name1, 'w') as file_path1:
                "adb -s {} shell logcat -c".format(d2_ip)
                "adb -s {} shell setprop log.main.size 100M".format(d2_ip)
                cmd1 = "adb -s {} shell logcat -v time | grep -in flutter".format(d2_ip)
                p1 = subprocess.Popen(cmd1, stdout=file_path1, stderr=subprocess.PIPE, encoding='utf-8')

            file_name2 = os.path.join(log_path, '{}.log'.format('hsz_log'))
            with open(file_name2, 'w') as file_path2:
                "adb -s {} shell logcat -c".format(d3_ip)
                "adb -s {} shell setprop log.main.size 100M".format(d3_ip)
                cmd2 = 'adb -s {} shell logcat | grep -i "CommonLog"'.format(d3_ip)
                p2 = subprocess.Popen(cmd2, stdout=file_path2, stderr=subprocess.PIPE, encoding='utf-8')

            file_name3 = os.path.join(log_path, '{}.log'.format('mkp_log'))
            with open(file_name3, 'w') as file_path2:
                "adb -s {} shell logcat -c".format(d4_ip)
                "adb -s {} shell setprop log.main.size 100M".format(d4_ip)
                cmd3 = "adb -s {} shell logcat -v time | grep -in com.ocamara.gatescreen".format(d4_ip)
                p3 = subprocess.Popen(cmd3, stdout=file_path2, stderr=subprocess.PIPE, encoding='utf-8')
            # 启动测试用例
            # os.system('adb -s {} shell am force-stop com.bedside.bed_side'.format(self.device))
            demo_case = Case()

            # 大循环
            list_report = []
            for i in range(self.round):

                # 遍历所有的case
                for case in self.test_list:
                    case_round = str(i + 1)
                    case_name = case[0]
                    case_des = case[1]
                    count = int(case[2])

                    # case小循环
                    for j in range(count):
                        case_count = str(j + 1)
                        fail_name = case_name + "_{}_{}_{}".format(case_round, case_count, case_des)
                        start_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())

                        # 单条用例执行
                        resut = methodcaller(case_name, log_img_path, fail_name)(demo_case)
                        end_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
                        case_names = case_name + "_{}_{}".format(case_round, case_count)
                        print(case_names, case_des, "测试结果:" + resut, "开始时间:" + start_time,
                              "结束时间:" + end_time)
                        list_report.append([case_names, case_des, resut, start_time, end_time])
                        time.sleep(1)
                # 生成测试报告
                Excel(report_path, list_report).gen_report()
                # 抓log
                if os.path.exists(log_img_path):
                    pull_devices_logs(
                        log_txt_path=log_path,  # 父目录
                        folder_name='ctp_logs_' + str(i + 1) + "_" + d1_ip.split(":")[0],  # 子文件夹名
                        log_dir="/sdcard/Android/data/com.bedside/files/Log",  # 设备log路径
                        devices=d1_ip  # 替换为你的设备序列号(adb devices查看)
                    )
                    pull_devices_logs(
                        log_txt_path=log_path,  # 父目录
                        folder_name='cpp_logs_' + str(i + 1) + "_" + d2_ip.split(":")[0],  # 子文件夹名
                        log_dir="/sdcard/Android/data/com.example.wisdom_side/files",  # 设备log路径
                        devices=d2_ip  # 替换为你的设备序列号(adb devices查看)
                    )
                    pull_devices_logs(
                        log_txt_path=log_path,  # 父目录
                        folder_name='hsz_logs_' + str(i + 1) + "_" + d3_ip.split(":")[0],  # 子文件夹名
                        log_dir="/sdcard/Android/data/com.ocamara.gatescreen/files",  # 设备log路径
                        devices=d3_ip  # 替换为你的设备序列号(adb devices查看)
                    )
                    pull_devices_logs(
                        log_txt_path=log_path,  # 父目录
                        folder_name='mkp_logs_' + str(i + 1) + "_" + d4_ip.split(":")[0],  # 子文件夹名
                        log_dir="/sdcard/Android/data/com.ocamara.nursecentre/files/logs",  # 设备log路径
                        devices=d4_ip  # 替换为你的设备序列号(adb devices查看)
                    )

            # 结束抓log
            p.terminate()
            p1.terminate()
            p2.terminate()
            p3.terminate()
        except Exception as e:
            p.terminate()
            p1.terminate()
            p2.terminate()
            p3.terminate()
            print(e)


if __name__ == '__main__':
    current_time = time.strftime('%Y_%m_%d_%H_%M_%S', time.localtime())
    xml_path = "./config//config.xml"
    report_path = "./result/{}/".format(current_time)
    log_img_path = './result/{}/log_img/'.format(current_time)
    log_path = './result/{}/log_txt/'.format(current_time)
    aa = Demo(xml_path)
    aa.run()

2、配置文件config.config.xml

复制代码
<?xml version="1.0" encoding="utf-8"?>
<Config>
    <Name>床头屏</Name>
	<common device="10.10.5.96:1898" round="5"/>
<!--    <case name="tc_000" des="检测应用是否闪退(应用闪退后,重启应用)" count="1"/>-->
    <case name="tc_000_1" des="初始化智慧病房后台配置___PR__初始化智慧病房后台配置成功" count="1"/>
    <case name="tc_001" des="床头屏发起呼叫后自动取消呼叫(普通呼叫)___PR__床头屏可以取消普通呼叫" count="1"/>
    <case name="tc_002" des="床头屏发起呼叫后自动取消呼叫(增援呼叫)___PR__床头屏可以取消增援呼叫" count="1"/>
    <case name="tc_003" des="床头屏与护士站进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_004" des="床头屏与护士站进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_005" des="床头屏与护士站进行语音通话(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_006" des="床头屏与护士站进行语音通话前呼叫转移(普通呼叫)___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_007" des="床头屏与护士站进行语音通话前呼叫转移(增援呼叫)___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_008" des="床头屏与护士站进行语音通话后呼叫转移(普通呼叫)___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_009" des="床头屏与护士站进行语音通话后呼叫转移(增援呼叫)___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_010" des="床头屏发起卫生间呼叫,护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_011" des="床头屏发起呼叫后,1min无人接听自动取消(普通呼叫)___PR__可以自动取消普通呼叫" count="1"/>
    <case name="tc_012" des="床头屏发起呼叫后,1min无人接听自动取消(普通呼叫)___PR__可以自动取消增援呼叫" count="1"/>
    <case name="tc_013" des="床头屏发起卫生间呼叫后,1min无人接听自动取消___PR__可以自动取消卫生间呼叫" count="1"/>
    <case name="tc_014" des="护士站直呼床头屏___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_014_1" des="护士站直呼床头屏(同床位)___PR__优先与床头通话,可以正常通话,正常挂断" count="1"/>
    <case name="tc_015" des="护士站挂断床头屏(普通呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_016" des="护士站挂断床头屏(增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_017" des="护士站挂断床头屏(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_018" des="床头屏与门口屏进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_019" des="床头屏与门口屏进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_020" des="床头屏与门口屏进行语音通话(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_021" des="床头屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_022" des="门口屏挂断床头屏(普通呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_023" des="门口屏挂断床头屏(增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_024" des="门口屏挂断床头屏(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_025" des="床旁屏发起呼叫后取消呼叫___PR__床旁屏可以取消普通呼叫" count="1"/>
    <case name="tc_026" des="床旁屏与护士站进行语音通话___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_027" des="床旁屏与护士站进行视频通话___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_028" des="床旁屏与护士站进行语音转视频通话___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_029" des="床旁屏与护士站进行语音通话前呼叫转移___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_030" des="床旁屏与护士站进行视频通话前呼叫转移___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_031" des="床旁屏与护士站进行语音通话后呼叫转移___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_032" des="床旁屏发起卫生间呼叫,护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_033" des="床旁屏发起呼叫后,1min无人接听自动取消(普通呼叫)___PR__可以自动取消普通呼叫" count="1"/>
    <case name="tc_034" des="床旁屏发起卫生间呼叫后,1min无人接听自动取消___PR__可以自动取消卫生间呼叫" count="1"/>
    <case name="tc_035" des="护士站直呼床旁屏___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_036" des="护士站挂断床旁屏___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_037" des="床旁屏与门口屏进行语音通话___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_038" des="床旁屏与门口屏进行视频通话___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_039" des="床旁屏与门口屏进行语音转视频通话___PR__可以正常通话,正常挂断【不支持P2P通话】" count="1"/>
    <case name="tc_040" des="床旁屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_041" des="门口屏挂断床旁屏___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_042" des="床头屏与护士站建立通话后,床旁屏与门口屏再建立通话___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_043" des="床头屏发起呼叫后,床头屏与护士站建立通话;床旁屏发起呼叫后,监控床旁屏通话弹窗___PR__护士站有通话中和床旁呼叫两个弹窗" count="1"/>
    <case name="tc_044" des="床头屏发起普通呼叫后,床头屏与护士站建立通话;床旁屏强制与护士站建立通话___PR__床旁屏可以强制和护士站通话" count="1"/>
    <case name="tc_045" des="床头屏发起增援呼叫后,床头屏与护士站建立通话;床旁屏强制与护士站建立通话___PR__床旁屏可以强制和护士站通话" count="1"/>
    <case name="tc_046" des="床头屏发起呼叫后,床头屏与护士站建立通话;护士站挂断床头屏,床旁屏发起呼叫后,接听床旁屏___PR__床旁屏可以和护士站正常通话、正常挂断" count="1"/>
    <case name="tc_047" des="床头屏和床旁屏依次发起呼叫后,床头屏与护士站建立通话后挂断;监控床旁屏通话弹窗___PR__护士站有通话中和床旁屏呼叫两个弹窗" count="1"/>
    <case name="tc_048" des="床头屏发起呼叫后,床头屏与门口屏建立通话;床旁屏发起呼叫后,监控床旁屏通话弹窗___PR__门口屏有通话中和床旁屏呼叫两个弹窗" count="1"/>
    <case name="tc_049" des="床头屏发起呼叫后,床头屏与门口屏建立通话;床旁屏发起呼叫后,门口屏挂断床头屏,接听床旁屏___PR__门口屏可以和床旁屏正常通话,正常挂断" count="1"/>
    <case name="tc_050" des="床旁屏发起呼叫后,床旁屏与护士站建立通话;床头屏发起呼叫后,监控床头屏通话弹窗___PR__护士站有通话中和床头呼叫两个弹窗" count="1"/>
    <case name="tc_051" des="床旁屏发起呼叫后,床旁屏与护士站建立通话;床头屏强制与护士站建立通话___PR__床头屏可以强制和护士站通话" count="1"/>
    <case name="tc_052" des="床旁屏发起呼叫后,床旁屏与护士站建立通话;护士站挂断床旁屏,床头屏发起呼叫后,接听床头屏___PR__护士站可以和床头屏正常通话,正常挂断" count="1"/>
    <case name="tc_053" des="床旁屏和床头屏依次发起呼叫后,床旁屏与护士站建立通话后挂断;监控床头屏通话弹窗___PR__护士站有通话中和床头呼叫两个弹窗" count="1"/>
    <case name="tc_054" des="床旁屏发起呼叫后,床旁屏与门口屏建立通话;床头屏发起呼叫后,监控床头屏通话弹窗___PR__门口屏有通话中和床头呼叫两个弹窗" count="1"/>
    <case name="tc_055" des="床旁屏发起呼叫后,床旁屏与门口屏建立视频通话;床头屏发起呼叫后,门口屏挂断和床旁屏的视频通话【不支持P2P通话】___PR__" count="1"/>
    <case name="tc_056" des="床旁屏发起呼叫后,床旁屏与门口屏建立视频通话;床头屏发起呼叫后,护士站挂断床头屏【不支持P2P通话】___PR__床头屏可以和门口屏正常通话、正常挂断" count="1"/>
    <case name="tc_057" des="床旁屏与门口屏建立视频通话,床头屏与护士站建立通话,门口屏挂断视频通话,护士站挂断语音通话【不支持P2P通话】___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_058" des="床旁屏发起呼叫后,床旁屏与门口屏建立通话;床头屏发起呼叫,门口屏挂断床旁屏,接听床头屏___PR__门口屏能和床头屏正常通话,正常挂断" count="1"/>
    <case name="tc_059" des="床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫___PR__护士站主机弹窗展示顺序是否满足从上往下依次卫生间呼叫、增援呼叫、普通呼叫" count="1"/>
    <case name="tc_060" des="护士站发起全病区实时广播后___PR__床头屏、床旁屏、门口屏能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_060_1" des="护士站发起实时广播后,床头屏发起卫生间呼叫___PR__护士站能正常挂断床头屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_060_2" des="护士站发起实时广播后,床旁屏发起卫生间呼叫___PR__护士站能正常挂断床旁屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_060_3" des="护士站发起实时广播后,床头屏发起卫生间呼叫___PR__护理大屏正常挂断床头屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_060_4" des="护士站发起实时广播后,床旁屏发起卫生间呼叫___PR__护理大屏能正常挂断床旁屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_060_5" des="护士站发起实时广播后,门口屏发起卫生间呼叫___PR__护理大屏能正常挂断门口屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_061" des="护士站发起实时广播后,门口屏发起卫生间呼叫___PR__护士站能正常挂断门口屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_062" des="护士站发起实时广播后,门口屏发起卫生间呼叫___PR__门口屏能正常挂断门口屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_063" des="护士站发起多床位实时广播后___PR__床头屏收到广播、门口屏收不到广播【不支持P2P通话】" count="1"/>
    <case name="tc_063_1" des="护士站发起单床位实时广播___PR__床头屏、床旁屏、门口屏收不到广播【不支持P2P通话】" count="1"/>
    <case name="tc_063_2" des="护士站发起A组实时广播___PR__A组床头屏、AB门口屏能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_063_3" des="护士站发起B组实时广播___PR__B组床旁屏、AB门口屏能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_063_4" des="护士站发起C组实时广播___PR__A组床头屏、B组床旁屏、AB门口屏不能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_064" des="护士站发起实时广播后,床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫___PR__护士站只能收到卫生间呼叫弹窗【不支持P2P通话】" count="1"/>
    <case name="tc_065" des="护士站发起音频广播后___PR__床头屏、床旁屏、门口屏是否收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_065_1" des="护士站A发起呼叫,护士站B接通___PR__护士站跨科呼叫通话正常" count="1"/>
    <case name="tc_065_2" des="护士站发起A组实时广播___PR__A组床头屏、AB门口屏能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_065_3" des="护士站发起B组实时广播___PR__B组床旁屏、AB门口屏能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_065_4" des="护士站发起C组实时广播___PR__A组床头屏、B组床旁屏、AB门口屏不能收到广播【不支持P2P通话】" count="1"/>
    <case name="tc_066" des="护士站发起音频广播后,床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫___PR__床头屏、床头屏、门口屏呼叫弹窗覆盖广播弹窗【不支持P2P通话】" count="1"/>
    <case name="tc_067" des="门口屏发起卫生间呼叫、护士站挂断___PR__护士站正常挂断卫生间呼叫" count="1"/>
    <case name="tc_068" des="门口屏发起卫生间呼叫后,1min无人接听自动取消___PR__可以自动取消卫生间呼叫" count="1"/>
    <case name="tc_069" des="门口屏发起卫生间呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断门口屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_070" des="床头屏发起卫生间呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断床头屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_071" des="床旁屏发起卫生间呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断床旁屏卫生间呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_072" des="床头屏发起普通呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断床头屏普通呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_073" des="床旁屏发起普通呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断床旁屏普通呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_074" des="床头屏发起增援呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断床头屏增援呼叫【不支持P2P通话】" count="1"/>
    <case name="tc_075" des="床头屏发起普通呼叫切换到增援呼叫、护理交互大屏挂断___PR__护理大屏能正常挂断床头屏增援呼叫【不支持P2P通话】" count="1"/>
<!--    <case name="tc_076" des="患者若为一级护理,床旁屏(17床)发起呼叫___PR__护士站提示:患者为一级护理等级,是否立即接听?" count="1"/>-->
<!--    <case name="tc_077" des="患者若为特级护理,床头屏(16床)发起呼叫___PR__护士站提示:患者为特级护理等级,是否立即接听?" count="1"/>-->
<!--    <case name="tc_078" des="患者若为一级护理,床旁屏(17床)发起呼叫___PR__门口屏提示:患者为一级护理等级,是否立即接听?" count="1"/>-->
<!--    <case name="tc_079" des="患者若为特级护理,床头屏(16床)发起呼叫___PR__门口屏提示:患者为特级护理等级,是否立即接听?" count="1"/>-->
<!--    <case name="tc_080" des="床旁屏(17床)与主机进行语音通话的时候,收到床头屏(16床)发来的语音通话请求___PR__可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_081" des="床旁屏(17床)与主机进行视频通话的时候,收到床头屏(16床)发来的语音通话请求___PR__可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_082" des="床头屏(16床)与主机进行语音通话的时候,收到床旁屏(17床)发来的语音通话请求___PR__可以将当前语音通话设为保持状态,与床旁屏(17床)进行语音通话" count="1"/>-->
<!--    <case name="tc_083" des="床头屏(16床)与主机进行语音通话的时候,收到床旁屏(17床)发来的视频通话请求___PR__可以将当前视频通话设为保持状态,与床旁屏(17床)进行视频通话" count="1"/>-->
<!--    <case name="tc_084" des="床旁屏(17床)与主机进行语音通话后点击保持,床头屏(16床)与主机建立语音通话___PR__主机挂断16床语音通话后点击恢复,与床旁屏(17床)进行语音通话" count="1"/>-->
<!--    <case name="tc_085" des="床旁屏(17床)与主机进行视频通话后点击保持,床头屏(16床)与主机建立语音通话___PR__主机挂断16床语音通话后点击恢复,与床头屏(17床)进行视频通话" count="1"/>-->
<!--    <case name="tc_086" des="床头屏(16床)与主机进行语音通话后点击保持,床旁屏(17床)与主机建立语音通话___PR__主机直接点击恢复,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_087" des="床头屏(16床)与主机进行语音通话后点击保持,床旁屏(17床)与主机建立视频通话___PR__主机直接点击保持,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_088" des="床旁屏(17床)与门口屏进行语音通话的时候,收到床头屏(16床)发来的语音通话请求___PR__可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_089" des="床旁屏(17床)与门口屏进行视频通话的时候,收到床头屏(16床)发来的语音通话请求___PR__可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_090" des="床头屏(16床)与门口屏进行语音通话的时候,收到床旁屏(17床)发来的语音通话请求___PR__可以将当前语音通话设为保持状态,与床旁屏(17床)进行语音通话" count="1"/>-->
<!--    <case name="tc_091" des="床头屏(16床)与门口屏进行语音通话的时候,收到床旁屏(17床)发来的视频通话请求___PR__可以将当前视频通话设为保持状态,与床旁屏(17床)进行视频通话" count="1"/>-->
<!--    <case name="tc_092" des="床旁屏(17床)与门口屏进行语音通话后点击保持,床头屏(16床)与门口屏建立语音通话___PR__门口屏挂断16床语音通话后点击恢复,与床旁屏(17床)进行语音通话" count="1"/>-->
<!--    <case name="tc_093" des="床旁屏(17床)与门口屏进行视频通话后点击保持,床头屏(16床)与门口屏建立语音通话___PR__门口屏挂断16床语音通话后点击恢复,与床头屏(17床)进行视频通话" count="1"/>-->
<!--    <case name="tc_094" des="床头屏(16床)与门口屏进行语音通话后点击保持,床旁屏(17床)与门口屏建立语音通话___PR__门口屏挂断17床语音通话后点击恢复,与床头屏(16床)进行语音通话" count="1"/>-->
<!--    <case name="tc_095" des="床头屏(16床)与门口屏进行语音通话后点击保持,床旁屏(17床)与门口屏建立视频通话___PR__门口屏挂断17床视频通话后点击保持,与床头屏(16床)进行语音通话" count="1"/>-->
    <case name="tc_101" des="退出床头屏后,床头屏发起呼叫后自动取消呼叫(普通呼叫)___PR__床头屏可以取消普通呼叫" count="1"/>
    <case name="tc_102" des="退出床头屏后,床头屏发起呼叫后自动取消呼叫(增援呼叫)___PR__床头屏可以取消增援呼叫" count="1"/>
    <case name="tc_103" des="退出床头屏后,床头屏与护士站进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_104" des="退出床头屏后,床头屏与护士站进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_105" des="退出床头屏后,床头屏发起卫生间呼叫,护士站挂断___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_106" des="退出床头屏后,床头屏与门口屏进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_107" des="退出床头屏后,床头屏与门口屏进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_108" des="退出床头屏后,床头屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_109" des="退出床旁屏后,床旁屏发起呼叫后取消呼叫___PR__床旁屏可以取消普通呼叫" count="1"/>
    <case name="tc_110" des="退出床旁屏后,床旁屏与护士站进行语音通话___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_111" des="退出床旁屏后,床旁屏发起卫生间呼叫,护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_112" des="退出床旁屏后,床旁屏与门口屏进行语音通话___PR__可以正常通话,正常挂断" count="1"/>
    <case name="tc_113" des="退出床旁屏后,床旁屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_114" des="退出门口屏后,门口屏发起卫生间呼叫、护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断" count="1"/>
    <case name="tc_115" des="床头屏与护士站进行语音通话,重启床头屏___PR__床头和护士站弹窗30秒都消失【不支持P2P通话】" count="1"/>
    <case name="tc_116" des="床头屏与门口屏进行语音通话,重启床头屏___PR__床头和门口屏弹窗30秒都消失【不支持P2P通话】" count="1"/>
    <case name="tc_117" des="床旁屏与护士站进行语音通话,重启床旁屏___PR__床旁和护士站弹窗30秒都消失【不支持P2P通话】" count="1"/>
    <case name="tc_118" des="床旁屏与门口屏进行语音通话,重启床旁屏___PR__床旁和门口屏弹窗30秒都消失【不支持P2P通话】" count="1"/>
    <case name="tc_119" des="护士站设置分组呼叫时间00:01-23:59___PR__分组呼叫时间开启成功" count="1"/>
    <case name="tc_120" des="在分组呼叫时间内,A组床头屏发起呼叫___PR__A组护士站可以正常通话,正常挂断" count="1"/>
    <case name="tc_121" des="在分组呼叫时间内,A组床头屏发起呼叫___PR__AB组门口屏可以正常通话,正常挂断" count="1"/>
    <case name="tc_122" des="在分组呼叫时间内,C组床头屏发起呼叫___PR__A组护士站无法收到C组床头屏呼叫消息" count="1"/>
    <case name="tc_123" des="在分组呼叫时间内,C组床头屏发起呼叫___PR__AB组门口屏无法收到C组床头屏呼叫消息" count="1"/>
    <case name="tc_124" des="在分组呼叫时间内,B组床旁屏发起呼叫___PR__A组护士站无法收到B组床旁屏呼叫消息" count="1"/>
    <case name="tc_125" des="在分组呼叫时间内,B组床旁屏发起呼叫___PR__AB组门口屏可以正常通话,正常挂断" count="1"/>
    <case name="tc_126" des="在分组呼叫时间内,C组床旁屏发起呼叫___PR__AB组门口屏无法收到C组床旁屏呼叫消息" count="1"/>
    <case name="tc_127" des="护士站设置分组呼叫时间00:00-00:00___PR__分组呼叫时间关闭成功" count="1"/>
    <case name="tc_128" des="床头屏(床位名称不带床)发起呼叫___PR__护士站、门口屏、护理大屏呼叫弹窗不带床【不支持P2P通话】" count="1"/>
    <case name="tc_129" des="床旁屏(床位名称不带床)发起呼叫___PR__护士站、门口屏、护理大屏呼叫弹窗不带床【不支持P2P通话】" count="1"/>
    <case name="tc_130" des="关闭增援SOS提醒___PR__增援SOS提醒关闭成功" count="1"/>
    <case name="tc_131" des="床头屏发起增援呼叫___PR__床头屏、护士站呼叫弹窗显示增援呼叫中" count="1"/>
    <case name="tc_132" des="打开增援SOS提醒___PR__增援SOS提醒打开成功" count="1"/>
    <case name="tc_133" des="床头屏发起增援呼叫___PR__床头屏、护士站呼叫弹窗显示SOS" count="1"/>
    <case name="tc_134" des="切换到新版RS485报警器___PR__新版RS485报警器切换成功" count="1"/>
    <case name="tc_135" des="门口屏发起卫生间呼叫___PR__门口屏不可以发起普通卫生间呼叫" count="1"/>
    <case name="tc_136" des="切换到普通报警器___PR__普通报警器切换成功" count="1"/>
    <case name="tc_137" des="门口屏发起卫生间呼叫___PR__门口屏可以发起普通卫生间呼叫" count="1"/>
    <case name="tc_138" des="设备声音配置走廊屏勾选全部,门口屏勾选实时广播___PR__声音配置设置成功【不支持P2P通话】" count="1"/>
    <case name="tc_139" des="床头屏发起呼叫___PR__门口屏、护理大屏能收到呼叫弹窗【不支持P2P通话】" count="1"/>
    <case name="tc_140" des="床旁屏发起呼叫___PR__门口屏、护理大屏能收到呼叫弹窗【不支持P2P通话】" count="1"/>
    <case name="tc_141" des="护士站发起实时广播___PR__床头屏、床旁屏无法收到实时广播【不支持P2P通话】" count="1"/>
    <case name="tc_142" des="护士站发起音频广播___PR__床头屏、床旁屏、门口屏无法收到音频广播【不支持P2P通话】" count="1"/>
    <case name="tc_143" des="设备声音配置总开关关闭___PR__设备声音配置总开关关闭成功【不支持P2P通话】" count="1"/>
    <case name="tc_144" des="床头屏发起增援呼叫___PR__护士站、门口屏、护理大屏收到呼叫弹窗【不支持P2P通话】" count="1"/>
    <case name="tc_145" des="床旁屏发起呼叫___PR__护士站、门口屏、护理大屏收到呼叫弹窗【不支持P2P通话】" count="1"/>
    <case name="tc_146" des="护士站发起实时广播___PR__床旁屏(与床头同床位)无法收到实时广播【不支持P2P通话】" count="1"/>
    <case name="tc_147" des="护士站发起音频广播___PR__床头屏、床旁屏不能收到音频广播【不支持P2P通话】" count="1"/>
    <case name="tc_148" des="护士站发起音频广播___PR__门口屏能收到音频广播【不支持P2P通话】" count="1"/>
    <case name="tc_149" des="设备声音配置总开关开启(勾选全部)___PR__设备声音配置总开关开启成功【不支持P2P通话】" count="1"/>
<!--    <case name="tc_0x1" des="强制开启P2P呼叫" count="1"/>-->
<!--    <case name="tc_0x2" des="强制关闭P2P呼叫" count="1"/>-->
    <case name="tc_096" des="强制关闭SIP服务___PR__SIP关闭成功" count="1"/>
<!--    <case name="tc_097" des="强制启动SIP服务___PR__SIP启动成功" count="1"/>-->
<!--    <case name="tc_098" des="安装CallService服务成功" count="1"/>-->
<!--    <case name="tc_099" des="关闭应用通话声音" count="1"/>-->
<!--    <case name="tc_100" des="打开应用通话声音" count="1"/>-->
<!--    <case name="tc_000" des="检测应用是否闪退(应用闪退后,重启应用)" count="1"/>-->
    <case name="tc_001" des="床头屏发起呼叫后自动取消呼叫(普通呼叫)___PR__床头屏可以取消普通呼叫【P2P】" count="1"/>
    <case name="tc_002" des="床头屏发起呼叫后自动取消呼叫(增援呼叫)___PR__床头屏可以取消增援呼叫【P2P】" count="1"/>
    <case name="tc_003" des="床头屏与护士站进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_004" des="床头屏与护士站进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_005" des="床头屏与护士站进行语音通话(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_010" des="床头屏发起卫生间呼叫,护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_011" des="床头屏发起呼叫后,1min无人接听自动取消(普通呼叫)___PR__可以自动取消普通呼叫【P2P】" count="1"/>
    <case name="tc_012" des="床头屏发起呼叫后,1min无人接听自动取消(普通呼叫)___PR__可以自动取消增援呼叫【P2P】" count="1"/>
    <case name="tc_013" des="床头屏发起卫生间呼叫后,1min无人接听自动取消___PR__可以自动取消卫生间呼叫【P2P】" count="1"/>
    <case name="tc_014" des="护士站直呼床头屏___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_014_1" des="护士站直呼床头屏(同床位)___PR__优先与床头通话,可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_015" des="护士站挂断床头屏(普通呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_016" des="护士站挂断床头屏(增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_017" des="护士站挂断床头屏(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_018" des="床头屏与门口屏进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_019" des="床头屏与门口屏进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_020" des="床头屏与门口屏进行语音通话(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_021" des="床头屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_022" des="门口屏挂断床头屏(普通呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_023" des="门口屏挂断床头屏(增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_024" des="门口屏挂断床头屏(普通呼叫切换到增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_025" des="床旁屏发起呼叫后取消呼叫___PR__床旁屏可以取消普通呼叫【P2P】" count="1"/>
    <case name="tc_026" des="床旁屏与护士站进行语音通话___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_032" des="床旁屏发起卫生间呼叫,护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_033" des="床旁屏发起呼叫后,1min无人接听自动取消(普通呼叫)___PR__可以自动取消普通呼叫【P2P】" count="1"/>
    <case name="tc_034" des="床旁屏发起卫生间呼叫后,1min无人接听自动取消___PR__可以自动取消卫生间呼叫【P2P】" count="1"/>
    <case name="tc_035" des="护士站直呼床旁屏___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_036" des="护士站挂断床旁屏___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_037" des="床旁屏与门口屏进行语音通话___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_040" des="床旁屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_041" des="门口屏挂断床旁屏___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_042" des="床头屏与护士站建立通话后,床旁屏与门口屏再建立通话___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_043" des="床头屏发起呼叫后,床头屏与护士站建立通话;床旁屏发起呼叫后,监控床旁屏通话弹窗___PR__护士站有通话中和床旁呼叫两个弹窗【P2P】" count="1"/>
    <case name="tc_044" des="床头屏发起普通呼叫后,床头屏与护士站建立通话;床旁屏强制与护士站建立通话___PR__床旁屏可以强制和护士站通话【P2P】" count="1"/>
    <case name="tc_045" des="床头屏发起增援呼叫后,床头屏与护士站建立通话;床旁屏强制与护士站建立通话___PR__床旁屏可以强制和护士站通话【P2P】" count="1"/>
    <case name="tc_046" des="床头屏发起呼叫后,床头屏与护士站建立通话;护士站挂断床头屏,床旁屏发起呼叫后,接听床旁屏___PR__床旁屏可以和护士站正常通话、正常挂断【P2P】" count="1"/>
    <case name="tc_047" des="床头屏和床旁屏依次发起呼叫后,床头屏与护士站建立通话后挂断;监控床旁屏通话弹窗___PR__护士站有通话中和床旁屏呼叫两个弹窗【P2P】" count="1"/>
    <case name="tc_048" des="床头屏发起呼叫后,床头屏与门口屏建立通话;床旁屏发起呼叫后,监控床旁屏通话弹窗___PR__门口屏有通话中和床旁屏呼叫两个弹窗【P2P】" count="1"/>
    <case name="tc_049" des="床头屏发起呼叫后,床头屏与门口屏建立通话;床旁屏发起呼叫后,门口屏挂断床头屏,接听床旁屏___PR__门口屏可以和床旁屏正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_050" des="床旁屏发起呼叫后,床旁屏与护士站建立通话;床头屏发起呼叫后,监控床头屏通话弹窗___PR__护士站有通话中和床头呼叫两个弹窗【P2P】" count="1"/>
    <case name="tc_051" des="床旁屏发起呼叫后,床旁屏与护士站建立通话;床头屏强制与护士站建立通话___PR__床头屏可以强制和护士站通话【P2P】" count="1"/>
    <case name="tc_052" des="床旁屏发起呼叫后,床旁屏与护士站建立通话;护士站挂断床旁屏,床头屏发起呼叫后,接听床头屏___PR__:护士站可以和床头屏正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_053" des="床旁屏和床头屏依次发起呼叫后,床旁屏与护士站建立通话后挂断;监控床头屏通话弹窗___PR__护士站有通话中和床头呼叫两个弹窗【P2P】" count="1"/>
    <case name="tc_054" des="床旁屏发起呼叫后,床旁屏与门口屏建立通话;床头屏发起呼叫后,监控床头屏通话弹窗___PR__门口屏有通话中和床头呼叫两个弹窗【P2P】" count="1"/>
    <case name="tc_058" des="床旁屏发起呼叫后,床旁屏与门口屏建立通话;床头屏发起呼叫,门口屏挂断床旁屏,接听床头屏___PR__门口屏能和床头屏正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_059" des="床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫___PR__护士站主机弹窗展示顺序是否满足从上往下依次卫生间呼叫、增援呼叫、普通呼叫【P2P】" count="1"/>
    <case name="tc_065_1" des="护士站A发起呼叫,护士站B接通___PR__护士站跨科呼叫通话正常【P2P】" count="1"/>
    <case name="tc_067" des="门口屏发起卫生间呼叫、护士站挂断___PR__护士站正常挂断卫生间呼叫【P2P】" count="1"/>
    <case name="tc_068" des="门口屏发起卫生间呼叫后,1min无人接听自动取消___PR__可以自动取消卫生间呼叫【P2P】" count="1"/>
    <case name="tc_101" des="退出床头屏后,床头屏发起呼叫后自动取消呼叫(普通呼叫)___PR__床头屏可以取消普通呼叫【P2P】" count="1"/>
    <case name="tc_102" des="退出床头屏后,床头屏发起呼叫后自动取消呼叫(增援呼叫)___PR__床头屏可以取消增援呼叫【P2P】" count="1"/>
    <case name="tc_103" des="退出床头屏后,床头屏与护士站进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_104" des="退出床头屏后,床头屏与护士站进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_105" des="退出床头屏后,床头屏发起卫生间呼叫,护士站挂断___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_106" des="退出床头屏后,床头屏与门口屏进行语音通话(普通呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_107" des="退出床头屏后,床头屏与门口屏进行语音通话(增援呼叫)___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_108" des="退出床头屏后,床头屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_109" des="退出床旁屏后,床旁屏发起呼叫后取消呼叫___PR__床旁屏可以取消普通呼叫【P2P】" count="1"/>
    <case name="tc_110" des="退出床旁屏后,床旁屏与护士站进行语音通话___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_111" des="退出床旁屏后,床旁屏发起卫生间呼叫,护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_112" des="退出床旁屏后,床旁屏与门口屏进行语音通话___PR__可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_113" des="退出床旁屏后,床旁屏发起卫生间呼叫,门口屏挂断___PR__门口屏可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_114" des="退出门口屏后,门口屏发起卫生间呼叫、护士站挂断___PR__护士站可以收到卫生间呼叫并正常挂断【P2P】" count="1"/>
    <case name="tc_119" des="护士站设置分组呼叫时间00:01-23:59___PR__分组呼叫时间开启成功【P2P】" count="1"/>
    <case name="tc_120" des="在分组呼叫时间内,A组床头屏发起呼叫___PR__A组护士站可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_121" des="在分组呼叫时间内,A组床头屏发起呼叫___PR__AB组门口屏可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_122" des="在分组呼叫时间内,C组床头屏发起呼叫___PR__A组护士站无法收到C组床头屏呼叫消息【P2P】" count="1"/>
    <case name="tc_123" des="在分组呼叫时间内,C组床头屏发起呼叫___PR__AB组门口屏无法收到C组床头屏呼叫消息【P2P】" count="1"/>
    <case name="tc_124" des="在分组呼叫时间内,B组床旁屏发起呼叫___PR__A组护士站无法收到B组床旁屏呼叫消息【P2P】" count="1"/>
    <case name="tc_125" des="在分组呼叫时间内,B组床旁屏发起呼叫___PR__AB组门口屏可以正常通话,正常挂断【P2P】" count="1"/>
    <case name="tc_126" des="在分组呼叫时间内,C组床旁屏发起呼叫___PR__AB组门口屏无法收到C组床旁屏呼叫消息【P2P】" count="1"/>
    <case name="tc_127" des="护士站设置分组呼叫时间00:00-00:00___PR__分组呼叫时间关闭成功【P2P】" count="1"/>
    <case name="tc_130" des="关闭增援SOS提醒___PR__增援SOS提醒关闭成功【P2P】" count="1"/>
    <case name="tc_131" des="床头屏发起增援呼叫___PR__床头屏、护士站呼叫弹窗显示增援呼叫中【P2P】" count="1"/>
    <case name="tc_132" des="打开增援SOS提醒___PR__增援SOS提醒打开成功【P2P】" count="1"/>
    <case name="tc_133" des="床头屏发起增援呼叫___PR__床头屏、护士站呼叫弹窗显示SOS【P2P】" count="1"/>
    <case name="tc_134" des="切换到新版RS485报警器___PR__新版RS485报警器切换成功【P2P】" count="1"/>
    <case name="tc_135" des="门口屏发起卫生间呼叫___PR__门口屏不可以发起普通卫生间呼叫【P2P】" count="1"/>
    <case name="tc_136" des="切换到普通报警器___PR__普通报警器切换成功【P2P】" count="1"/>
    <case name="tc_137" des="门口屏发起卫生间呼叫___PR__门口屏可以发起普通卫生间呼叫【P2P】" count="1"/>
    <case name="tc_097" des="强制启动SIP服务___PR__SIP启动成功【P2P】" count="1"/>
<!--    <case name="tc_201" des="后台探视设备切换到探视车___PR__" count="1"/>-->
<!--    <case name="tc_202" des="探视屏发起探视,探视车接听后手动挂断___PR__" count="1"/>-->
<!--    <case name="tc_203" des="探视屏发起探视,探视车接听后自动挂断___PR__" count="1"/>-->
<!--    <case name="tc_204" des="探视屏发起探视,护士站接听___PR__" count="1"/>-->
<!--    <case name="tc_205" des="探视屏发起探视,护士站转接到探视车___PR__" count="1"/>-->
<!--    <case name="tc_206" des="探视屏发起探视,护士站转接到探视车,等待探视屏自动挂断___PR__" count="1"/>-->
<!--    <case name="tc_207" des="探视屏发起探视,探视车挂断___PR__" count="1"/>-->
<!--    <case name="tc_208" des="探视屏发起探视,护士站手动挂断___PR__" count="1"/>-->
<!--    <case name="tc_209" des="探视屏发起探视,护士站自动挂断___PR__" count="1"/>-->
<!--    <case name="tc_221" des="后台探视设备切换到床旁屏___PR__" count="1"/>-->
<!--    <case name="tc_222" des="探视屏发起探视,床旁屏接听后手动挂断___PR__" count="1"/>-->
<!--    <case name="tc_223" des="探视屏发起探视,床旁屏接听后自动挂断___PR__" count="1"/>-->
<!--    <case name="tc_224" des="探视屏发起探视,护士站接听___PR__" count="1"/>-->
<!--    <case name="tc_225" des="探视屏发起探视,护士站转接到床旁屏___PR__" count="1"/>-->
<!--    <case name="tc_226" des="探视屏发起探视,护士站转接床旁屏后,等待探视屏自动挂断___PR__" count="1"/>-->
<!--    <case name="tc_227" des="探视屏发起探视,床旁屏挂断___PR__" count="1"/>-->
<!--    <case name="tc_228" des="探视屏发起探视,护士站手动挂断___PR__" count="1"/>-->
<!--    <case name="tc_229" des="探视屏发起探视,护士站自动挂断___PR__" count="1"/>-->
</Config>

3、公共文件common

(1) generate_report.py

复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
 @Author: 童臻
 @Email: 2684553351@qq.com
 @FileName: generate_report.py
 @DateTime: 2023/10/16 13:24
 @SoftWare: PyCharm
"""
import os

import pandas as pd


class Excel():
    def __init__(self, report_path, result):
        self.folder_path = report_path
        self.list_report = result
        # self.get_report = self.gen_report()

    def gen_report(self):
        if not os.path.exists(self.folder_path):
            os.makedirs(self.folder_path)
        file_path = os.path.join(self.folder_path, "report.xlsx")
        # print(file_path)
        # print(self.list_report)
        df = pd.DataFrame(self.list_report, columns=['用例ID', '用例名称', "测试结果", "开始时间", "结束时间"])
        with (pd.ExcelWriter(file_path) as writer):
            df.to_excel(writer, sheet_name='测试详情', index=False)

            # 设置列宽、水平居中、上下居中
            worksheet = writer.sheets['测试详情']
            workbook = writer.book
            sex_format = workbook.add_format({'align': 'center', 'valign': 'vcenter'})
            worksheet.set_column('A1:A6', 20, sex_format)
            worksheet.set_column('B1:B6', 20, sex_format)
            worksheet.set_column('C1:C6', 20, sex_format)
            worksheet.set_column('D1:D6', 20, sex_format)
            worksheet.set_column('E1:E6', 20, sex_format)
            # 设置列宽
            # worksheet.set_column('A:B', 20)
            # worksheet.set_column('D:D', 25)
            # 设置行高
            worksheet.set_default_row(20)


if __name__ == '__main__':
    result = [["tc_001", "启动床头屏", "pass", "", ""]]
    report_path = '../result'
    excel = Excel(report_path, result)
    excel.gen_report()

(2) parse_xml.py

复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
 @Author: 童臻
 @Email: 2684553351@qq.com
 @FileName: Parse_xml.py
 @DateTime: 2023/10/16 9:46
 @SoftWare: PyCharm
"""
from xml.dom import minidom


class Xml():
    def __init__(self, xml_path):
        self.config_file = xml_path
        self.device, self.round, self.test_list = self.read_xml()

    def read_xml(self):
        # 解析xml
        case_list = []
        doc = minidom.parse(self.config_file)
        root = doc.documentElement
        device = root.getElementsByTagName("common")[0].getAttribute("device")
        round = int(root.getElementsByTagName("common")[0].getAttribute("round"))
        for node in root.getElementsByTagName("case"):
            tc_name = node.getAttribute("name")
            tc_des = node.getAttribute("des")
            tc_count = node.getAttribute("count")
            tc_list = [tc_name, tc_des, tc_count]
            case_list.append(tc_list)
        return device, round, case_list


if __name__ == '__main__':
    xml_path = "../config//config.xml"
    xml = Xml(xml_path)
    print(xml.read_xml())

(3) base.py

复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
 @Author: 童臻
 @Email: 2684553351@qq.com
 @FileName: base.py
 @DateTime: 2025/08/12 13:24
 @SoftWare: PyCharm
"""
import time
import os
import subprocess

import requests
from PIL import ImageGrab
from pymsgbox import password


# from case.case import Case
def get_devices_list():
    """ 获取手机设备"""
    cmd = r'adb devices'
    pr = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
    pr.wait()
    out = pr.stdout.readlines()  # out = pr.stdout.read().decode("UTF-8")
    devices = []
    for i in out[1:-1]:
        device = str(i).split("\\")[0].split("'")[-1]
        devices.append(device)
    return devices


def fail_screen(log_img_path, fail_name):
    if not os.path.exists(log_img_path):
        os.makedirs(log_img_path)
    file_name = os.path.join(log_img_path, '{}.png'.format(fail_name))
    screenshot = ImageGrab.grab()  # 截取电脑屏幕
    screenshot.save(file_name)  # 保存截图
    # cmd = 'adb -s {} exec-out screencap -p '.format(devices) # 截取设备屏幕
    # p = subprocess.Popen(cmd, shell=True, stdout=open(file_name, 'w'), stderr=subprocess.PIPE)
    # time.sleep(1)
    # p.terminate()


def pull_devices_logs(log_txt_path, folder_name, log_dir, devices):
    """
    拉取床头屏设备日志到指定目录,并在成功后删除设备端原始日志
    :param log_txt_path: 父日志目录(如 ./result/log_txt)
    :param folder_name: 子文件夹名(如 cs)
    :param log_dir: 设备log路径(如 /sdcard/Android/data/com.bedside/files/Log)
    :param devices: 设备序列号(如 10.10.5.96:1898)
    :return: 成功返回True,失败返回False
    """
    # 1. 处理父目录(简化逻辑,exist_ok=True已覆盖存在判断)
    try:
        os.makedirs(log_txt_path, exist_ok=True)
    except PermissionError:
        print(f"❌ 无权限创建父目录 {log_txt_path},自动切换到桌面路径")
        # 降级到桌面路径(权限宽松,避免报错)
        log_txt_path = os.path.join(os.path.expanduser("~"), "Desktop", "devices_logs")
        os.makedirs(log_txt_path, exist_ok=True)
        print(f"✅ 已切换到桌面目录:{log_txt_path}")
    except Exception as e:  # 捕获其他创建目录的异常(如路径非法)
        print(f"❌ 创建父目录异常:{str(e)}")
        return False

    # 2. 拼接子文件夹路径(规范路径)
    folder_path = os.path.join(log_txt_path, folder_name)

    # 3. 处理子目录(简化逻辑,增强异常捕获)
    try:
        os.makedirs(folder_path, exist_ok=True)
    except PermissionError:
        print(f"❌ 无权限创建子目录 {folder_path}")
        return False
    except Exception as e:
        print(f"❌ 创建子目录异常:{str(e)}")
        return False

    # 4. 执行adb pull命令(核心:拉取日志到本地)
    # 给路径加引号,避免含空格/特殊字符报错
    adb_pull_cmd = f'adb -s {devices} pull "{log_dir}" "{folder_path}"'
    try:
        # 执行拉取命令并获取结果
        pull_result = subprocess.run(
            adb_pull_cmd,
            shell=True,
            capture_output=True,
            encoding="utf-8"
        )
        # 判断拉取是否成功
        if pull_result.returncode != 0:
            print(f"❌ 日志拉取失败!错误信息:{pull_result.stderr.strip()}")
            if pull_result.stdout:
                print(f"📌 ADB输出信息:{pull_result.stdout.strip()}")
            return False

        # # 5. 拉取成功后,删除设备端的原始日志(新增核心功能)
        # adb_rm_cmd = f'adb -s {devices} shell rm -rf "{log_dir}"'
        # rm_result = subprocess.run(
        #     adb_rm_cmd,
        #     shell=True,
        #     capture_output=True,
        #     encoding="utf-8"
        # )
        # if rm_result.returncode == 0:
        #     pass
        # else:
        #     # 删除失败不影响整体返回(仅提示,避免拉取成功但删除失败导致返回False)
        #     print(f"⚠️ 设备端日志删除失败!错误信息:{rm_result.stderr.strip()}")
        #     if rm_result.stdout:
        #         print(f"📌 ADB删除命令输出:{rm_result.stdout.strip()}")
        # return True

    except FileNotFoundError:  # 单独捕获ADB未安装/未配置环境变量的异常
        print(f"❌ 未找到ADB命令!请确认ADB已安装并配置到系统环境变量")
        return False
    except Exception as e:
        print(f"❌ 执行ADB命令异常:{str(e)}")
        return False


def app_log(devices):
    subprocess.Popen('adb -s {} logcat -c'.format(devices), stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                     encoding='utf-8')
    cmd = "adb -s {} shell logcat -v time|grep -in flutter ".format(devices)
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
    time.sleep(10)
    p.terminate()


def start_log(devices, log_path, fail_img_name):
    if not os.path.exists(log_path):
        os.makedirs(log_path)
    file_name = os.path.join(log_path, '{}.log'.format(fail_img_name))
    with open(file_name, 'w') as file_path:
        cmd = "adb -s {} shell logcat -v time|grep -in flutter ".format(devices)
        p = subprocess.Popen(cmd, shell=True, stdout=file_path, stderr=subprocess.PIPE)
        time.sleep(3)
        p.terminate()


def refresh_login(headers,urls, username, pwd,timeout):
    login_data = {"username": username, "pwd": pwd}
    try:
        # 调用登录接口(禁止重定向,防止Cookie/Token丢失)
        res = requests.post(f"{urls}/dwmws/sys/loginAES",
            headers=headers,
            json=login_data,
            timeout=timeout,
            allow_redirects=False
        )
        res.raise_for_status()  # 捕获HTTP错误(如404/500)
        login_result = res.json()

        # 1. 校验登录接口是否真的成功
        if not login_result.get("success"):
            print(f"❌ 登录接口返回失败:{login_result.get('message')}")
            return False

        # 2. 提取Cookie并更新
        cookie_dict = res.cookies.get_dict()
        if cookie_dict:
            cookie_str = "; ".join([f"{k}={v}" for k, v in cookie_dict.items()])
            headers["Cookie"] = f"{cookie_str}; sidebarStatus=0"
            # print(f"✅ 提取Cookie:{headers['Cookie']}")

        # 3. 提取Token并更新(兼容Token认证场景)
        token = login_result.get("data", {}).get("token", "")
        if token:
            headers["Authorization"] = f"Bearer {token}"
            # print(f"✅ 提取Token:{headers['Authorization']}")

        # print("✅ 登录成功,登录态已更新")
        return True

    except Exception as e:
        print(f"❌ 登录失败:{str(e)}")
        return False


def stop_log():
    pass


if __name__ == '__main__':
    # pull_devices_logs(
    #     log_txt_path="../result/log_txt",  # 父目录
    #     folder_name="cs",  # 子文件夹名
    #     log_dir="/sdcard/Android/data/com.bedside/files/Log",  # 设备log路径
    #     devices="10.10.5.96:1898"  # 替换为你的设备序列号(adb devices查看)
    # )
    refresh_login(
        {
            "Content-Type": "application/json",
            "Cookie": "",
            "Authorization": ""  # 新增Token认证字段
        },
        "http://10.10.1.106:8092",
        "4YMTYUjbbeM6Rz5dNuYQnA==",
        "Fm1KQXmRgVdz5H3nbIIleg==",
        30)  # 登录账号、密码
    # fail_screen('10.10.1.125:1898', '../result/log_img', 'cs')
    # start_log('10.10.1.125:1898', '../result/log_txt', '3')
    # app_log('10.10.1.125:1898')

4、用例文件case.case.py

复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
 @Author: 童臻
 @Email: 2684553351@qq.com
 @FileName: case.py
 @DateTime: 2026/01/16 9:46
 @SoftWare: PyCharm
"""
import os
import subprocess
import time
import requests
import json
import pyautogui
import uiautomator2 as u2
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.service import Service
from common.base import fail_screen
from common.base import refresh_login

# 设备IP设置
d1_ip = "10.10.5.96:1898"  # 床头屏
d2_ip = "10.10.5.72:1898"  # 床旁屏
d3_ip = "10.10.5.158:1898"  # 护士站主机
d4_ip = "10.10.5.103:1898"  # 门口屏
d7_ip = "10.10.5.122:1898"  # 护士站主机(转呼)
d8_ip = "10.10.5.184:1379"  # 护理交互大屏
d9_ip = "10.10.5.252"  # 走廊屏
d5_ip = "10.10.5.75:1898"  # 探视屏
d6_ip = "10.10.5.187:1898"  # 探视车
d10_ip = "10.10.5.118:1898"  # 床头屏(同床位)
d11_ip = "10.10.5.181:1898"  # 床旁屏(同床位)

# 设备IP列表
devices_ip = [d1_ip, d2_ip, d3_ip, d4_ip, d7_ip, d8_ip, d9_ip, d10_ip, d11_ip]

# 创建设备连接
d1 = u2.connect(d1_ip)
d2 = u2.connect(d2_ip)
d3 = u2.connect(d3_ip)
d4 = u2.connect(d4_ip)
d5 = u2.connect(d5_ip)
d6 = u2.connect(d6_ip)
d7 = u2.connect(d7_ip)
d8 = u2.connect(d8_ip)
d9 = u2.connect(d9_ip)
d10 = u2.connect(d10_ip)
d11 = u2.connect(d11_ip)

# 时长设置
init_time = 20  # 间隔时长(单位:秒)
set_time = 10  # 通话时长(单位:秒)
timeout = 30  # 超时时长(单位:秒)
tip_time = 65  # 无人接听自动挂断时长(单位:秒)

# 配置请求头
headers_login = {"Content-Type": "application/json", "Cookie": "", "Authorization": ""}  # 新增Token认证字段
headers = {'Content-Type': 'application/json', "Authorization": "Bearer myToken"}
header = {'Content-Type': 'application/x-www-form-urlencoded'}

# IP地址
urls = "http://10.10.1.106:8092"


class Case:
    # 用例00:应用闪退后,重启应用
    @staticmethod
    def tc_000(log_img_path, file_name):
        proc = subprocess.Popen('adb disconnect', shell=True, stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE)
        proc.communicate()  # 等待进程结束
        proc.wait()  # 确保进程退出
        for d_ip in devices_ip:
            proc = subprocess.Popen('adb connect {}'.format(d_ip), shell=True, stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE)
            proc.communicate()  # 等待进程结束
            proc.wait()  # 确保进程退出
            # proc = subprocess.Popen('adb -s {} reboot'.format(d_ip), shell=True, stdout=subprocess.PIPE,
            #                         stderr=subprocess.PIPE)
            # proc.communicate()  # 等待进程结束
            # proc.wait()  # 确保进程退出
            # os.system('scrcpy -s {} -b 2M -m 1024'.format(d_ip))
            # time.sleep(5)
        if d1(text="关闭应用").exists(timeout=timeout):
            d1(text="关闭应用").click()
        # if ((d1(text="床头屏").exists(timeout=timeout) or d2(text="床旁屏").exists(timeout=timeout) or
        #      d3(text="护士站主机").exists(timeout=timeout) or d4(text="门口屏").exists(timeout=timeout) or
        #      d5(text="家属探视屏").exists(timeout=timeout) or d6(text="探视车").exists(timeout=timeout) or
        #      d7(text="护士站主机").exists(timeout=timeout)) or d8(text="护理交互大屏").exists(timeout=timeout) or
        #         d9(text="走廊屏").exists(timeout=timeout)):
        if ((d1(text="床头屏").exists(timeout=timeout) or d2(text="床旁屏").exists(timeout=timeout) or
             d3(text="护士站主机").exists(timeout=timeout) or d4(text="门口屏").exists(timeout=timeout) or
             d7(text="护士站主机").exists(timeout=timeout)) or d8(text="护理交互大屏").exists(timeout=timeout)):
            pack_name = {"床头屏": "com.bedside", "床旁屏": "com.example.wisdom_side",
                         "护士站主机": "com.ocamara.nursecentre", "门口屏": "com.ocamara.gatescreen",
                         "护理交互大屏": "com.ocamar_smart.ocamar_smart", "走廊屏": "com.ocamara.corridorscreen"}
            for d, n in {d1: 0, d2: 1, d3: 2, d4: 3, d7: 2, d8: 4}.items():
                # if d == d6:
                #     if d(text="探视车").exists(timeout=timeout):
                #         d.app_start("com.example.wisdom_side")
                # elif d == d5:
                #     if d(text="家属探视屏").exists(timeout=timeout):
                #         d.app_start("com.ocamara.nursecentre")
                # elif d(text="{}".format(list(pack_name)[n])).exists(timeout=timeout):
                #     d.app_start("{}".format(list(pack_name.values())[n]))
                #     d.sleep(10)
                #     print('{}:闪退重启成功'.format(list(pack_name)[n]))
                # else:
                #     pass
                if d(text="{}".format(list(pack_name)[n])).exists(timeout=timeout):
                    d.app_start("{}".format(list(pack_name.values())[n]))
                    d.sleep(10)
                    print('{}:闪退重启成功'.format(list(pack_name)[n]))
                else:
                    pass
            return 'Fail'
        else:
            return "Pass"

    # 用例000_1:初始化智慧病房后台配置___PR__初始化智慧病房后台配置成功
    @staticmethod
    def tc_000_1(log_img_path, file_name):
        refresh_login(headers_login, urls, "4YMTYUjbbeM6Rz5dNuYQnA==", "Fm1KQXmRgVdz5H3nbIIleg==",
                      timeout)  # 登录账号、密码
        # 填写参数(设备声音配置走廊屏勾选全部,门口屏勾选实时广播)
        params = {"onOff": "true", "list": [{"type": "01", "isBroadcast": 1, "isTimelyBroadcast": 1, "isBgm": 1},
                                            {"type": "02", "isBroadcast": 1, "isTimelyBroadcast": 1, "isBgm": 1,
                                             "nursingNotes": 1},
                                            {"type": "03", "isBroadcast": 1, "isTimelyBroadcast": 1, "isCall": 1,
                                             "isBgm": 1, "isAlarm": 1},
                                            {"type": "04", "isBroadcast": 1, "isCall": 1, "isBgm": 1, "isAlarm": 1},
                                            {"type": "06", "isBroadcast": None, "isCall": 1, "isNotice": 1,
                                             "isAlarm": 1,
                                             "timedReminders": 1},
                                            {"type": "05", "isBroadcast": None, "isNotice": 1, "isAlarm": 1,
                                             "wardServices": 1, "timedReminders": 1, "gradedResponse": 1}]}
        url = f"{urls}/dwmws/others/setDeviceConfig"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers_login, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(response.json(), ensure_ascii=False, indent=2)
        time.sleep(10)
        # 填写参数(admin后台配置)
        params = {"alertPage": {"backTime": 5, "onOff": "true", "screenTypes": ["01", "02"]},
                  "homepage": {"backTime": 1, "onOff": "true", "screenTypes": ["01", "05", "03", "02"]},
                  "qrcodeRoom": "true", "identityVerification": "false",
                  "identityVerificationOfScreenTypes": ["01", "02"],
                  "namePrivacy": "false", "namePrivacyOfScreenTypes": ["01", "03"],
                  "nightMode": {"endTime": "20:15:39", "onOff": "false", "startTime": "08:15:35", "volume": 10},
                  "callSetting": {"intervalTime": 0, "bedCall": None, "hospitalCall": "true"}, "password": "123456",
                  "showInfuse": "false", "showInfuseOfScreenTypes": ["01", "02"], "qrcodeValue": "patientID",
                  "screenType": "0", "wardCode": "0",
                  "bedRestScreen": {"onOff": "false", "screenTypes": ["02", "01", "03"]},
                  "doctorRounds": {"onOff": "false", "screenTypes": ["04", "05", "06", "03"]},
                  "outingReminder": {"onOff": "true", "screenTypes": ["05", "06", "01", "02", "03"]},
                  "nursingLocationToBed": "false",
                  "callColorSettings": {"onOff": "true", "succorColor": "黄色", "normalColor": "红色",
                                        "nursingRemindColor": "绿色", "nurseLevel1Color": "紫色"},
                  "patientInfo": {"showPatientId": "false", "patientIdTitle": "病人号"},
                  "examinationPermissionList": [0],
                  "signsDataSourceList": [2], "bloodType": "true", "bloodTypeWithApp": ["01", "02"],
                  "nursingWithApp": ["01", "02"], "nursing": "false", "receiveMsg": [], "toiletAlarmDeviceType": 0}
        url = urls + "/dwmws/config/saveBaseSetting"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result2 = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(10)
        # 填写参数(tongzhen后台配置)
        params = {"alertPage": {"backTime": 5, "onOff": "true", "screenTypes": ["01", "02", "05", "06"]},
                  "callSetting": {"bedCall": "false", "intervalTime": 0},
                  "careNotice": {"onOff": "false", "screenTypes": ["01", "02", "05", "06"]},
                  "measure": {"onOff": "false", "screenTypes": []},
                  "homepage": {"backTime": 1, "onOff": "false", "screenTypes": ["01", "02", "03", "05", "06"]},
                  "identityVerification": "false", "identityVerificationOfScreenTypes": ["01", "02"],
                  "namePrivacy": "false", "namePrivacyOfScreenTypes": ["03", "02", "01"],
                  "nightMode": {"endTime": "21:00:00", "onOff": "false", "startTime": "09:00:00", "volume": 20},
                  "showInfuse": "true", "showInfuseOfScreenTypes": ["01", "02"],
                  "sosCallDTO": {"onOff": "true", "screenTypeList": ["01", "04", "05"]}, "screenType": "0",
                  "wardCode": "0187dfa2", "nursingLocationToBed": "false", "closingAccountsNotice": "false",
                  "birthdayGreetingNotification": "false", "dischargeNotice": "false"}
        url = urls + "/dwmws/config/saveBaseSetting"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result3 = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result) and '200' in str(result2) and '200' in str(result3):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例01:床头屏发起呼叫后自动取消呼叫(普通呼叫)
    @staticmethod
    def tc_001(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d1(description="呼叫中...").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例02:床头屏发起呼叫后自动取消呼叫(增援呼叫)
    @staticmethod
    def tc_002(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d1(description="SOS呼叫中...").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例03:床头屏与护士站进行语音通话(普通呼叫)
    @staticmethod
    def tc_003(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例04:床头屏与护士站进行语音通话(增援呼叫)
    @staticmethod
    def tc_004(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例05:床头屏与护士站进行语音通话(普通呼叫切换到增援呼叫)
    @staticmethod
    def tc_005(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例06:床头屏与护士站进行语音通话前呼叫转移(普通呼叫)
    @staticmethod
    def tc_006(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例07:床头屏与护士站进行语音通话前呼叫转移(增援呼叫)
    @staticmethod
    def tc_007(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例08:床头屏与护士站进行语音通话后呼叫转移(普通呼叫)
    @staticmethod
    def tc_008(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例09:床头屏与护士站进行语音通话后呼叫转移(增援呼叫)
    @staticmethod
    def tc_009(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例10:床头屏发起卫生间呼叫,护士站挂断
    @staticmethod
    def tc_010(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 138')
        d1.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例11:床头屏发起呼叫后,1min无人接听自动取消(普通呼叫)
    @staticmethod
    def tc_011(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d1(description="呼叫中...").exists(timeout=timeout):
            d1.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例12:床头屏发起呼叫后,1min无人接听自动取消(普通呼叫)
    @staticmethod
    def tc_012(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d1(description="SOS呼叫中...").exists(timeout=timeout):
            d1.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例13:床头屏发起卫生间呼叫后,1min无人接听自动取消
    @staticmethod
    def tc_013(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 138')
        d1.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            d1.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例14:护士站直呼床头屏
    @staticmethod
    def tc_014(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        if d3(text="解霞").exists(timeout=timeout):
            d3(text="解霞").long_click(3)
            d3.sleep(3)
        else:
            pass
        if d3(text="通话").exists(timeout=timeout):
            d3(text="通话").long_click(3)
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/ivClose").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/ivClose").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例14_1:护士站直呼床头屏(同床位)
    @staticmethod
    def tc_014_1(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        if d3(text="龚雪华").exists(timeout=timeout):
            d3(text="龚雪华").long_click(3)
            d3.sleep(3)
        else:
            pass
        if d3(text="通话").exists(timeout=timeout):
            d3(text="通话").long_click(3)
            d3.sleep(set_time)
        else:
            pass
        if d10(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/ivClose").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/ivClose").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例15:护士站挂断床头屏(普通呼叫)
    @staticmethod
    def tc_015(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d1(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例16:护士站挂断床头屏(增援呼叫)
    @staticmethod
    def tc_016(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d1(description="SOS呼叫中...").exists(timeout=timeout) and d3(text="SOS").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例17:护士站挂断床头屏(普通呼叫切换到增援呼叫)
    @staticmethod
    def tc_017(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d1(description="SOS呼叫中...").exists(timeout=timeout) and d3(text="SOS").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例18:床头屏与门口屏进行语音通话(普通呼叫)
    @staticmethod
    def tc_018(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例19:床头屏与门口屏进行语音通话(增援呼叫)
    @staticmethod
    def tc_019(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例20:床头屏与门口屏进行语音通话(普通呼叫切换到增援呼叫)
    @staticmethod
    def tc_020(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例21:床头屏发起卫生间呼叫,门口屏挂断
    @staticmethod
    def tc_021(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 138')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例22:门口屏挂断床头屏(普通呼叫)
    @staticmethod
    def tc_022(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d1(description="呼叫中...").exists(timeout=timeout) and d4(className="android.widget.ImageView",
                                                                      index=0).exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例23:门口屏挂断床头屏(增援呼叫)
    @staticmethod
    def tc_023(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d1(description="SOS呼叫中...").exists(timeout=timeout) and d4(className="android.widget.ImageView",
                                                                         index=0).exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例24:门口屏挂断床头屏(普通呼叫切换到增援呼叫)
    @staticmethod
    def tc_024(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d1(description="SOS呼叫中...").exists(timeout=timeout) and d4(className="android.widget.ImageView",
                                                                         index=0).exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例25:床旁屏发起呼叫后取消呼叫
    @staticmethod
    def tc_025(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d2(description="呼叫中...").exists(timeout=timeout):
            d2.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例26:床旁屏与护士站进行语音通话
    @staticmethod
    def tc_026(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例27:床旁屏与护士站进行视频通话
    @staticmethod
    def tc_027(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例28:床旁屏与护士站进行语音转视频通话
    @staticmethod
    def tc_028(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="视频通话").exists(timeout=timeout):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(text="接受").exists(timeout=timeout):
            d3(text="接受").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例29:床旁屏与护士站进行语音通话前呼叫转移
    @staticmethod
    def tc_029(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例30:床旁屏与护士站进行视频通话前呼叫转移
    @staticmethod
    def tc_030(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例31:床旁屏与护士站进行语音通话后呼叫转移
    @staticmethod
    def tc_031(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_transfer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="确认转呼").exists(timeout=timeout):
            d3(text="确认转呼").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例32:床旁屏发起卫生间呼叫,护士站挂断
    @staticmethod
    def tc_032(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 139')
        d2.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例33:床旁屏发起呼叫后,1min无人接听自动取消(普通呼叫)
    @staticmethod
    def tc_033(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d2(description="呼叫中...").exists(timeout=timeout):
            d2.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例34:床旁屏发起卫生间呼叫后,1min无人接听自动取消
    @staticmethod
    def tc_034(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 139')
        d2.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            d2.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例35:护士站直呼床旁屏
    @staticmethod
    def tc_035(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        if d3(text="孙飞").exists(timeout=timeout):
            d3(text="孙飞").long_click(3)
            d3.sleep(set_time)
        else:
            pass
        if d3(text="通话").exists(timeout=timeout):
            d3(text="通话").long_click(3)
            d3.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) or d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/ivClose").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/ivClose").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例36:护士站挂断床旁屏
    @staticmethod
    def tc_036(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d2(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例37:床旁屏与门口屏进行语音通话
    @staticmethod
    def tc_037(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例38:床旁屏与门口屏进行视频通话
    @staticmethod
    def tc_038(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例39:床旁屏与门口屏进行语音转视频通话
    @staticmethod
    def tc_039(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        if d2(description="视频通话").exists(timeout=timeout):
            d2(description="视频通话").click()
            d2.sleep(6)
        else:
            pass
        if d4(description="接受").exists(timeout=timeout):
            d4(description="接受").click()
            d4.sleep(set_time)
        else:
            pass
        if d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例40:床旁屏发起卫生间呼叫,门口屏挂断
    @staticmethod
    def tc_040(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 139')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例41:门口屏挂断床旁屏
    @staticmethod
    def tc_041(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d2(description="呼叫中...").exists(timeout=timeout) and d4(className="android.widget.ImageView",
                                                                      index=0).exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例42:床头屏与护士站建立通话后,床旁屏与门口屏再建立通话
    @staticmethod
    def tc_042(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(
                timeout=timeout) and d2(description="通话中...").exists(timeout=timeout) and d4(
            description="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例43:床头屏发起呼叫后,床头屏与护士站建立通话;床旁屏发起呼叫后,监控床旁屏通话弹窗
    @staticmethod
    def tc_043(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d2(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d2(description="取消呼叫").exists(timeout=timeout):
                d2(description="取消呼叫").click()
                d2.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例44:床头屏发起普通呼叫后,床头屏与护士站建立通话;床旁屏强制与护士站建立通话
    @staticmethod
    def tc_044(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例45:床头屏发起增援呼叫后,床头屏与护士站建立通话;床旁屏强制与护士站建立通话
    @staticmethod
    def tc_045(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例46:床头屏发起呼叫后,床头屏与护士站建立通话;护士站挂断床头屏,床旁屏发起呼叫后,接听床旁屏
    @staticmethod
    def tc_046(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()  # 取消床头屏与护士站的通话
            d3.sleep(3)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例47:床头屏和床旁屏依次发起呼叫后,床头屏与护士站建立通话后挂断;监控床旁屏通话弹窗
    @staticmethod
    def tc_047(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="呼叫中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            d2.shell('input keyevent 133')
            d2.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例48:床头屏发起呼叫后,床头屏与门口屏建立通话;床旁屏发起呼叫后,监控床旁屏通话弹窗
    @staticmethod
    def tc_048(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d2(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d2(description="呼叫中...").exists(timeout=timeout):
                d2.shell('input keyevent 133')
                d2.sleep(3)
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例49:床头屏发起呼叫后,床头屏与门口屏建立通话;床旁屏发起呼叫后,门口屏挂断床头屏,接听床旁屏
    @staticmethod
    def tc_049(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=3).click()
            d4.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例50:床旁屏发起呼叫后,床旁屏与护士站建立通话;床头屏发起呼叫后,监控床头屏通话弹窗
    @staticmethod
    def tc_050(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d1(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d1(description="呼叫中...").exists(timeout=timeout):
                d1.shell('input keyevent 133')
                d1.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例51:床旁屏发起呼叫后,床旁屏与护士站建立通话;床头屏强制与护士站建立通话
    @staticmethod
    def tc_051(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例52:床旁屏发起呼叫后,床旁屏与护士站建立通话;护士站挂断床旁屏,床头屏发起呼叫后,接听床头屏
    @staticmethod
    def tc_052(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()  # 取消床头屏与护士站的通话
            d3.sleep(3)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例53:床旁屏和床头屏依次发起呼叫后,床旁屏与护士站建立通话后挂断;监控床头屏通话弹窗
    @staticmethod
    def tc_053(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="呼叫中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            d1.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例54:床旁屏发起呼叫后,床旁屏与门口屏建立通话;床头屏发起呼叫后,监控床头屏通话弹窗
    @staticmethod
    def tc_054(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d1(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d1(description="呼叫中...").exists(timeout=timeout):
                d1.shell('input keyevent 133')
                d1.sleep(3)
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例55:床旁屏发起呼叫后,床旁屏与门口屏建立视频通话;床头屏发起呼叫后,门口屏挂断和床旁屏的视频通话
    @staticmethod
    def tc_055(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
        else:
            pass
        if d1(description="呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            if d1(description="呼叫中...").exists(timeout=timeout):
                d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例56:床旁屏发起呼叫后,床旁屏与门口屏建立视频通话;床头屏发起呼叫后,护士站挂断床头屏
    @staticmethod
    def tc_056(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
        else:
            pass
        if d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例57:床旁屏与门口屏建立视频通话,床头屏与护士站建立通话,门口屏挂断和床旁屏的视频通话
    @staticmethod
    def tc_057(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            d4(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例58:床旁屏发起呼叫后,床旁屏与门口屏建立通话;床头屏发起呼叫,门口屏挂断床旁屏,接听床头屏
    @staticmethod
    def tc_058(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=3).click()
            d4.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例59:床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫,观察护士站主机弹窗展示顺序是否满足从上往下依次卫生间呼叫、增援呼叫、普通呼叫
    @staticmethod
    def tc_059(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        d4.shell('input keyevent 138')
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout) and d3(text="SOS").exists(timeout=timeout) and d3(
                text="呼叫中...").exists(timeout=timeout):
            time.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例60:护士站发起实时广播后,观察床头屏、床旁屏、门口屏是否收到广播
    @staticmethod
    def tc_060(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="广播中...").exists(timeout=timeout) and d2(description="广播中...").exists(
                timeout=timeout) and d4(description="广播中...").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例60_1:护士站发起实时广播后,床头屏发起卫生间呼叫,观察护士站能否正常挂断床头屏卫生间呼叫【不支持P2P通话】
    @staticmethod
    def tc_060_1(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d1.sleep(3)
        d1.shell('input keyevent 138')  # 床头发起卫生间呼叫
        d1.sleep(set_time)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例60_2:护士站发起实时广播后,床旁屏发起卫生间呼叫,观察护士站能否正常挂断床旁屏卫生间呼叫【不支持P2P通话】
    @staticmethod
    def tc_060_2(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d2.sleep(3)
        d2.shell('input keyevent 139')  # 床旁发起卫生间呼叫
        d2.sleep(set_time)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例60_3:护士站发起实时广播后,床头屏发起卫生间呼叫,观察护理大屏能否正常挂断床头屏卫生间呼叫【不支持P2P通话】
    @staticmethod
    def tc_060_3(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d1.sleep(3)
        d1.shell('input keyevent 138')  # 床头发起卫生间呼叫
        d1.sleep(set_time)
        if d8(description="001房\n卫生间呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="001房\n卫生间呼叫中..."]/android.widget.ImageView[3]').click()
            d8.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例60_4:护士站发起实时广播后,床旁屏发起卫生间呼叫,观察护理大屏能否正常挂断床旁屏卫生间呼叫【不支持P2P通话】
    @staticmethod
    def tc_060_4(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d2.sleep(3)
        d2.shell('input keyevent 139')  # 床旁发起卫生间呼叫
        d2.sleep(set_time)
        if d8(description="001房\n卫生间呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="001房\n卫生间呼叫中..."]/android.widget.ImageView[3]').click()
            d8.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例60_5:护士站发起实时广播后,门口屏发起卫生间呼叫,观察护理大屏能否正常挂断门口屏卫生间呼叫【不支持P2P通话】
    @staticmethod
    def tc_060_5(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d4.sleep(3)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(set_time)
        if d8(description="001房\n卫生间呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="001房\n卫生间呼叫中..."]/android.widget.ImageView[3]').click()
            d8.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例61:护士站发起实时广播后,门口屏发起卫生间呼叫,观察护士站能否正常挂断门口屏卫生间呼叫【不支持P2P通话】
    @staticmethod
    def tc_061(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d4.sleep(3)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(set_time)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例62:护士站发起实时广播后,门口屏发起卫生间呼叫,观察门口屏能否正常挂断门口屏卫生间呼叫
    @staticmethod
    def tc_062(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
        else:
            pass
        d4.sleep(3)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(set_time)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            d3.sleep(3)
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
                d4.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例63:护士站发起多床位实时广播后,观察床头屏收到广播、门口屏收不到广播
    @staticmethod
    def tc_063(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="01").exists(timeout=timeout):
            d3(text="01").click()
        else:
            pass
        if d3(text="16床").exists(timeout=timeout):
            d3(text="16床").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="广播中...").exists(timeout=timeout) and d4(description="03护士站").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例63_1:护士站发起单床位实时广播后,观察床头屏、床旁屏、门口屏收不到广播【不支持P2P通话】
    @staticmethod
    def tc_063_1(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="01").exists(timeout=timeout):
            d3(text="01").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if d10(description="广播中...").exists(timeout=timeout) and d11(description="广播中...").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例63_2:护士站发起A组实时广播___PR__A组床头屏、AB门口屏能收到广播【不支持P2P通话】
    @staticmethod
    def tc_063_2(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="A组").exists(timeout=timeout):
            d3(text="A组").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="广播中...").exists(timeout=timeout) and d4(description="广播中...").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例63_3:护士站发起B组实时广播___PR__B组床旁屏、AB门口屏能收到广播【不支持P2P通话】
    @staticmethod
    def tc_063_3(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="B组").exists(timeout=timeout):
            d3(text="B组").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(description="广播中...").exists(timeout=timeout) and d4(description="广播中...").exists(
                timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例63_4:护士站发起C组实时广播___PR__A组床头屏、B组床旁屏、AB门口屏不能收到广播【不支持P2P通话】
    @staticmethod
    def tc_063_4(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="C组").exists(timeout=timeout):
            d3(text="C组").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if not d1(description="广播中...").exists(timeout=3) and not d2(description="广播中...").exists(timeout=3) and not d4(description="广播中...").exists(timeout=3):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例64:护士站发起实时广播后,床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫,观察护士站只能收到卫生间呼叫弹窗
    @staticmethod
    def tc_064(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        d4.shell('input keyevent 138')
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例65:护士站发起音频广播后,观察床头屏、床旁屏、门口屏是否收到广播
    @staticmethod
    def tc_065(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="广播中...").exists(timeout=timeout) and d2(description="广播中...").exists(
                timeout=timeout) and d4(description="广播中...").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例65_1:护士站A发起呼叫,护士站B接通,观察护士站跨科呼叫通话正常
    @staticmethod
    def tc_065_1(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(text="跨科呼叫").exists(timeout=timeout):
            d3(text="跨科呼叫").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/transfer_item_root").click()
            d3.sleep(3)
        else:
            pass
        if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d7.sleep(3)
        else:
            pass
        if d3(text="通话中...").exists(timeout=timeout) and d7(text="通话中...").exists(timeout=timeout):
            if d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d7(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例65_2:护士站发起A组音频广播___PR__A组床头屏、AB门口屏能收到广播【不支持P2P通话】
    @staticmethod
    def tc_065_2(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="A组").exists(timeout=timeout):
            d3(text="A组").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="广播中...").exists(timeout=timeout) and d4(description="广播中...").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例65_3:护士站发起B组音频广播___PR__B组床旁屏、AB门口屏能收到广播【不支持P2P通话】
    @staticmethod
    def tc_065_3(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="B组").exists(timeout=timeout):
            d3(text="B组").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="广播中...").exists(timeout=timeout) and d4(description="广播中...").exists(
                timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例65_4:护士站发起C组音频广播___PR__A组床头屏、B组床旁屏、AB门口屏不能收到广播【不支持P2P通话】
    @staticmethod
    def tc_065_4(log_img_path, file_name):
        d2.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="C组").exists(timeout=timeout):
            d3(text="C组").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if not d1(description="广播中...").exists(timeout=3) and not d2(description="广播中...").exists(
                timeout=3) and not d4(description="广播中...").exists(timeout=3):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例66:护士站发起音频广播后,床旁发起普通呼叫、床头发起增援呼叫、门口发起卫生间呼叫,观察床头屏、床头屏、门口屏呼叫弹窗覆盖广播弹窗
    @staticmethod
    def tc_066(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        d4.shell('input keyevent 138')
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            d3.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例67:门口屏发起卫生间呼叫、护士站挂断
    @staticmethod
    def tc_067(log_img_path, file_name):
        d4.sleep(init_time)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例68:门口屏发起呼叫后,1min无人接听自动取消
    @staticmethod
    def tc_068(log_img_path, file_name):
        d4.sleep(init_time)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            d3.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例69:门口屏发起卫生间呼叫、护理交互大屏挂断
    @staticmethod
    def tc_069(log_img_path, file_name):
        d4.sleep(init_time)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(3)
        if d8(description="001房\n卫生间呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="001房\n卫生间呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例70:床头屏发起卫生间呼叫、护理交互大屏挂断
    @staticmethod
    def tc_070(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 138')
        d1.sleep(3)
        if d8(description="001房\n卫生间呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="001房\n卫生间呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例71:床旁屏发起卫生间呼叫、护理交互大屏挂断
    @staticmethod
    def tc_071(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 139')
        d2.sleep(3)
        if d8(description="001房\n卫生间呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="001房\n卫生间呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例72:床头屏发起普通呼叫、护理交互大屏挂断
    @staticmethod
    def tc_072(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d8(description="16床\n呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="16床\n呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例73:床旁屏发起普通呼叫、护理交互大屏挂断
    @staticmethod
    def tc_073(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d8(description="17床\n呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="17床\n呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例74:床头屏发起增援呼叫、护理交互大屏挂断
    @staticmethod
    def tc_074(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d8(description="16床\n增援呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="16床\n增援呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例75:床头屏发起普通呼叫切换到增援呼叫、护理交互大屏挂断
    @staticmethod
    def tc_075(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d8(description="16床\n增援呼叫中...").exists(timeout=timeout):
            d8.xpath('//*[@content-desc="16床\n增援呼叫中..."]/android.widget.ImageView[3]').click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例76:患者若为一级护理,床旁屏(17床)发起呼叫,护士站提示:患者为一级护理等级,是否立即接听?
    @staticmethod
    def tc_076(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(set_time)
        if d2(description="呼叫中...").exists(timeout=timeout) and d3(text="患者为一级护理,是否立即接听?").exists(
                timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例77:患者若为特级护理,床头屏(16床)发起呼叫,护士站提示:患者为特级护理等级,是否立即接听?
    @staticmethod
    def tc_077(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(set_time)
        if d1(description="呼叫中...").exists(timeout=timeout) and d3(text="患者为特级护理,是否立即接听?").exists(
                timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例78:患者若为一级护理,床旁屏(17床)发起呼叫,门口屏提示:患者为一级护理等级,是否立即接听?
    @staticmethod
    def tc_078(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(set_time)
        if d2(description="呼叫中...").exists(timeout=timeout) and d4(className="android.widget.ImageView",
                                                                      index=2).exists(
            timeout=timeout):
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例79:患者若为特级护理,床头屏(16床)发起呼叫,门口屏提示:患者为特级护理等级,是否立即接听?
    @staticmethod
    def tc_079(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(set_time)
        if d1(description="呼叫中...").exists(timeout=timeout) and d4(className="android.widget.ImageView",
                                                                      index=2).exists(
            timeout=timeout):
            if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=2).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例80:床旁屏(17床)与主机进行语音通话的时候,收到床头屏(16床)发来的语音通话请求,可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_080(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="通话保持中...").exists(timeout=timeout) and d3(text="通话中...").exists(
                timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例81:床旁屏(17床)与主机进行视频通话的时候,收到床头屏(16床)发来的语音通话请求,可以将当前视频通话设为保持状态,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_081(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(
                timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
                d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例82:床头屏(16床)与主机进行语音通话的时候,收到床旁屏(17床)发来的语音通话请求,可以将当前语音通话设为保持状态,与床旁屏(17床)进行语音通话
    @staticmethod
    def tc_082(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="通话保持中...").exists(timeout=timeout) and d3(text="通话中...").exists(
                timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例83:床头屏(16床)与主机进行语音通话的时候,收到床旁屏(17床)发来的视频通话请求,可以将当前视频通话设为保持状态,与床旁屏(17床)进行视频通话
    @staticmethod
    def tc_083(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="通话保持中...").exists(timeout=timeout) and d3(
                resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
                d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例84:床旁屏(17床)与主机进行语音通话后点击保持,床头屏(16床)与主机建立语音通话,主机挂断16床语音通话后点击恢复,与床旁屏(17床)进行语音通话
    @staticmethod
    def tc_084(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="恢复").exists(timeout=timeout):
            d3(text="恢复").click()
            d3.sleep(3)
        else:
            pass

        if d2(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(
                timeout=timeout) and d3(text="保持").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例85:床旁屏(17床)与主机进行视频通话后点击保持,床头屏(16床)与主机建立语音通话,主机挂断16床语音通话后点击恢复,与床头屏(17床)进行视频通话
    @staticmethod
    def tc_085(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="恢复").exists(timeout=timeout):
            d3(text="恢复").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout) and d3(
                resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
                d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例86:床头屏(16床)与主机进行语音通话后点击保持,床旁屏(17床)与主机建立语音通话,主机直接点击恢复,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_086(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="恢复").exists(timeout=timeout):
            d3(text="恢复").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="通话保持中...").exists(timeout=timeout) and d1(description="通话中...").exists(
                timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例87:床头屏(16床)与主机进行语音通话后点击保持,床旁屏(17床)与主机建立视频通话,主机直接点击保持,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_087(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="通话保持中...").exists(timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
                d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例88:床旁屏(17床)与门口屏进行语音通话的时候,收到床头屏(16床)发来的语音通话请求,可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_088(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(description="保持").exists(timeout=timeout):
            d4(description="保持").click()
            d4.sleep(3)
        else:
            pass
        if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=4).click()
            d3.sleep(4)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(
                timeout=timeout) and d4(description="保持").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=4).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例89:床旁屏(17床)与门口屏进行视频通话的时候,收到床头屏(16床)发来的语音通话请求,可以将当前语音通话设为保持状态,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_089(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(description="保持").exists(timeout=timeout):
            d4(description="保持").click()
            d4.sleep(3)
        else:
            pass
        if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=4).click()
            d3.sleep(4)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(
                timeout=timeout) and d4(description="保持").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=4).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例90:床头屏(16床)与门口屏进行语音通话的时候,收到床旁屏(17床)发来的语音通话请求,可以将当前语音通话设为保持状态,与床旁屏(17床)进行语音通话
    @staticmethod
    def tc_090(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(description="保持").exists(timeout=timeout):
            d4(description="保持").click()
            d4.sleep(3)
        else:
            pass
        if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=4).click()
            d3.sleep(4)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(
                timeout=timeout) and d4(description="保持").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=4).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例91:床头屏(16床)与门口屏进行语音通话的时候,收到床旁屏(17床)发来的视频通话请求,可以将当前视频通话设为保持状态,与床旁屏(17床)进行视频通话
    @staticmethod
    def tc_091(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d4(description="保持").exists(timeout=timeout):
            d4(description="保持").click()
            d4.sleep(3)
        else:
            pass
        if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=4).click()
            d3.sleep(4)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=4).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=4).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例92:床旁屏(17床)与门口屏进行语音通话后点击保持,床头屏(16床)与门口屏建立语音通话,门口屏挂断16床语音通话后点击恢复,与床旁屏(17床)进行语音通话
    @staticmethod
    def tc_092(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d4(description="保持").exists(timeout=timeout):
            d4(description="保持").click()
            d4.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="恢复").exists(timeout=timeout):
            d3(text="恢复").click()
            d3.sleep(3)
        else:
            pass

        if d2(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(
                timeout=timeout) and d3(text="保持").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例93:床旁屏(17床)与门口屏进行视频通话后点击保持,床头屏(16床)与门口屏建立语音通话,门口屏挂断16床语音通话后点击恢复,与床头屏(17床)进行视频通话
    @staticmethod
    def tc_093(log_img_path, file_name):
        d2.sleep(init_time)
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="恢复").exists(timeout=timeout):
            d3(text="恢复").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout) and d3(
                resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
                d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例94:床头屏(16床)与门口屏进行语音通话后点击保持,床旁屏(17床)与门口屏建立语音通话,门口屏挂断17床语音通话后点击恢复,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_094(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="恢复").exists(timeout=timeout):
            d3(text="恢复").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="通话保持中...").exists(timeout=timeout) and d1(description="通话中...").exists(
                timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例95:床头屏(16床)与门口屏进行语音通话后点击保持,床旁屏(17床)与门口屏建立视频通话,门口屏挂断17床视频通话后点击保持,与床头屏(16床)进行语音通话
    @staticmethod
    def tc_095(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d2(description="视频通话").exists(timeout=30):
            d2(description="视频通话").click()
            d2.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="保持").exists(timeout=timeout):
            d3(text="保持").click()
            d3.sleep(3)
        else:
            pass
        if d1(description="通话保持中...").exists(timeout=timeout) and d3(text="恢复").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").exists(timeout=timeout):
                d3(resourceId="com.ocamara.call_service_lib:id/ivHangup").click()
                d3.sleep(3)
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例0x1:强制开启P2P呼叫
    @staticmethod
    def tc_0x1(log_img_path, file_name):
        mobaxterm_path = r"D:\software\MobaXterm_Portable\MobaXterm_Personal_25.2.exe"
        host = "10.10.5.21"  # 替换为实际服务器地址
        username = "root"  # 替换为实际用户名
        password = "Longxi@2001"  # 替换为实际密码
        port = 22
        try:
            # 构建SSH连接命令
            ssh_command = f'ssh {username}@{host} -p {port}'
            print(f"正在连接到 {username}@{host}:{port}")

            # 启动MobaXterm并打开SSH连接
            subprocess.Popen(
                f'"{mobaxterm_path}" -newtab "{ssh_command}"',
                shell=True
            )
            time.sleep(30)  # 等待连接窗口打开

            # 切换到英文输入法
            pyautogui.hotkey('shift')
            time.sleep(3)  # 等待输入法切换完成
            # 定义要执行的防火Longxi@2001
            # cd /root/xswitch-free
            # make stop
            # 墙命令
            # commands = ["systemctl start firewalld"]
            commands = ["yes", "cd /root/xswitch-free", "make stop"]
            print(f"执行命令: {commands[0]}")
            pyautogui.typewrite(commands[0])
            pyautogui.press('enter')
            time.sleep(2)

            print(f"执行命令: {password}")
            pyautogui.typewrite(password)
            pyautogui.press('enter')
            time.sleep(2)

            print(f"执行命令: {commands[1]}")
            pyautogui.typewrite(commands[1])
            pyautogui.press('enter')
            time.sleep(2)
            print(f"执行命令: {commands[2]}")
            pyautogui.typewrite(commands[2])
            pyautogui.press('enter')
            time.sleep(60)
            # 关闭MobaXterm程序
            pyautogui.hotkey('alt', 'f4')
            time.sleep(3)  # 等待MobaXterm程序退出
            print("所有防火墙命令已执行完毕,请查看结果")
            return str(True)

        except Exception as e:
            print(f"执行过程中发生错误: {str(e)}")
            return False

    # 用例0x2:强制关闭P2P呼叫
    @staticmethod
    def tc_0x2(log_img_path, file_name):
        mobaxterm_path = r"D:\software\MobaXterm_Portable\MobaXterm_Personal_25.2.exe"
        host = "10.10.5.21"  # 替换为实际服务器地址
        username = "root"  # 替换为实际用户名
        password = "Longxi@2001"  # 替换为实际密码
        port = 22
        try:
            # 构建SSH连接命令
            ssh_command = f'ssh {username}@{host} -p {port}'
            print(f"正在连接到 {username}@{host}:{port}")

            # 启动MobaXterm并打开SSH连接
            subprocess.Popen(
                f'"{mobaxterm_path}" -newtab "{ssh_command}"',
                shell=True
            )
            time.sleep(30)  # 等待连接窗口打开

            # 切换到英文输入法
            pyautogui.hotkey('shift')
            time.sleep(3)  # 等待输入法切换完成
            print("切换输入法完成")
            # 定义要执行的防火墙命令
            # commands = ["sudo systemctl stop firewalld"]
            commands = ["yes", "cd /root/xswitch-free", "make run"]
            print(f"执行命令: {commands[0]}")
            pyautogui.typewrite(commands[0])
            pyautogui.press('enter')
            time.sleep(2)

            print(f"执行命令: {password}")
            pyautogui.typewrite(password)
            pyautogui.press('enter')
            time.sleep(2)

            print(f"执行命令: {commands[1]}")
            pyautogui.typewrite(commands[1])
            pyautogui.press('enter')
            time.sleep(2)
            print(f"执行命令: {commands[2]}")
            pyautogui.typewrite(commands[2])
            pyautogui.press('enter')
            time.sleep(60)
            # 关闭MobaXterm程序
            pyautogui.hotkey('alt', 'f4')
            time.sleep(3)  # 等待MobaXterm程序退出
            print("所有防火墙命令已执行完毕,请查看结果")
            return str(True)

        except Exception as e:
            print(f"执行过程中发生错误: {str(e)}")
            return False

    # 用例96:强制关闭SIP服务
    @staticmethod
    def tc_096(log_img_path, file_name):
        # 只需改这里:0=关闭SIP服务,1=启动SIP服务
        switch_status = 0
        headers = {'Content-Type': 'application/json'}
        url = "http://10.10.5.221:11474/api/Manage/Switch"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=switch_status)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(100)
        if "关闭" in str(result):
            return 'Pass'
        else:
            return 'Fail'

    # 用例97:强制启动SIP服务
    @staticmethod
    def tc_097(log_img_path, file_name):
        # 只需改这里:0=关闭SIP服务,1=启动SIP服务
        switch_status = 1
        headers = {'Content-Type': 'application/json'}
        url = "http://10.10.5.221:11474/api/Manage/Switch"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=switch_status)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(60)
        if "启动" in str(result):
            return 'Pass'
        else:
            return 'Fail'

    # 用例98:重启应用和CallService
    @staticmethod
    def tc_098(log_img_path, file_name):
        pack_name = {"床头屏": "com.bedside", "床旁屏": "com.example.wisdom_side",
                     "护士站主机": "com.ocamara.nursecentre", "门口屏": "com.ocamara.gatescreen",
                     "交互大屏": "com.ocamar_smart.ocamar_smart", "走廊屏": "com.ocamara.corridorscreen"}
        d10.app_install(r'./app/BHP1010X1.0.9.089_Z.apk')
        time.sleep(50)
        print("同床位床头屏应用安装成功")
        # d11.app_install(r'./app/BSI1330X.1.12.037_Z.apk')
        # time.sleep(50)
        # print("同床位床旁屏应用安装成功")
        d1.app_install(r'./app/BHP1010X1.0.9.089_Z.apk')
        time.sleep(30)
        print("床头屏应用安装成功")
        # d2.app_install(r'./app/BSI1330X.1.12.037_Z.apk')
        # time.sleep(30)
        # print("床旁屏应用安装成功")
        # d3.app_install(r'./app/NSR1560X1.2.11.023_Z.apk')
        # time.sleep(30)
        # print("护士站主机应用安装成功")
        # d4.app_install(r'./app/RDP1560X.3.5.6.032_Z.apk')
        # time.sleep(30)
        # print("门口屏应用安装成功")
        # d7.app_install(r'./app/NSR1560X1.2.11.023_Z.apk')
        # time.sleep(30)
        # print("转接主机应用安装成功")
        # d8.app_uninstall('com.ocamar_smart.ocamar_smart')
        # d8.app_install(r'./app/Smart_Screen.0.14.003_Z.apk')
        # time.sleep(30)
        # print("护理大屏应用安装成功")
        # d9.app_uninstall('com.ocamara.corridorscreen')
        # d9.app_install(r'./app/HWD2800X1.0.5.013_Z.apk')
        # time.sleep(30)
        # print("走廊屏应用安装成功")

        # for d, n in {d1: 0, d2: 1, d3: 2, d4: 3, d7: 2, d10: 0, d11: 1}.items():
        #     # d.app_install('com.ocamar.start1.0.002.apk')
        #     # d.sleep(3)
        #     d.app_uninstall('com.ocamara.call_service_lib')
        #     d.sleep(3)
        #     d.app_install('CallService_0X1.3.33.apk')
        #     d.sleep(3)
        #     d.app_stop('com.ocamara.call_service_lib')
        #     d.sleep(3)
        #     d.app_start('com.ocamara.call_service_lib')
        #     d.sleep(3)
        #     d.app_stop(list(pack_name.values())[n])
        #     d.sleep(3)
        #     d.app_start(list(pack_name.values())[n])
        #     d.sleep(3)
        #     print('{}CallService服务安装成功'.format(list(pack_name.keys())[n]))
        # for d, n in {d8: 4, d9: 5}.items():
        #     d.app_uninstall('com.ocamara.call_service_lib')
        #     d.sleep(3)
        #     d.app_install('CallService_2X1.3.33.apk')
        #     d.sleep(3)
        #     d.app_stop('com.ocamara.call_service_lib')
        #     d.sleep(3)
        #     d.app_start('com.ocamara.call_service_lib')
        #     d.sleep(3)
        #     d.app_stop(list(pack_name.values())[n])
        #     d.sleep(3)
        #     d.app_start(list(pack_name.values())[n])
        #     d.sleep(3)
        #     print('{}CallService服务安装成功'.format(list(pack_name.keys())[n]))
        # return "应用安装成功"

    # 用例99:关闭应用通话声音
    @staticmethod
    def tc_099(log_img_path, file_name):
        pack_name = {"床头屏": "com.bedside", "床旁屏": "com.example.wisdom_side",
                     "护士站主机": "com.ocamara.nursecentre", "门口屏": "com.ocamara.gatescreen",
                     "交互大屏": "com.ocamar_smart.ocamar_smart", "走廊屏": "com.ocamara.corridorscreen"}
        for d, n in {d1: 0, d2: 1, d3: 2, d4: 3, d7: 2, d8: 4}.items():
            d.shell('cmd appops set {} RECORD_AUDIO ignore'.format(list(pack_name.values())[n]))
            d.press('volume_mute')
            d.sleep(3)
        return "关闭应用通话声音"

    # 用例100:打开应用通话声音
    @staticmethod
    def tc_100(log_img_path, file_name):
        pack_name = {"床头屏": "com.bedside", "床旁屏": "com.example.wisdom_side",
                     "护士站主机": "com.ocamara.nursecentre", "门口屏": "com.ocamara.gatescreen",
                     "交互大屏": "com.ocamar_smart.ocamar_smart", "走廊屏": "com.ocamara.corridorscreen"}
        for d, n in {d1: 0, d2: 1, d3: 2, d4: 3, d7: 2, d8: 4}.items():
            d.shell('cmd appops set {} RECORD_AUDIO allow'.format(list(pack_name.values())[n]))
            for i in range(3):
                d.press('volume_up')
            d.sleep(3)
        return "打开应用通话声音"

    # 用例101:退出床头屏后,床头屏发起呼叫后自动取消呼叫(普通呼叫)
    @staticmethod
    def tc_101(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        time.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            d1.sleep(3)
            d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例102:退出床头屏后,床头屏发起呼叫后自动取消呼叫(增援呼叫)
    @staticmethod
    def tc_102(log_img_path, file_name):
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        d1.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            d1.sleep(3)
            d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例103:退出床头屏后,床头屏与护士站进行语音通话(普通呼叫)
    @staticmethod
    def tc_103(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        time.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d1.sleep(3)
                d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例104:退出床头屏后,床头屏与护士站进行语音通话(增援呼叫)
    @staticmethod
    def tc_104(log_img_path, file_name):
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        d1.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d1.sleep(3)
                d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例105:退出床头屏后,床头屏发起卫生间呼叫,护士站挂断
    @staticmethod
    def tc_105(log_img_path, file_name):
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        d1.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 138')
        d1.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d1.sleep(3)
                d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例106:退出床头屏后,床头屏与门口屏进行语音通话(普通呼叫)
    @staticmethod
    def tc_106(log_img_path, file_name):
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        d1.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        if d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
                d1.sleep(3)
                d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例107:退出床头屏后,床头屏与门口屏进行语音通话(增援呼叫)
    @staticmethod
    def tc_107(log_img_path, file_name):
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        d1.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        if d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
                d1.sleep(3)
                d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例108:退出床头屏后,床头屏发起卫生间呼叫,门口屏挂断
    @staticmethod
    def tc_108(log_img_path, file_name):
        time.sleep(3)
        d1.app_stop("com.ocamar.start")
        d1.sleep(3)
        d1.app_stop("com.bedside")
        d1.sleep(3)
        d1.shell('input keyevent 138')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=2).click()
            d1.sleep(3)
            d1.app_start("com.bedside")
            return 'Pass'
        else:
            d1.sleep(3)
            d1.app_start("com.bedside")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例109:退出床旁屏后,床旁屏发起呼叫后取消呼叫
    @staticmethod
    def tc_109(log_img_path, file_name):
        time.sleep(3)
        d2.app_stop("com.ocamar.start")
        d2.sleep(3)
        d2.app_stop("com.example.wisdom_side")
        d2.sleep(3)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d2.shell('input keyevent 133')
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            return 'Pass'
        else:
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例110:退出床旁屏后,床旁屏与护士站进行语音通话
    @staticmethod
    def tc_110(log_img_path, file_name):
        time.sleep(3)
        d2.app_stop("com.ocamar.start")
        d2.sleep(3)
        d2.app_stop("com.example.wisdom_side")
        d2.sleep(3)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d2.sleep(3)
                d2.app_start("com.example.wisdom_side")
            return 'Pass'
        else:
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例111:退出床旁屏后,床旁屏发起卫生间呼叫,护士站挂断
    @staticmethod
    def tc_111(log_img_path, file_name):
        time.sleep(3)
        d2.app_stop("com.ocamar.start")
        d2.sleep(init_time)
        d2.app_stop("com.example.wisdom_side")
        d2.sleep(3)
        d2.shell('input keyevent 139')
        d2.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d2.sleep(3)
                d2.app_start("com.example.wisdom_side")
            return 'Pass'
        else:
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例112:退出床旁屏后,床旁屏与门口屏进行语音通话
    @staticmethod
    def tc_112(log_img_path, file_name):
        time.sleep(3)
        d2.app_stop("com.ocamar.start")
        d2.sleep(3)
        d2.app_stop("com.example.wisdom_side")
        d2.sleep(3)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        if d4(description="通话中...").exists(timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
                d2.sleep(3)
                d2.app_start("com.example.wisdom_side")
            return 'Pass'
        else:
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例113:退出床旁屏后,床旁屏发起卫生间呼叫,门口屏挂断
    @staticmethod
    def tc_113(log_img_path, file_name):
        time.sleep(3)
        d2.app_stop("com.ocamar.start")
        d2.sleep(3)
        d2.app_stop("com.example.wisdom_side")
        d2.sleep(3)
        d2.shell('input keyevent 139')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=2).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=2).click()
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            d2.sleep(3)
            d2.app_start("com.example.wisdom_side")
            return "Fail"

    # 用例114:退出门口屏后,门口屏发起卫生间呼叫、护士站挂断
    @staticmethod
    def tc_114(log_img_path, file_name):
        time.sleep(3)
        d4.app_stop("com.ocamar.start")
        d4.sleep(3)
        d4.app_stop("com.ocamara.gatescreen")
        d4.sleep(3)
        d4.shell('input keyevent 138')  # 门口屏取消卫生间呼叫键值: 39
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
                d4.sleep(3)
                d4.app_start("com.ocamara.gatescreen")
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            d4.sleep(3)
            d4.app_start("com.ocamara.gatescreen")
            return "Fail"

    # 用例115:床头屏与护士站进行语音通话,重启床头屏->PR:床头和护士站弹窗30秒都消失
    @staticmethod
    def tc_115(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d1.app_stop("com.bedside")
        time.sleep(3)
        d1.app_start("com.bedside")
        time.sleep(35)
        if not d3(text="通话中...").exists(timeout=3):
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例116:床头屏与门口屏进行语音通话,重启床头屏->PR:床头和门口屏弹窗30秒都消失
    @staticmethod
    def tc_116(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        d1.app_stop("com.bedside")
        time.sleep(3)
        d1.app_start("com.bedside")
        time.sleep(35)
        if not d4(description="通话中...").exists(timeout=3):
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例117:床旁屏与护士站进行语音通话,重启床旁屏->PR:床旁和护士站弹窗30秒都消失
    @staticmethod
    def tc_117(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        d2.app_stop("com.example.wisdom_side")
        time.sleep(3)
        d2.app_start("com.example.wisdom_side")
        time.sleep(35)
        if not d3(text="通话中...").exists(timeout=3):
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例118:床旁屏与门口屏进行语音通话,重启床头屏->PR:床旁和门口屏弹窗30秒都消失
    @staticmethod
    def tc_118(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        d2.app_stop("com.example.wisdom_side")
        time.sleep(3)
        d2.app_start("com.example.wisdom_side")
        time.sleep(35)
        if not d4(description="通话中...").exists(timeout=3):
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例119:护士站设置分组呼叫时间00:01-23:59->PR:分组呼叫时间生效
    @staticmethod
    def tc_119(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(resourceId="com.ocamara.nursecentre:id/main_tx_time").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/main_tx_time").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/set_voice").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/set_voice").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_start").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_start").click()
            d3.sleep(1)
            d3.clear_text()
            d3.sleep(1)
            d3.send_keys("00:01")
            d3.sleep(1)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_end").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_end").click()
            d3.sleep(1)
            d3.clear_text()
            d3.sleep(1)
            d3.send_keys("23:59")
            d3.sleep(1)
        else:
            pass
        if d3(text="23:59").exists(timeout=timeout):
            d3(text="确认").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例120:在分组呼叫时间内,A组床头屏发起呼叫->PR:A组护士站可以正常通话,正常挂断
    @staticmethod
    def tc_120(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d3(text="通话中...").exists(timeout=timeout):
            if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").exists(timeout=timeout):
                d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例121:在分组呼叫时间内,A组床头屏发起呼叫->PR:AB组门口屏可以正常通话,正常挂断
    @staticmethod
    def tc_121(log_img_path, file_name):
        d1.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d1(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(
                timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例122:在分组呼叫时间内,C组床头屏发起呼叫->PR:A组护士站无法收到C组床头屏呼叫消息
    @staticmethod
    def tc_122(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d10.shell('input keyevent 132')
        d10.sleep(5)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d10(description="呼叫中...").exists(timeout=timeout):
            d10.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例123:在分组呼叫时间内,C组床头屏发起呼叫->PR:AB组门口屏无法收到C组床头屏呼叫消息
    @staticmethod
    def tc_123(log_img_path, file_name):
        d10.sleep(init_time)
        d10.shell('input keyevent 132')
        d10.sleep(5)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        if d10(description="呼叫中...").exists(timeout=timeout):
            d10.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例124:在分组呼叫时间内,B组床旁屏发起呼叫->PR:A组护士站无法收到B组床旁屏呼叫消息
    @staticmethod
    def tc_124(log_img_path, file_name):
        if d3(text="呼叫应答").exists(timeout=timeout):
            d3(text="呼叫应答").click()
        else:
            pass
        time.sleep(init_time)
        d11.shell('input keyevent 132')
        d11.sleep(5)
        if d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_answer").click()
            d3.sleep(3)
        else:
            pass
        if d11(description="呼叫中...").exists(timeout=timeout):
            d11.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例125:在分组呼叫时间内,B组床旁屏发起呼叫->PR:AB组门口屏可以正常通话,正常挂断
    @staticmethod
    def tc_125(log_img_path, file_name):
        d2.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(set_time)
        else:
            pass
        if d2(description="通话中...").exists(timeout=timeout) and d4(description="通话中...").exists(
                timeout=timeout):
            if d4(className="android.widget.ImageView", index=3).exists(timeout=timeout):
                d4(className="android.widget.ImageView", index=3).click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例126:在分组呼叫时间内,C组床旁屏发起呼叫->PR:AB组门口屏无法收到C组床旁屏呼叫消息
    @staticmethod
    def tc_126(log_img_path, file_name):
        d11.sleep(init_time)
        d11.shell('input keyevent 132')
        d11.sleep(5)
        if d4(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d4(className="android.widget.ImageView", index=0).click()
            d4.sleep(3)
        else:
            pass
        if d11(description="呼叫中...").exists(timeout=timeout):
            d11.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例127:护士站设置分组呼叫时间00:00-00:00->PR:分组呼叫时间关闭成功
    @staticmethod
    def tc_127(log_img_path, file_name):
        d3.sleep(init_time)
        if d3(resourceId="com.ocamara.nursecentre:id/main_tx_time").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/main_tx_time").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/set_voice").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/set_voice").click()
            d3.sleep(3)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_start").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_start").click()
            d3.sleep(1)
            d3.clear_text()
            d3.sleep(1)
            d3.send_keys("00:00")
            d3.sleep(1)
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_end").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/fragment_voice_ed_group_end").click()
            d3.sleep(1)
            d3.clear_text()
            d3.sleep(1)
            d3.send_keys("00:00")
            d3.sleep(1)
        else:
            pass
        if d3(text="00:00").exists(timeout=timeout):
            d3(text="确认").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例128:床头屏(床位名称不带床)发起呼叫___PR__护士站、门口屏、护理大屏呼叫弹窗不带床
    @staticmethod
    def tc_128(log_img_path, file_name):
        time.sleep(init_time)
        d10.shell('input keyevent 132')
        d10.sleep(3)
        if d3(text="01").exists(timeout=timeout) and d8(description="01\n呼叫中...").exists(timeout=timeout):
            d10.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例129:床旁屏(床位名称不带床)发起呼叫___PR__护士站、门口屏、护理大屏呼叫弹窗不带床
    @staticmethod
    def tc_129(log_img_path, file_name):
        time.sleep(init_time)
        d11.shell('input keyevent 132')
        d11.sleep(3)
        if d3(text="01").exists(timeout=timeout) and d8(description="01\n呼叫中...").exists(timeout=timeout):
            d11.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例130:关闭增援SOS提醒___PR__增援SOS提醒关闭成功
    @staticmethod
    def tc_130(log_img_path, file_name):
        time.sleep(init_time)
        # 填写参数
        params = {"alertPage": {"backTime": 30, "onOff": "true", "screenTypes": ["01", "02", "05", "06"]},
                  "callSetting": {"bedCall": "false", "intervalTime": 0},
                  "careNotice": {"onOff": "true", "screenTypes": ["01", "02", "05", "06"]},
                  "measure": {"onOff": "false", "screenTypes": []},
                  "homepage": {"backTime": 1, "onOff": "false", "screenTypes": ["01", "02", "03", "05", "06"]},
                  "identityVerification": "false", "identityVerificationOfScreenTypes": ["01", "02"],
                  "namePrivacy": "false", "namePrivacyOfScreenTypes": ["03", "02", "01"],
                  "nightMode": {"endTime": "21:00:00", "onOff": "false", "startTime": "09:00:00", "volume": 20},
                  "showInfuse": "true", "showInfuseOfScreenTypes": ["01", "02"],
                  "sosCallDTO": {"onOff": "false", "screenTypeList": ["01", "04", "05"]}, "screenType": "0",
                  "wardCode": "0187dfa2", "nursingLocationToBed": "false", "closingAccountsNotice": "true",
                  "birthdayGreetingNotification": "true", "dischargeNotice": "true"}
        url = urls + "/dwmws/config/saveBaseSetting"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例131:床头屏发起增援呼叫___PR__床头屏、护士站呼叫弹窗显示增援呼叫中
    @staticmethod
    def tc_131(log_img_path, file_name):
        time.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(text="增援呼叫中...").exists(timeout=timeout) and d1(description="增援呼叫中...").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例132:打开增援SOS提醒___PR__增援SOS提醒打开成功
    @staticmethod
    def tc_132(log_img_path, file_name):
        time.sleep(init_time)
        # 填写参数
        params = {"alertPage": {"backTime": 30, "onOff": "true", "screenTypes": ["01", "02", "05", "06"]},
                  "callSetting": {"bedCall": "false", "intervalTime": 0},
                  "careNotice": {"onOff": "true", "screenTypes": ["01", "02", "05", "06"]},
                  "measure": {"onOff": "false", "screenTypes": []},
                  "homepage": {"backTime": 1, "onOff": "false", "screenTypes": ["01", "02", "03", "05", "06"]},
                  "identityVerification": "false", "identityVerificationOfScreenTypes": ["01", "02"],
                  "namePrivacy": "false", "namePrivacyOfScreenTypes": ["03", "02", "01"],
                  "nightMode": {"endTime": "21:00:00", "onOff": "false", "startTime": "09:00:00", "volume": 20},
                  "showInfuse": "true", "showInfuseOfScreenTypes": ["01", "02"],
                  "sosCallDTO": {"onOff": "true", "screenTypeList": ["01", "04", "05"]}, "screenType": "0",
                  "wardCode": "0187dfa2", "nursingLocationToBed": "false", "closingAccountsNotice": "true",
                  "birthdayGreetingNotification": "true", "dischargeNotice": "true"}
        url = urls + "/dwmws/config/saveBaseSetting"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例133:床头屏发起增援呼叫___PR__床头屏、护士站呼叫弹窗显示SOS
    @staticmethod
    def tc_133(log_img_path, file_name):
        time.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d3(text="SOS").exists(timeout=timeout) and d1(description="SOS呼叫中...").exists(
                timeout=timeout):
            d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例134:切换到新版RS485报警器___PR__新版RS485报警器切换成功
    @staticmethod
    def tc_134(log_img_path, file_name):
        time.sleep(init_time)
        # 填写参数
        params = {"alertPage": {"backTime": 30, "onOff": "true", "screenTypes": ["01", "02"]},
                  "homepage": {"backTime": 1, "onOff": "true", "screenTypes": ["01", "05", "03", "02"]},
                  "qrcodeRoom": "true", "identityVerification": "false",
                  "identityVerificationOfScreenTypes": ["01", "02"],
                  "namePrivacy": "false", "namePrivacyOfScreenTypes": ["01", "03"],
                  "nightMode": {"endTime": "20:15:39", "onOff": "false", "startTime": "08:15:35", "volume": 10},
                  "callSetting": {"intervalTime": 0, "bedCall": None, "hospitalCall": "true"}, "password": "123456",
                  "showInfuse": "true", "showInfuseOfScreenTypes": ["01", "02"], "qrcodeValue": "patientID",
                  "screenType": "0", "wardCode": "0",
                  "bedRestScreen": {"onOff": "true", "screenTypes": ["02", "01", "03"]},
                  "doctorRounds": {"onOff": "true", "screenTypes": ["04", "05", "06", "03"]},
                  "outingReminder": {"onOff": "true", "screenTypes": ["05", "06", "01", "02", "03"]},
                  "nursingLocationToBed": "false",
                  "callColorSettings": {"onOff": "true", "succorColor": "黄色", "normalColor": "红色",
                                        "nursingRemindColor": "绿色", "nurseLevel1Color": "紫色"},
                  "patientInfo": {"showPatientId": "false", "patientIdTitle": "病人号"},
                  "examinationPermissionList": [0],
                  "signsDataSourceList": [2], "bloodType": "true", "bloodTypeWithApp": ["01", "02"],
                  "nursingWithApp": ["01", "02"], "nursing": "false", "receiveMsg": [], "toiletAlarmDeviceType": 1}
        url = urls + "/dwmws/config/saveBaseSetting"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例135:门口屏发起卫生间呼叫___PR__门口屏不可以发起普通卫生间呼叫
    @staticmethod
    def tc_135(log_img_path, file_name):
        time.sleep(init_time)
        d4.shell('input keyevent 138')
        d4.sleep(3)
        if not d3(text="卫生间呼叫...").exists(timeout=5):
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例136:切换到普通报警器___PR__普通报警器切换成功
    @staticmethod
    def tc_136(log_img_path, file_name):
        time.sleep(init_time)
        # 填写参数
        params = {"alertPage": {"backTime": 30, "onOff": "true", "screenTypes": ["01", "02"]},
                  "homepage": {"backTime": 1, "onOff": "true", "screenTypes": ["01", "05", "03", "02"]},
                  "qrcodeRoom": "true", "identityVerification": "false",
                  "identityVerificationOfScreenTypes": ["01", "02"],
                  "namePrivacy": "false", "namePrivacyOfScreenTypes": ["01", "03"],
                  "nightMode": {"endTime": "20:15:39", "onOff": "false", "startTime": "08:15:35", "volume": 10},
                  "callSetting": {"intervalTime": 0, "bedCall": None, "hospitalCall": "true"}, "password": "123456",
                  "showInfuse": "true", "showInfuseOfScreenTypes": ["01", "02"], "qrcodeValue": "patientID",
                  "screenType": "0", "wardCode": "0",
                  "bedRestScreen": {"onOff": "true", "screenTypes": ["02", "01", "03"]},
                  "doctorRounds": {"onOff": "true", "screenTypes": ["04", "05", "06", "03"]},
                  "outingReminder": {"onOff": "true", "screenTypes": ["05", "06", "01", "02", "03"]},
                  "nursingLocationToBed": "false",
                  "callColorSettings": {"onOff": "true", "succorColor": "黄色", "normalColor": "红色",
                                        "nursingRemindColor": "绿色", "nurseLevel1Color": "紫色"},
                  "patientInfo": {"showPatientId": "false", "patientIdTitle": "病人号"},
                  "examinationPermissionList": [0],
                  "signsDataSourceList": [2], "bloodType": "true", "bloodTypeWithApp": ["01", "02"],
                  "nursingWithApp": ["01", "02"], "nursing": "false", "receiveMsg": [], "toiletAlarmDeviceType": 0}
        url = urls + "/dwmws/config/saveBaseSetting"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(json.loads(response.text), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例137:门口屏发起卫生间呼叫___PR__门口屏可以发起普通卫生间呼叫
    @staticmethod
    def tc_137(log_img_path, file_name):
        time.sleep(init_time)
        d4.shell('input keyevent 138')
        d4.sleep(3)
        if d3(text="卫生间呼叫...").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/phone_hint_img_decline").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例138:设备声音配置走廊屏勾选全部,门口屏勾选实时广播___PR__声音配置设置成功
    @staticmethod
    def tc_138(log_img_path, file_name):
        time.sleep(init_time)
        refresh_login(headers_login, urls, "4YMTYUjbbeM6Rz5dNuYQnA==", "Fm1KQXmRgVdz5H3nbIIleg==", timeout)  # 登录账号、密码
        # 填写参数(设备声音配置走廊屏勾选全部,门口屏勾选实时广播)
        params = {"onOff": "true", "list": [{"type": "01", "isBroadcast": 0, "isTimelyBroadcast": 0, "isBgm": 0},
                                            {"type": "02", "isBroadcast": 0, "isTimelyBroadcast": 0, "isBgm": 0,
                                             "nursingNotes": 0},
                                            {"type": "03", "isBroadcast": 0, "isTimelyBroadcast": 1, "isCall": 0,
                                             "isBgm": 0, "isAlarm": 0},
                                            {"type": "04", "isBroadcast": 1, "isCall": 1, "isBgm": 1, "isAlarm": 1},
                                            {"type": "06", "isBroadcast": None, "isCall": 0, "isNotice": 0,
                                             "isAlarm": 0,
                                             "timedReminders": 0},
                                            {"type": "05", "isBroadcast": None, "isNotice": 0, "isAlarm": 0,
                                             "wardServices": 0, "timedReminders": 0, "gradedResponse": 0}]}
        url = f"{urls}/dwmws/others/setDeviceConfig"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers_login, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(response.json(), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例139:床头屏发起呼叫___PR__门口屏、护理大屏无法收到呼叫弹窗
    @staticmethod
    def tc_139(log_img_path, file_name):
        time.sleep(init_time)
        d1.shell('input keyevent 132')
        d1.sleep(3)
        if d8(description="16床\n呼叫中...").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例140:床旁屏发起呼叫___PR__门口屏、护理大屏无法收到呼叫弹窗
    @staticmethod
    def tc_140(log_img_path, file_name):
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d8(description="17床\n呼叫中...").exists(timeout=timeout):
            d2.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例141:护士站发起实时广播___PR__床头屏、床旁屏无法收到实时广播
    @staticmethod
    def tc_141(log_img_path, file_name):
        time.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if not d1(description="广播中...").exists(timeout=5) and not d2(description="广播中...").exists(timeout=5):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例142:护士站发起音频广播___PR__床头屏、床旁屏、门口屏无法收到音频广播【不支持P2P通话】
    @staticmethod
    def tc_142(log_img_path, file_name):
        time.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if not d1(description="广播中...").exists(timeout=5) and not d2(description="广播中...").exists(
                timeout=5) and not d4(description="广播中...").exists(timeout=5):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例143:设备声音配置总开关关闭___PR__设备声音配置总开关关闭成功
    @staticmethod
    def tc_143(log_img_path, file_name):
        time.sleep(init_time)
        refresh_login(headers_login, urls, "4YMTYUjbbeM6Rz5dNuYQnA==", "Fm1KQXmRgVdz5H3nbIIleg==",
                      timeout)  # 登录账号、密码
        # 填写参数(设备声音配置走廊屏勾选全部,门口屏勾选实时广播)
        params = {"onOff": "false", "list": [{"type": "01", "isBroadcast": 0, "isTimelyBroadcast": 0, "isBgm": 0},
                                             {"type": "02", "isBroadcast": 0, "isTimelyBroadcast": 0, "isBgm": 0,
                                              "nursingNotes": 0},
                                             {"type": "03", "isBroadcast": 0, "isTimelyBroadcast": 1, "isCall": 0,
                                              "isBgm": 0, "isAlarm": 0},
                                             {"type": "04", "isBroadcast": 1, "isCall": 1, "isBgm": 1, "isAlarm": 1},
                                             {"type": "06", "isBroadcast": None, "isCall": 0, "isNotice": 0,
                                              "isAlarm": 0,
                                              "timedReminders": 0},
                                             {"type": "05", "isBroadcast": None, "isNotice": 0, "isAlarm": 0,
                                              "wardServices": 0, "timedReminders": 0, "gradedResponse": 0}]}
        url = f"{urls}/dwmws/others/setDeviceConfig"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers_login, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(response.json(), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例144:床头屏发起增援呼叫___PR__护士站、门口屏、护理大屏收到呼叫弹窗
    @staticmethod
    def tc_144(log_img_path, file_name):
        time.sleep(init_time)
        d1.shell('input keyevent 131')
        d1.sleep(3)
        if d8(description="16床\n增援呼叫中...").exists(timeout=timeout) and d3(text="SOS").exists(timeout=timeout):
            d1.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例145:床旁屏发起呼叫___PR__护士站、门口屏、护理大屏收到呼叫弹窗
    @staticmethod
    def tc_145(log_img_path, file_name):
        time.sleep(init_time)
        d2.shell('input keyevent 132')
        d2.sleep(3)
        if d8(description="17床\n呼叫中...").exists(timeout=timeout) and d3(text="呼叫中...").exists(timeout=timeout):
            d2.shell('input keyevent 133')
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例146:护士站发起实时广播___PR__床旁屏(与床头同床位)无法收到实时广播【不支持P2P通话】
    @staticmethod
    def tc_146(log_img_path, file_name):
        time.sleep(init_time)
        if d3(text="实时广播").exists(timeout=timeout):
            d3(text="实时广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(text="开始广播").exists(timeout=timeout):
            d3(text="开始广播").click()
            d3.sleep(set_time)
        else:
            pass
        if not d11(description="广播中...").exists(timeout=5):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例147:护士站发起音频广播___PR__床头屏、床旁屏不能收到音频广播【不支持P2P通话】
    @staticmethod
    def tc_147(log_img_path, file_name):
        time.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if not d1(description="广播中...").exists(timeout=5) and not d2(description="广播中...").exists(timeout=5):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例148:护士站发起音频广播___PR__门口屏能收到音频广播【不支持P2P通话】
    @staticmethod
    def tc_148(log_img_path, file_name):
        time.sleep(init_time)
        if d3(text="音频广播").exists(timeout=timeout):
            d3(text="音频广播").click()
        else:
            pass
        if d3(text="全病区").exists(timeout=timeout):
            d3(text="全病区").click()
        else:
            pass
        if d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/audio_list_checkbox").click()
            d3.sleep(3)
        else:
            pass
        if d3(text="广播").exists(timeout=timeout):
            d3(text="广播").click()
            d3.sleep(3)
        else:
            pass
        if d4(description="广播中...").exists(timeout=timeout):
            if d3(text="广播中...").exists(timeout=timeout):
                d3(text="广播中...").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例149:设备声音配置总开关开启(勾选全部)___PR__设备声音配置总开关开启成功
    @staticmethod
    def tc_149(log_img_path, file_name):
        time.sleep(init_time)
        refresh_login(headers_login, urls, "4YMTYUjbbeM6Rz5dNuYQnA==", "Fm1KQXmRgVdz5H3nbIIleg==",
                      timeout)  # 登录账号、密码
        # 填写参数(设备声音配置走廊屏勾选全部,门口屏勾选实时广播)
        params = {"onOff": "true", "list": [{"type": "01", "isBroadcast": 1, "isTimelyBroadcast": 1, "isBgm": 1},
                                            {"type": "02", "isBroadcast": 1, "isTimelyBroadcast": 1, "isBgm": 1,
                                             "nursingNotes": 1},
                                            {"type": "03", "isBroadcast": 1, "isTimelyBroadcast": 1, "isCall": 1,
                                             "isBgm": 1, "isAlarm": 1},
                                            {"type": "04", "isBroadcast": 1, "isCall": 1, "isBgm": 1, "isAlarm": 1},
                                            {"type": "06", "isBroadcast": None, "isCall": 1, "isNotice": 1,
                                             "isAlarm": 1,
                                             "timedReminders": 1},
                                            {"type": "05", "isBroadcast": None, "isNotice": 1, "isAlarm": 1,
                                             "wardServices": 1, "timedReminders": 1, "gradedResponse": 1}]}
        url = f"{urls}/dwmws/others/setDeviceConfig"
        # 优化:直接用 json 参数传递,无需手动 json.dumps()
        response = requests.post(url, headers=headers_login, json=params, timeout=timeout)
        # 自动解码 Unicode 为中文,格式化输出
        result = json.dumps(response.json(), ensure_ascii=False, indent=2)
        time.sleep(set_time)
        if '200' in str(result):
            return 'Pass'
        else:
            print(result)
            return 'Fail'

    # 用例201:后台探视设备切换到探视车
    @staticmethod
    def tc_201(log_img_path, file_name):
        d6.sleep(init_time)
        op = webdriver.EdgeOptions()  # 4.10版本配置
        op.add_experimental_option("detach", True)
        op.add_argument("--inprivate")
        service = Service(executable_path=r"D:\software\python\msedgedriver.exe")
        driver = webdriver.Edge(service=service, options=op)  # 实例化一个浏览器对象()
        driver.maximize_window()
        driver.get('http://10.10.5.17:8066/login')
        time.sleep(5)
        try:
            if driver.find_element(by=By.CLASS_NAME, value="title").text == "智慧病房管理系统":
                driver.find_element(by=By.NAME, value="username").send_keys("tongzhen")
                time.sleep(3)
                driver.find_element(by=By.NAME, value="password").send_keys("Admin@123")
                time.sleep(3)
                driver.find_element(by=By.CLASS_NAME, value="el-button--default").click()  # 点击登录
                time.sleep(3)
            if not driver.find_element(by=By.XPATH,
                                       value='//*[@id="app"]/div/div[1]/div[2]/div[1]/div/ul/div[14]/li/ul/div[1]/a/li/span').is_displayed():  # 判断应用设置是否存在
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[1]/div[2]/div[1]/div/ul/div[14]/li/div/span').click()  # 点击系统设置
                time.sleep(3)
            driver.find_element(by=By.XPATH, value="//span[text()='应用设置']").click()  # 点击应用设置
            time.sleep(3)
            if driver.find_element(by=By.XPATH,
                                   value='//*[@id="app"]/div/div[2]/section/div/div[1]/div[8]').text == "探视设置":
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/section/div/div[1]/div[8]').click()  # 点击探视设置
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/section/div/div[2]/div[8]/div/label[2]/span[1]/span').click()  # 点击探视车
                time.sleep(3)
                driver.find_element(by=By.XPATH, value="//span[text()='确认']").click()  # 点击确认
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/div/div/div[1]/div[2]/div/div/span[2]/i').click()  # 点击用户信息
                time.sleep(3)
                driver.find_element(by=By.XPATH, value="//span[text()='退 出']").click()  # 点击退出智慧病房管理系统
                time.sleep(6)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/div/div/div[3]/div[1]/div/div[3]/div/button[2]/span').click()  # 点击确认
                time.sleep(3)
                driver.quit()
                return 'Pass'
            else:
                time.sleep(3)
                driver.save_screenshot(os.path.join(log_img_path, '{}.png'.format(file_name)))
                return "Fail"
        except:
            return "NA"
            pass

    # 用例202:探视屏发起探视,探视车接听后手动挂断
    @staticmethod
    def tc_202(log_img_path, file_name):
        d6.sleep(init_time)
        if d6(resourceId="com.example.wisdom_side:id/web_call_btn_hangup").exists(timeout=timeout):
            d6(resourceId="com.example.wisdom_side:id/web_call_btn_hangup").click()
        else:
            pass
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d6(className="android.widget.ImageView", index=4).exists(timeout=timeout):
            d6(className="android.widget.ImageView", index=4).click()  # 点击接听按钮
            d6.sleep(set_time)
        else:
            pass
        if d6(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d6(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例203:探视屏发起探视,探视车接听后自动挂断
    @staticmethod
    def tc_203(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d6(className="android.widget.ImageView", index=4).exists(timeout=timeout):
            d6(className="android.widget.ImageView", index=4).click()  # 点击接听按钮
            d6.sleep(set_time)
        else:
            pass
        if d6(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d6.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例204:探视屏发起探视,护士站接听
    @staticmethod
    def tc_204(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="接听").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_answer").click()
            d6.sleep(set_time)
        else:
            pass
        if d3(text="挂断").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/visit_call_hangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例205:探视屏发起探视,护士站转接到探视车
    @staticmethod
    def tc_205(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="转接病床").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_transfer").click()
        else:
            pass
        time.sleep(1)
        if d3(className="android.widget.FrameLayout", index=0).exists(timeout=timeout):
            d3(className="android.widget.FrameLayout", index=0).click()
            d3.click(0.39, 0.434)
        else:
            pass
        if d3(text="确认").exists(timeout=timeout):
            d3(text="确认").click()
            d3.sleep(set_time)
        else:
            pass
        if d6(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d6(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例206:探视屏发起探视,护士站转接到探视车,等待探视屏自动挂断
    @staticmethod
    def tc_206(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="转接病床").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_transfer").click()
        else:
            pass
        time.sleep(1)
        if d3(className="android.widget.FrameLayout", index=0).exists(timeout=timeout):
            d3(className="android.widget.FrameLayout", index=0).click()
            d3.click(0.39, 0.434)
        else:
            pass
        if d3(text="确认").exists(timeout=timeout):
            d3(text="确认").click()
            d3.sleep(set_time)
        else:
            pass
        if d6(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d6.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例207:探视屏发起探视,探视车挂断
    @staticmethod
    def tc_207(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d6(className="android.widget.ImageView", index=3).exists(timeout=timeout):
            d6(className="android.widget.ImageView", index=3).click()  # 点击挂断按钮
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例208:探视屏发起探视,护士站手动挂断
    @staticmethod
    def tc_208(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="挂断").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_hangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例209:探视屏发起探视,护士站自动挂断
    @staticmethod
    def tc_209(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="挂断").exists(timeout=timeout):
            d3.sleep(tip_time)
            if d5(description="申请探视").exists(timeout=timeout):
                return 'Pass'
            else:
                fail_screen(log_img_path, file_name)
                return "Fail"
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例221:后台探视设备切换到床旁屏
    @staticmethod
    def tc_221(log_img_path, file_name):
        d6.sleep(init_time)
        op = webdriver.EdgeOptions()  # 4.10版本配置
        op.add_experimental_option("detach", True)
        op.add_argument("--inprivate")
        driver = webdriver.Edge(options=op)  # 实例化一个浏览器对象()
        driver.maximize_window()
        driver.get('http://10.10.5.17:8066/login')
        time.sleep(5)
        try:
            if driver.find_element(by=By.CLASS_NAME, value="title").text == "智慧病房管理系统":
                driver.find_element(by=By.NAME, value="username").send_keys("tongzhen")
                time.sleep(3)
                driver.find_element(by=By.NAME, value="password").send_keys("Admin@123")
                time.sleep(3)
                driver.find_element(by=By.CLASS_NAME, value="el-button--default").click()  # 点击登录
                time.sleep(3)
            if not driver.find_element(by=By.XPATH,
                                       value='//*[@id="app"]/div/div[1]/div[2]/div[1]/div/ul/div[14]/li/ul/div[1]/a/li/span').is_displayed():  # 判断应用设置是否存在
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[1]/div[2]/div[1]/div/ul/div[14]/li/div/span').click()  # 点击系统设置
                time.sleep(3)
            driver.find_element(by=By.XPATH, value="//span[text()='应用设置']").click()  # 点击应用设置
            time.sleep(3)
            if driver.find_element(by=By.XPATH,
                                   value='//*[@id="app"]/div/div[2]/section/div/div[1]/div[8]').text == "探视设置":
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/section/div/div[1]/div[8]').click()  # 点击探视设置
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/section/div/div[2]/div[8]/div/label[1]/span[1]/span').click()  # 点击床旁屏
                time.sleep(3)
                driver.find_element(by=By.XPATH, value="//span[text()='确认']").click()  # 点击确认
                time.sleep(3)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/div/div/div[1]/div[2]/div/div/span[2]/i').click()  # 点击用户信息
                time.sleep(3)
                driver.find_element(by=By.XPATH, value="//span[text()='退 出']").click()  # 点击退出智慧病房管理系统
                time.sleep(6)
                driver.find_element(by=By.XPATH,
                                    value='//*[@id="app"]/div/div[2]/div/div/div[3]/div[1]/div/div[3]/div/button[2]/span').click()  # 点击确认
                time.sleep(3)
                driver.quit()
                return 'Pass'
            else:
                time.sleep(3)
                driver.save_screenshot(os.path.join(log_img_path, '{}.png'.format(file_name)))
                return "Fail"
        except:
            return "NA"
            pass

    # 用例222:探视屏发起探视,床旁屏接听后手动挂断
    @staticmethod
    def tc_222(log_img_path, file_name):
        d6.sleep(init_time)
        if d6(resourceId="com.example.wisdom_side:id/web_call_btn_hangup").exists(timeout=timeout):
            d6(resourceId="com.example.wisdom_side:id/web_call_btn_hangup").click()
        else:
            pass
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d2(description=" 请求").exists(timeout=timeout):
            d2.click(0.636, 0.765)  # 点击接听按钮
            d2.sleep(set_time)
        else:
            pass
        if d2(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d2(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例223:探视屏发起探视,床旁屏接听后自动挂断
    @staticmethod
    def tc_223(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d2(description=" 请求").exists(timeout=timeout):
            d2.click(0.636, 0.765)  # 点击接听按钮
            d2.sleep(set_time)
        else:
            pass
        if d2(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d2.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例224:探视屏发起探视,护士站接听
    @staticmethod
    def tc_224(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="接听").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_answer").click()
            d3.sleep(set_time)
        else:
            pass
        if d3(text="挂断").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/visit_call_hangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例225:探视屏发起探视,护士站转接到床旁屏
    @staticmethod
    def tc_225(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="转接病床").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_transfer").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d2(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例226:探视屏发起探视,护士站转接床旁屏后,等待探视屏自动挂断
    @staticmethod
    def tc_226(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="转接病床").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_transfer").click()
            d3.sleep(set_time)
        else:
            pass
        if d2(resourceId="com.ocamara.call_service_lib:id/video_hangup_Img").exists(timeout=timeout):
            d2.sleep(tip_time)
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例227:探视屏发起探视,床旁屏挂断
    @staticmethod
    def tc_227(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d2(description=" 请求").exists(timeout=timeout):
            d2(className="android.widget.ImageView", index=4).click()  # 点击挂断按钮
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例228:探视屏发起探视,护士站手动挂断
    @staticmethod
    def tc_228(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="挂断").exists(timeout=timeout):
            d3(resourceId="com.ocamara.nursecentre:id/hint_call_list_visit_hangup").click()
            return 'Pass'
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"

    # 用例229:探视屏发起探视,护士站自动挂断
    @staticmethod
    def tc_229(log_img_path, file_name):
        d5.sleep(init_time)
        if d5(className="android.widget.ImageView", index=0).exists(timeout=timeout):
            d5(className="android.widget.ImageView", index=0).click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d5(description="孙飞").exists(timeout=timeout):
            d5(description="孙飞").click()
        else:
            pass
        if d5(description="申请探视").exists(timeout=timeout):
            d5(description="申请探视").click()
        else:
            pass
        if d3(text="挂断").exists(timeoutscrcpy=timeout):
            d3.sleep(tip_time)
            if d5(description="申请探视").exists(timeout=timeout):
                return 'Pass'
            else:
                fail_screen(log_img_path, file_name)
                return "Fail"
        else:
            fail_screen(log_img_path, file_name)
            return "Fail"


if __name__ == '__main__':
    aa = Case
    # print(aa.tc_014_1('../result/log_img', 'test'))
    # print(aa.tc_063_1('../result/log_img', 'test'))
    # print(aa.tc_065_1('../result/log_img', 'test'))
    # print(aa.tc_050('../result/log_img', 'test'))
    # print(aa.tc_051('../result/log_img', 'test'))
    # print(aa.tc_052('../result/log_img', 'test'))
    # print(aa.tc_053('../result/log_img', 'test'))
    # print(aa.tc_054('../result/log_img', 'test'))
    # print(aa.tc_055('../result/log_img', 'test'))
    # print(aa.tc_056('../result/log_img', 'test'))
    # print(aa.tc_057('../result/log_img', 'test'))
    # print(aa.tc_058('../result/log_img', 'test'))
    # print(aa.tc_059('../result/log_img', 'test'))
    # print(aa.tc_060_5('../result/log_img', 'test'))
    # print(aa.tc_000('../result/log_img', 'test'))
    # print(aa.tc_063_4('../result/log_img', 'test'))
    print(aa.tc_065_2('../result/log_img', 'test'))
    # print(aa.tc_066('../result/log_img', 'test'))
    # print(aa.tc_067('../result/log_img', 'test'))
    # print(aa.tc_068('../result/log_img', 'test'))
    # print(aa.tc_069('../result/log_img', 'test'))
    # print(aa.tc_070('../result/log_img', 'test'))
    # print(aa.tc_071('../result/log_img', 'test'))
    # print(aa.tc_128('../result/log_img', 'test'))
    # print(aa.tc_129('../result/log_img', 'test'))
    # print(aa.tc_134('../result/log_img', 'test'))
    # print(aa.tc_135('../result/log_img', 'test'))
    # print(aa.tc_138('../result/log_img', 'test'))
    # print(aa.tc_139('../result/log_img', 'test'))
    # print(aa.tc_000_1('../result/log_img', 'test'))
    # print(aa.tc_001(
    #     log_img_path='../result/log_img',
    #     file_name = 'test',
    #     log_txt_path="../result/log_txt",  # 父目录
    #     folder_name="ctp_logs",  # 子文件夹名
    #     devices="10.10.5.96:1898"  # 替换为你的设备序列号(adb devices查看)
    # ))
    # for i in range(60):
    #     print(aa.tc_068('../result/log_img', 'test') +"-{}".format(i+1))
相关推荐
Saniffer_SH2 小时前
【高清视频】介绍一个自动化测试辅助小工具 - 上下电测试适用于电脑冷启动的掉电盒
网络·人工智能·驱动开发·嵌入式硬件·测试工具·计算机外设·压力测试
Lyyaoo.2 小时前
Lombok工具库
开发语言·python
无垠的广袤2 小时前
【工业树莓派 CM0 NANO 单板计算机】MLX90640 热成像仪
linux·python·树莓派·传感器
多恩Stone2 小时前
【SLURM 入门】sbatch 等概念与常用命令
人工智能·python
全栈凯哥2 小时前
09.Python 中元组完全指南
python
AsDuang2 小时前
Python 3.12 MagicMethods - 39 - __mod__
开发语言·python
小鸡吃米…2 小时前
Python 中的并发 —— 简介
服务器·数据库·python
无限进步_2 小时前
深入解析string:从设计思想到完整实现
开发语言·c++·ide·windows·git·github·visual studio