uiautomator2实例

2023-11-13

from pytestreport import TestRunner
import uiautomator2 as u2
import email
import os
import smtplib
import random
import re
import logging
import time
import config
from time import sleep
#from resource.baidumap import BaiduMap
import unittest
#from util import Action, UIChecker, Judge, Common
#from resource import basemap
#from util.DuerOSHelper.interface_element import ElementUse
#from config import case
from email.mime.application import MIMEApplication
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
#from case_ford_phase4_CX727 import map
#from map import test_mapauto

time_now = time.strftime(’%Y%m%d_%H%M%S’, time.localtime())

def get_deviceid():
‘’‘获取设备号’’’
listdevice = ’ ’
command = os.popen(‘adb devices’).readlines()
for i in range(len(command)):
listdevice += command[i]
devices_name = re.findall(’\n(.+?)\t’, listdevice, re.S)
return devices_name

listname = get_deviceid()
deviceid = ‘’.join(listname)
d = u2.connect_usb(deviceid)

#@case.attrs(package_name=ElementUse().codriver_package_name)
class TestStringMethods(unittest.TestCase):

# def setUp(self):
#     """
#             每个测试用例执行之前做操作"""
#     Action.clearLog()
#     # Action.adb_cmd("adb shell pm clear com.baidu.naviauto")
#     # Action.adb_cmd("adb shell am start -n com.baidu.naviauto/.NaviAutoActivity")
#     # Judge.passIf(self,
#     #              UIChecker.checkByPackageNameWait("com.baidu.naviauto"), "启动地图,fail"
#     #              )
#     d.app_start("com.baidu.naviauto")
#
# def tearDown(self):
#     """
#     每个测试用例执行之后做操作"""
#     # Action.adb_cmd("adb shell pm clear com.baidu.naviauto")
#     # Action.adb_cmd("adb shell am force-stop com.baidu.naviauto")
#     d.app_stop("com.baidu.naviauto")

def click_message_page(self):
    '''首页初始化'''
    time.sleep(3)
    d.app_start("com.baidu.naviauto")
    if d(text="接受").wait(timeout=10):
        d(text="接受").click()
    time.sleep(10)
    if d(text="是否继续上次导航?").wait(timeout=5):
        d(text="取消").click()
    time.sleep(2)
    # os.popen('start /b adb logcat -v -d threadtime > /Users/v_wangjiwei01/Desktop/autolog/')

def test_onlineCalculation_searchPages(self):
    '''搜索页的在线算路'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击历史记录第一条")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_lion_search"]/android.widget.FrameLayout[1]/'
                'android.widget.LinearLayout[1]/android.widget.LinearLayout[2]').click()
        # if d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_distance_layout").exists(timeout=2):
        #     time.sleep(1)
        #     d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_distance_layout").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        # if d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_phone_layout").exists(timeout=2):
        #     time.sleep(1)
        #     d(resourceId="com.baidu.naviauto:id/ll_poi_back").click()
        logging.info("途径点")
        d(resourceId="com.baidu.naviauto:id/ib_lion_search_add").click()
        d(text="输入途经点").click()
        time.sleep(2)
        d(text="输入途经点").send_keys("欢乐谷")
        d(text="搜索").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]').click()
        d(text="搜索").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("收藏夹")
        d(text="输入目的地").click()
        d(text="收藏夹").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]'
                '/android.widget.LinearLayout[3]').click()  # 点击列表第一个地址
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/iv_left").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("地图选点")
        d.long_click(550, 860)  # 地图选点
        d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_distance_layout").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_poi_back").click()
        time.sleep(3)
        logging.info("语音")
        os.popen("adb shell am broadcast -a duerosrun -n com.baidu.che.codriver/"
                 "com.baidu.che.codriver.debug.QueryReceiver --es enQuery 导航到天安门")
        time.sleep(5)
        d(resourceId="com.baidu.che.codriver:id/v_BaiduMic").exists(timeout=6)
        os.popen("adb shell am broadcast -a duerosrun -n com.baidu.che.codriver/"
                 "com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第一个")
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_onlineCalculation_searchPages_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_onlineCalculation_searchPages_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_offlineCalculation_searchPages(self):
    '''搜索页的离线算路'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("关闭在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[2]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击历史记录第一条")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_lion_search"]/android.widget.FrameLayout[1]/'
                'android.widget.LinearLayout[1]/android.widget.LinearLayout[2]').click()
        d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_distance_layout").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_poi_back").click()
        logging.info("途径点")
        d(resourceId="com.baidu.naviauto:id/ib_lion_search_add").click()
        d(text="输入途经点").click()
        time.sleep(2)
        d(text="输入途经点").send_keys("欢乐谷")
        d(text="搜索").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]').click()
        d(text="搜索").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        # d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("收藏夹")
        d(text="输入目的地").click()
        d(text="收藏夹").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]'
                '/android.widget.LinearLayout[3]').click()  # 点击列表第一个地址
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/iv_left").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("地图选点")
        d.long_click(550, 860)  # 地图选点
        d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_distance_layout").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_poi_back").click()
        time.sleep(3)
        logging.info("语音")
        os.popen("adb shell am broadcast -a duerosrun -n com.baidu.che.codriver/"
                 "com.baidu.che.codriver.debug.QueryReceiver --es enQuery 导航到天安门")
        time.sleep(5)
        d(resourceId="com.baidu.che.codriver:id/v_BaiduMic").exists(timeout=6)
        time.sleep(3)
        os.popen("adb shell am broadcast -a duerosrun -n com.baidu.che.codriver/"
                 "com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第一个")
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_offlineCalculation_searchPages_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_offlineCalculation_searchPages_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_goHome_goCompany(self):
    '''回家、去公司'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("打开在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[1]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="回家").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(text="去公司").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("关闭在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[2]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="回家").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="去公司").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_goHome_goCompany_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_goHome_goCompany_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_search_cityName(self):
    '''搜索poi出现poi列表,点击后发起算路'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("打开在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[1]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("天津")
        d(text="搜索").click()
        d(text="1. 天津市").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/btn_poi_gonavi").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_search_result_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("关闭在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[2]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("天津")
        d(text="搜索").click()
        d(text="1. 天津市").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/btn_poi_gonavi").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_search_result_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_search_cityName_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_search_cityName_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_city_calculateRoad(self):
    '''市内算路'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("打开在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[1]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        time.sleep(2)
        d(text="输入目的地").send_keys("香山")
        d(text="搜索").click()
        d(text="1. 香山公园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_search_result_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("关闭在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[2]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("香山")
        d(text="搜索").click()
        d(text="1. 香山公园").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/btn_poi_gonavi").click()
        d(text="开始导航").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/iv_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_search_result_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_city_calculateRoad_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_city_calculateRoad_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_no_high_speed(self):
    '''不走高速算路'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        d(scrollable=True).scroll(steps=10)
        logging.info("打开在线算路优先")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/bt_routplan_mode"]/android.widget.LinearLayout[1]/'
                'android.widget.RadioGroup[1]/android.widget.RadioButton[1]').click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        logging.info("设置偏好")
        d(text="偏好").click()
        d(text="不走高速").click()
        time.sleep(3)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_no_high_speed_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_no_high_speed_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_high_speed_priority(self):
    '''高速优先算路'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        logging.info("设置偏好")
        d(text="偏好").click()
        d(text="高速优先").click()
        time.sleep(3)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_high_speed_priority_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_high_speed_priority_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_avoid_congestion(self):
    '''躲避拥堵算路'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        logging.info("设置偏好")
        d(text="偏好").click()
        d(text="躲避拥堵").click()
        time.sleep(3)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_avoid_congestion_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_avoid_congestion_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_priority_time(self):
    '''时间优先算路'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        logging.info("设置偏好")
        d(text="偏好").click()
        d(text="时间优先").click()
        time.sleep(3)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_priority_time_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_priority_time_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_intelligent_recommendation(self):
    '''智能推荐算路'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        logging.info("设置偏好")
        d(text="偏好").click()
        d(text="智能推荐").click()
        time.sleep(3)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_intelligent_recommendation_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_intelligent_recommendation_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_selectionPage_detailsPage_information(self):
    '''路线选择页路线信息与路线详情页信息一致'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]').click()
        d(text="1.北京野生动物园").exists(timeout=3)
        d(resourceId="com.baidu.naviauto:id/ll_poi_back").click()
        d(resourceId="com.baidu.naviauto:id/ll_search_result_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_selectionPage_detailsPage_information_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_selectionPage_detailsPage_information_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_openClose_naviSound(self):
    '''开启/关闭导航声音'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击底图")
        d.click(1150, 640)
        logging.info("点击关闭导航声音")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_cp_voice_iv").click()
        time.sleep(3)
        # logging.info("抓取语音播报log")
        # os.popen(f'adb -s {deviceid} logcat -t 10000 threadtime  > /wjw/project-work/auto_framework/log/speech.txt')
        # logging.info("查找文件中的已关闭导航关键词")
        logging.info("点击底图")
        d.click(1150, 640)
        logging.info("点击开启导航声音")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_cp_voice_iv").click()
        time.sleep(2)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_openClose_naviSound_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_openClose_naviSound_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_route_preference(self):
    '''路线偏好(智能推荐/时间邮件/距离优先/躲避拥堵/不走高速/高速优先都可切换成功,且离线不能切换)'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        preference = ['智能推荐', '时间优先', '少收费', '躲避拥堵', '不走高速', '高速优先']
        for i in preference:
            logging.info("点击更多设置")
            d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
            logging.info("设置偏好")
            d(text="偏好").click()
            d(text=i).click()
            time.sleep(3)
        logging.info("关闭网络")
        os.popen('adb shell svc wifi disable')
        time.sleep(2)
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        logging.info("设置偏好")
        d(text="偏好").click()
        if d(text="智能推荐").exists(timeout=2):
            return False
        else:
            pass
        os.popen('adb shell svc wifi enable')
        time.sleep(5)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_route_preference_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_route_preference_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_incident_reporting(self):
    '''事件上报'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        incident_list = ["事故", "拥堵", "危险", "修路", "封路", "道路报错"]
        for incident in incident_list:
            logging.info("点击底图任意位置")
            d.click(1340, 770)
            time.sleep(1)
            logging.info("点击事件上报按键")
            d(resourceId="com.baidu.naviauto:id/bnav_rg_cp_iv_ugc_report").click()
            time.sleep(1)
            logging.info("点击事件")
            d(text=incident).click()
            time.sleep(1)
            logging.info("点击上报按键")
            d(resourceId="com.baidu.naviauto:id/navi_common_dialog_submit").click()
            d(text="感谢您的反馈!").exists(timeout=5)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_incident_reporting_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_incident_reporting_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_searchAlong_theWay(self):
    '''沿途搜'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        way_list = ["加油站", "充电站", "厕所", "银行ATM", "酒店住宿", "旅游景点"]
        for route_search in way_list:
            logging.info("点击更多设置")
            d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
            time.sleep(1)
            d(text="沿途搜").click()
            d(text=route_search).click()
            d(text="清空结果并继续导航").exists(timeout=5)
            d(text="清空结果并继续导航").click()
            time.sleep(1)
        logging.info("关闭网络")
        os.popen('adb shell svc wifi disable')
        time.sleep(2)
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="沿途搜").click()
        if d(text="加油站").exists(timeout=3):
            return False
        logging.info("打开网络")
        os.popen('adb shell svc wifi enable')
        time.sleep(2)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_searchAlong_theWay_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_searchAlong_theWay_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_global_mode_switch(self):
    '''全览模式切换'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        logging.info("点击全览小窗")
        d(text="全览小窗").click()
        if d(resourceId="com.baidu.naviauto:id/bnav_rg_cp_fullview_mode_btn").exists(timeout=3):
            pass
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        logging.info("点击路况条")
        d(text="路况条").click()
        if d(resourceId="com.baidu.naviauto:id/bnav_rg_cp_map_switch").exists(timeout=3):
            pass
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_global_mode_switch_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_global_mode_switch_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_page_display(self):
    '''导航语音页面显示'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        logging.info("点击导航语音")
        d(text="导航语音").click()
        logging.info("查看UI展示")
        if d(text="导航语音").exists(timeout=3):
            pass
        voicelist = ['普通话', '粤语导航语音', 'angel萌', '百度CEO 李彦宏', '萌萌哒']
        for i in voicelist:
            if d(text=i).exists(timeout=3):
                pass
        if d(resourceId="com.baidu.naviauto:id/btnBack").exists(timeout=3):
            pass
        logging.info("切换语音")
        if d(text="使用").exists(timeout=2):
            pass
        else:
            d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_voice"]/android.widget.LinearLayout[2]/'
                    'android.widget.RelativeLayout[1]/android.widget.ImageView[1]').click()
            d(text="使用").exists(timeout=10)
        d(text="普通话").click()
        d(text="取消").exists(timeout=5)
        d(text="粤语导航语音").long_click()
        d(text="确定").click()
        time.sleep(2)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        os.popen("adb shell input keyevent 4")
        d(text="退出导航").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_page_display_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_page_display_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_clickAgree_disclaimerPage(self):
    '''免责声明页点击同意'''
    try:
        logging.info("打开导航")
        d.app_start("com.baidu.naviauto")
        d(text="接受").click()
        logging.info("导航界面")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").exists(timeout=5)
        os.popen("adb shell input keyevent 4")
        d(text="退出导航").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_clickAgree_disclaimerPage_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_clickAgree_disclaimerPage_{time_now}.txt')
        print(e)
        return False
    return True

def test_clickNoAgree_disclaimerPage(self):
    '''免责声明页点击不同意'''
    try:
        logging.info("打开导航")
        d.app_start("com.baidu.naviauto")
        d(text="拒绝").click()
        logging.info("home界面")
        d(text="百度地图").exists(timeout=5)
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_clickNoAgree_disclaimerPage_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_clickNoAgree_disclaimerPage_{time_now}.txt')
        print(e)
        return False
    return True

def test_set_home_address(self):
    '''设置家地址'''
    try:
        logging.info("打开导航")
        d.app_start("com.baidu.naviauto")
        d(text="接受").click()
        logging.info("导航界面")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").exists(timeout=5)
        time.sleep(2)
        logging.info("语音唤醒指令")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 设置家地址')
        d(text="请说出您家的地址").exists(timeout=10)
        time.sleep(2)
        logging.info("语音输入:世界之窗")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 世界之窗')
        d(text="已设置成功,将为您发起导航").exists(timeout=10)
        time.sleep(2)
        d(resourceId="com.baidu.che.codriver:id/voice_shut_down_button").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_set_home_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_set_home_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True


def test_set_company_address(self):
    '''设置公司地址'''
    try:
        self.click_message_page()
        logging.info("语音唤醒指令")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 小度小度,设置公司地址')
        d(text="请说出您公司的地址").exists(timeout=10)
        logging.info("语音输入:百度大厦")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 百度大厦')
        d(text="已设置成功,将为您发起导航").exists(timeout=10)
        d(resourceId="com.baidu.che.codriver:id/voice_shut_down_button").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_set_home_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_set_home_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_switch_browse_mode(self):
    '''语音切换全览模式'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("语音唤醒指令")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 查看全程')
        time.sleep(5)
        # logging.info("检查语音已展示路线全览")
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switch_browse_mode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switch_browse_mode_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_input_keywords(self):
    '''输入关键字'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        logging.info("显示X按钮和搜索按钮")
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_delete").exists(timeout=3)
        d(text="搜索").exists(timeout=3)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_input_keywords_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_input_keywords_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_keyword_search(self):
    '''关键字搜索'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        time.sleep(2)
        d(text="输入目的地").send_keys("动物园")
        d(text="搜索").click()
        logging.info("进入POI列表页")
        d(resourceId="com.baidu.naviauto:id/btn_poi_gonavi").exists(timeout=8)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_keyword_search_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_keyword_search_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_click_sug_search(self):
    '''点击sug开始搜索'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        time.sleep(2)
        d(text="输入目的地").send_keys("北京野生动物园")
        logging.info("点击sug开始搜索")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_lion_search"]/'
                'android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
        d(resourceId="com.baidu.naviauto:id/lion_map_poi_panel_right_phone_layout").exists(timeout=5)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_click_sug_search_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_click_sug_search_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_passing_point_icon(self):
    '''搜索页点击添加途经点图标'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击添加途径点图标")
        d(resourceId="com.baidu.naviauto:id/ib_lion_search_add").click()
        logging.info("途径点页面")
        d(text="输入途经点").exists(timeout=3)
        d(text="输入目的地").exists(timeout=3)
        d(text="搜索").exists(timeout=3)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_passing_point_icon_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_passing_point_icon_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_routePoint_inputDestination(self):
    '''途径点点击输入目的地的输入框,进入目的地的输入页面'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击添加途径点图标")
        d(resourceId="com.baidu.naviauto:id/ib_lion_search_add").click()
        logging.info("途径点页面")
        d(text="输入目的地").click()
        d(text="更多").exists(timeout=3)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_routePoint_inputDestination_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_routePoint_inputDestination_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_team_management(self):
    '''队员队伍管理'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="组队出行").click()
        logging.info("创建队伍")
        d(text="创建队伍").click()
        d(text="我的队伍").exists(timeout=10)
        logging.info("点击右上角管理按钮")
        d(resourceId="com.baidu.naviauto:id/ib_team_manage").click()
        d(text="管理").exists(timeout=2)
        d(text="车队名称").exists(timeout=2)
        d(text="我的昵称").exists(timeout=2)
        d(resourceId="com.baidu.naviauto:id/tv_expire_time").exists(timeout=2)
        logging.info("解散队伍")
        d(text="解散队伍").click()
        d(text="确认").click()
        time.sleep(5)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_team_management_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_team_management_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_team_name_modification(self):
    '''队名修改'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="组队出行").click()
        logging.info("创建队伍")
        d(text="创建队伍").click()
        d(text="我的队伍").exists(timeout=10)
        logging.info("点击右上角管理按钮")
        d(resourceId="com.baidu.naviauto:id/ib_team_manage").click()
        d(resourceId="com.baidu.naviauto:id/custom_editable_operate").click()
        d(resourceId="com.baidu.naviauto:id/custom_editable_content").clear_text()
        d(resourceId="com.baidu.naviauto:id/custom_editable_content").send_keys("123")
        os.popen('adb shell input keyevent 4')
        time.sleep(5)
        logging.info("解散队伍")
        d(text="解散队伍").click()
        d(text="确认").click()
        time.sleep(5)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_team_name_modification_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_team_name_modification_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_favorites_set_company_address(self):
    '''设置公司地址'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击收藏夹")
        d(text="收藏夹").click()
        if not d(text="点击设置").exists(timeout=2):
            d(resourceId="com.baidu.naviauto:id/ib_right").click()
            d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/android.widget.LinearLayout[2]/'
                    'android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
            d.press("back")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/'
                'android.widget.LinearLayout[2]/android.widget.LinearLayout[1]').click()
        time.sleep(2)
        d(text="输入目的地").send_keys("北京欢乐谷")
        d(text="搜索").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/'
                'android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]').click()
        d(resourceId="com.baidu.naviauto:id/ib_right0").exists(timeout=5)
        time.sleep(2)
        logging.info("点击公司地址发起导航")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/'
                'android.widget.LinearLayout[2]/android.widget.LinearLayout[1]').click()
        d(text="添加途经点").exists(timeout=10)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_favorites_set_company_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_favorites_set_company_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_favorites_set_home_address(self):
    '''设置家地址'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击收藏夹")
        d(text="收藏夹").click()
        if not d(text="点击设置").exists(timeout=2):
            d(resourceId="com.baidu.naviauto:id/ib_right").click()
            d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/android.widget.LinearLayout[1]/'
                    'android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
            d.press("back")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/'
                'android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
        time.sleep(2)
        d(text="输入目的地").send_keys("天安门")
        d(text="搜索").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/'
                'android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]').click()
        d(resourceId="com.baidu.naviauto:id/ib_right0").exists(timeout=5)
        time.sleep(2)
        logging.info("点击家地址发起导航")
        time.sleep(5)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/'
                'android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
        d(text="添加途经点").exists(timeout=10)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_favorites_set_home_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_favorites_set_home_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_favorites_del_home_address(self):
    '''删除家地址'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击收藏夹")
        d(text="收藏夹").click()
        logging.info("点击编辑按键")
        d(resourceId="com.baidu.naviauto:id/ib_right").click()
        logging.info("点击删除")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/android.widget.LinearLayout[1]/'
                'android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
        time.sleep(2)
        d(text="完成").click()
        time.sleep(2)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_favorites_del_home_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_favorites_del_home_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_favorites_del_company_address(self):
    '''删除公司地址'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击收藏夹")
        d(text="收藏夹").click()
        logging.info("点击编辑按键")
        d(resourceId="com.baidu.naviauto:id/ib_right").click()
        logging.info("点击删除")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/android.widget.LinearLayout[2]/'
                'android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]').click()
        time.sleep(2)
        d(text="完成").click()
        time.sleep(2)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_favorites_del_company_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_favorites_del_company_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_del_favorites_address(self):
    '''删除收藏地址'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("点击收藏夹")
        d(text="收藏夹").click()
        logging.info("点击编辑按键")
        d(resourceId="com.baidu.naviauto:id/ib_right").click()
        logging.info("删除收藏地址")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_list_view"]/'
                'android.widget.LinearLayout[3]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(3)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_del_favorites_address_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_del_favorites_address_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report(self):
    '''泛需求-我要上报'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 我要上报')
        d(text="请选择一种类型进行上报,你需要选择第几个?").exists(timeout=5)
        time.sleep(2)
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第一个')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report5(self):
    '''泛需求-我要上报-施工多轮'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 我要上报')
        d(text="请选择一种类型进行上报,你需要选择第几个?").exists(timeout=5)
        time.sleep(2)
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第五个')
        time.sleep(2)
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第一个')
        # d(resourceId="com.baidu.che.codriver:id/voice_shut_down_button").click()
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report5_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report5_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report1(self):
    '''精准需求-单槽位-上报拥堵'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 上报拥堵')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report1_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report1_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report2(self):
    '''精准需求-单槽位-上报危险'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 上报危险')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report2_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report2_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report3(self):
    '''精准需求-单槽位-上报路上有障碍物'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 上报路上有障碍物')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report3_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report3_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report4(self):
    '''精准需求-单槽位-路上有积水'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 路上有积水')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report4_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report4_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report6(self):
    '''精准需求-单槽位-火灾上报'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 火灾上报')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report6_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report6_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report7(self):
    '''精准需求-单槽位-有车辆逆行'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 有车辆逆行')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report7_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report7_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report8(self):
    '''精准需求-单槽位-路上有人'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 路上有人')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report8_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report8_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report9(self):
    '''精准需求-单槽位-路上有动物'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 路上有动物')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report9_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report9_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report10(self):
    '''精准需求-单槽位-发现路上有东西'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 发现路上有东西')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report10_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report10_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report11(self):
    '''精准需求-单槽位-发现危险驾驶'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 发现危险驾驶')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report11_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report11_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report12(self):
    '''精准需求-单槽位-发现危险驾驶'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 上报事故')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report12_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report12_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report13(self):
    '''精准需求-单槽位-路上施工'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 路上施工')
        time.sleep(3)
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第一个')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report13_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report13_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report14(self):
    '''精准需求-单槽位-封路了'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 封路了')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report14_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report14_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report15(self):
    '''精准需求-多槽位-前方拥堵'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方拥堵')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report15_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report15_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report17(self):
    '''精准需求-多槽位-前方有危险'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有危险')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report17_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report17_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report18(self):
    '''精准需求-多槽位-前方有障碍物'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有障碍物')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report18_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report18_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report19(self):
    '''精准需求-多槽位-前方有积水'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有积水')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report19_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report19_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report20(self):
    '''精准需求-多槽位-前方有火灾'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有火灾')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report20_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report20_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report21(self):
    '''精准需求-多槽位-前方有车辆逆行'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有车辆逆行')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report21_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report21_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report22(self):
    '''精准需求-多槽位-前方路上有人'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方路上有人')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report22_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report22_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report23(self):
    '''精准需求-多槽位-前方路上有动物'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方路上有动物')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report23_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report23_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report24(self):
    '''精准需求-多槽位-前方有危险驾驶'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有危险驾驶')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report24_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report24_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report25(self):
    '''精准需求-多槽位-前方有事故'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方有事故')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report25_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report25_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report26(self):
    '''精准需求-多槽位-前方施工'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方施工')
        time.sleep(3)
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 第一个')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report26_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report26_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_i_want_report27(self):
    '''精准需求-多槽位-前方封路'''
    try:
        self.click_message_page()
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 前方封路')
        d(text="上报成功,感谢你的反馈,我们会尽快处理的").exists(timeout=5)
        time.sleep(10)
    except Exception as e:
        d.screenshot(f'test_i_want_report27_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_i_want_report27_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_delete_voice_package(self):
    '''删除语音包'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        logging.info("点击导航语音")
        d(text="导航语音").click()
        logging.info("下载多个语音包")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_voice"]/'
                'android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]').click()
        time.sleep(1)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_voice"]/'
                'android.widget.LinearLayout[5]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]').click()
        d(text="使用").exists(timeout=10)
        time.sleep(2)
        logging.info("删除正在下载中的语音包")
        d(text="萌萌哒").long_click()
        d(text="确定").click()
        time.sleep(2)
        d(text="普通话").click()
        d(text="取消").exists(timeout=5)
        d(text="粤语导航语音").long_click()
        d(text="确定").click()
        time.sleep(2)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_delete_voice_package_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_delete_voice_package_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_download_voice_package(self):
    '''正常网络下,各类都能正常下载完成,语音使用正常'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        logging.info("点击导航语音")
        d(text="导航语音").click()
        logging.info("下载所有语音包")
        d(text="粤语导航语音").click()
        d(text="使用")[0].exists(timeout=120)
        time.sleep(2)
        d(text="angel萌").click()
        d(text="使用")[1].exists(timeout=120)
        time.sleep(2)
        d(text="百度CEO 李彦宏").click()
        d(text="使用")[2].exists(timeout=120)
        time.sleep(2)
        d(text="萌萌哒").click()
        d(text="使用")[3].exists(timeout=120)
        time.sleep(2)
        logging.info("删除所有下载语音包")
        d(text="普通话").click()
        time.sleep(2)
        d(text="粤语导航语音").long_click()
        d(text="确定").click()
        time.sleep(2)
        d(text="angel萌").long_click()
        d(text="确定").click()
        time.sleep(2)
        d(text="百度CEO 李彦宏").long_click()
        d(text="确定").click()
        time.sleep(2)
        d(text="萌萌哒").long_click()
        d(text="确定").click()
        time.sleep(2)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_download_voice_package_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_download_voice_package_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_download_status_display(self):
    '''下载语音下载状态显示'''
    try:
        self.click_message_page()
        logging.info("点击个人设置")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="导航设置").click()
        logging.info("点击导航语音")
        d(text="导航语音").click()
        logging.info("下载语音包")
        d(text="萌萌哒").click()
        logging.info("下载进度条")
        d(resourceId="com.baidu.naviauto:id/voice_pb").exists(timeout=3)
        logging.info("删除语音包")
        d(text="萌萌哒").long_click()
        d(text="确定").click()
        time.sleep(2)
        d.press("back")
        time.sleep(1)
        d.press("back")
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_download_status_display_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_download_status_display_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_preference_message_notification(self):
    '''导航中设置为不同的偏好,出现消息通知'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        preference = ['智能推荐', '时间优先', '少收费', '躲避拥堵', '不走高速', '高速优先']
        for i in preference:
            logging.info("点击更多设置")
            d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
            logging.info("设置偏好")
            d(text="偏好").click()
            d(text=i).click()
            d(text="更改路线偏好,计算路线中").wait_gone(timeout=5)
            logging.info("3S后toast消失")
            if d(resourceId="com.baidu.naviauto:id/bnav_rg_common_notification_layout").wait_gone(timeout=3):
                return False
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_preference_message_notification_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_preference_message_notification_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_searchAlongTheWay_gasStation(self):
    '''沿途搜加油站'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(text="输入目的地").send_keys("北京野生动物园")
        d(text="搜索").click()
        d(text="1. 北京野生动物园").exists(timeout=3)
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/lv_search_result"]/android.widget.RelativeLayout[1]/'
                'android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]').click()
        time.sleep(2)
        d.click(220, 900)
        d(text="开始导航").exists(timeout=3)
        d(text="开始导航").click()
        if d(text="沿途搜加油站").exists(timeout=3):
            d(resourceId="com.baidu.naviauto:id/img_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="沿途搜").click()
        d(text="加油站").click()
        logging.info("点击中国石油")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[1]/android.widget.FrameLayout[1]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        # d(text="清空结果并继续导航").exists(timeout=5)
        logging.info("点击中国石化")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[2]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        d(text="清空结果并继续导航").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_searchAlongTheWay_gasStation_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_searchAlongTheWay_gasStation_{time_now}.txt')
        print(e)
        return False
    return True

def test_searchAlongTheWay_atm(self):
    '''沿途搜银行ATM'''
    try:
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="沿途搜").click()
        d(text="银行ATM").click()
        logging.info("点击工商银行")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[1]/android.widget.FrameLayout[1]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        # d(text="清空结果并继续导航").exists(timeout=5)
        logging.info("点击建设银行")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[2]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        logging.info("点击农业银行")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[3]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        logging.info("点击中国银行")
        d(resourceId="com.baidu.naviauto:id/route_search_end_arrow").click()
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[3]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        d(resourceId="com.baidu.naviauto:id/route_search_start_arrow").click()
        d(text="清空结果并继续导航").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_searchAlongTheWay_atm_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_searchAlongTheWay_atm_{time_now}.txt')
        print(e)
        return False
    return True

def test_searchAlongTheWay_chargingStation(self):
    '''沿途搜充电站'''
    try:
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="沿途搜").click()
        d(text="充电站").click()
        logging.info("点击国家电网")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[1]/android.widget.FrameLayout[1]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        # d(text="清空结果并继续导航").exists(timeout=5)
        logging.info("点击特来电")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/route_search_filter_brands_recycler_view"]/'
                'android.widget.LinearLayout[2]/android.widget.FrameLayout[1]').click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        d(text="清空结果并继续导航").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_searchAlongTheWay_chargingStation_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_searchAlongTheWay_chargingStation_{time_now}.txt')
        print(e)
        return False
    return True

def test_searchAlongTheWay_frontBackSwitch(self):
    '''搜索完成全览路线时,前后台切换,底图不变化'''
    try:
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="沿途搜").click()
        d(text="厕所").click()
        d(text="沿途搜索中...").wait_gone(timeout=3)
        logging.info("点击home键")
        d.press("Home")
        time.sleep(2)
        logging.info("点击地图")
        d.app_start("com.baidu.naviauto")
        d(text="清空结果并继续导航").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_searchAlongTheWay_frontBackSwitch_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_searchAlongTheWay_frontBackSwitch_{time_now}.txt')
        print(e)
        return False
    return True

def test_auto_day_nightMode(self):
    '''自动模式/白天模式/黑夜模式'''
    try:
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="更多").click()
        logging.info("切换夜间模式")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/navi_night_mode_rb"]').click()
        d(resourceId="com.baidu.naviauto:id/navi_common_dialog_title_bar_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="更多").click()
        logging.info("切换日间模式")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/navi_day_mode_rb"]').click()
        d(resourceId="com.baidu.naviauto:id/navi_common_dialog_title_bar_close").click()
        logging.info("点击更多设置")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_open_close_ly").click()
        time.sleep(1)
        d(text="更多").click()
        logging.info("切换自动模式")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/navi_night_mode_auto_rb"]').click()
        d(resourceId="com.baidu.naviauto:id/navi_common_dialog_title_bar_close").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_auto_day_nightMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_auto_day_nightMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_voic_avoidCongestion(self):
    '''导航中设置路线偏好为躲避拥堵'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 躲避拥堵')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_voic_avoidCongestion_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_voic_avoidCongestion_{time_now}.txt')
        print(e)
        return False
    return True

def test_voic_noHighSpeedRoute(self):
    '''导航中设置路线偏好为不走高速路线'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 不走高速路线')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_voic_noHighSpeedRoute_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_voic_noHighSpeedRoute_{time_now}.txt')
        print(e)
        return False
    return True

def test_voic_chargeLess(self):
    '''导航中设置路线偏好为少收费'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 少收费')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_voic_chargeLess_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_voic_chargeLess_{time_now}.txt')
        print(e)
        return False
    return True

def test_voic_highSpeedPriority(self):
    '''导航中设置路线偏好为高速优先路线'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 高速优先路线')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_voic_highSpeedPriority_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_voic_highSpeedPriority_{time_now}.txt')
        print(e)
        return False
    return True

def test_openRoad(self):
    '''打开路况'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 打开路况')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_openRoad_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_openRoad_{time_now}.txt')
        print(e)
        return False
    return True

def test_closeRoad(self):
    '''关闭路况'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 关闭路况')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_closeRoad_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_closeRoad_{time_now}.txt')
        print(e)
        return False
    return True

def test_switchFollowMode(self):
    '''切换跟随模式'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 车头朝上')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switchFollowMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switchFollowMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_switchDueNorthMode(self):
    '''切换正北模式'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 正北朝上')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switchDueNorthMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switchDueNorthMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_switch2DMode(self):
    '''切换2D模式'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 2D视图')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switch2DMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switch2DMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_switch3DMode(self):
    '''切换3D模式'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 3D视图')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switch3DMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switch3DMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_switchDayMode(self):
    '''切换白天模式'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 白天模式')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switchDayMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switchDayMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_switchNightMode(self):
    '''切换黑夜模式'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 黑夜模式')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_switchNightMode_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_switchNightMode_{time_now}.txt')
        print(e)
        return False
    return True

def test_zoomInMap(self):
    '''放大地图'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 放大地图')
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_zoomInMap_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_zoomInMap_{time_now}.txt')
        print(e)
        return False
    return True

def test_zoomOutMap(self):
    '''缩小地图'''
    try:
        logging.info("语音唤醒")
        os.popen('adb shell am broadcast -a duerosrun -n '
                 'com.baidu.che.codriver/com.baidu.che.codriver.debug.QueryReceiver --es enQuery 缩小地图')
        time.sleep(2)
        logging.info("退出导航")
        d(resourceId="com.baidu.naviauto:id/bnav_rg_toolbox_quit_ly").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_zoomOutMap_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_zoomOutMap_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True


def test_HomeUIDisplay(self):
    '''首页UI展示'''
    try:
        self.click_message_page()
        logging.info("搜索栏中显示返回按钮和文案『输入目的地』")
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").exists(timeout=2)
        d(text="输入目的地").exists(timeout=2)
        logging.info("搜索栏右侧显示登录账号图标")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").exists(timeout=2)
        logging.info("右侧竖排依次展示路况图标、定位图标、放大+缩小图标,缩小图标左侧显示比例尺")
        d(resourceId="com.baidu.naviauto:id/its_btn").exists(timeout=2)
        d(resourceId="com.baidu.naviauto:id/location_btn").exists(timeout=2)
        d(resourceId="com.baidu.naviauto:id/zoomin_btn").exists(timeout=2)
        d(resourceId="com.baidu.naviauto:id/zoomout_btn").exists(timeout=2)
        d(resourceId="com.baidu.naviauto:id/scale_indicator").exists(timeout=2)
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_HomeUIDisplay_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_HomeUIDisplay_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_morePanels_UIDisplay(self):
    '''首页展开更多面板,UI展示'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        logging.info("搜索框右侧的图标变为收起图标")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").exists(timeout=2)
        logging.info("面板上依次展示 收藏夹、离线地图数据、组队出行、微信互联、导航设置、关于我们,可上下滑动")
        iteamlist = ["收藏夹", "离线地图数据", "组队出行", "微信互联", "导航设置", "关于我们"]
        for iteam in iteamlist:
            if d(text=iteam).exists(timeout=2):
                pass
            else:
                return False
            d(scrollable=True).scroll(steps=10)
        logging.info("返回导航主界面")
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_morePanels_UIDisplay_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_morePanels_UIDisplay_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_packUp_morePanels(self):
    '''收起更多面板'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="离线地图数据").exists(timeout=2)
        logging.info("收起更多面板")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        if not d(text="离线地图数据").exists(timeout=2):
            pass
        else:
            return False
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_packUp_morePanels_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_packUp_morePanels_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_morePanels_clickSearch(self):
    '''展开更多面板时点击搜索框'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(text="离线地图数据").exists(timeout=2)
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        logging.info("添加途径点icon")
        if d(resourceId="com.baidu.naviauto:id/ib_lion_search_add").exists(timeout=2):
            pass
        else:
            return False
        logging.info("返回导航界面")
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_morePanels_clickSearch_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_morePanels_clickSearch_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_favorites_page(self):
    '''点击收藏夹入口进入收藏夹页面'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        d(scrollable=True).scroll.vert.backward()
        d(text="收藏夹").click()
        logging.info("进入收藏夹页面(展示家和公司)")
        if d(text="家").exists(timeout=2):
            pass
        else:
            return False
        if d(text="公司").exists(timeout=2):
            pass
        else:
            return False
        logging.info("返回导航界面")
        d(resourceId="com.baidu.naviauto:id/iv_left").click()
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_favorites_page_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_favorites_page_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_search_record_display(self):
    '''历史搜索记录展示'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(scrollable=True).scroll.toEnd()
        logging.info("尾部展示『清空历史记录』按钮")
        if d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_lion_search"]/'
                   'android.widget.FrameLayout[4]').wait(timeout=2):
            pass
        else:
            return False
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_search_record_display_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_search_record_display_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_click_clearHistory(self):
    '''点击『清空历史记录』按钮,弹出确认dialog'''
    try:
        self.click_message_page()
        logging.info("点击搜索框")
        d(text="输入目的地").click()
        d(scrollable=True).scroll.toEnd()
        logging.info("点击『清空历史记录』按钮")
        d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_lion_search"]/'
                   'android.widget.FrameLayout[4]').click()
        time.sleep(1)
        logging.info("点击确定")
        d(text="确定").click()
        time.sleep(1)
        if d.xpath('//*[@resource-id="com.baidu.naviauto:id/listview_lion_search"]/'
                   'android.widget.FrameLayout[4]').wait(timeout=2):
            return False
        else:
            pass
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_click_clearHistory_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_click_clearHistory_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_clear_cache_page_display(self):
    '''查看清除缓存页面显示'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        logging.info("点击导航设置")
        d(text="导航设置").click()
        d(scrollable=True).scroll.toEnd()
        logging.info("查看缓存")
        if not d(text="0KB").exists(timeout=2):
            pass
        else:
            return False
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_clear_cache_page_display_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_clear_cache_page_display_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_clear_cache(self):
    '''清除缓存点击确认和取消按钮'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        logging.info("点击导航设置")
        d(text="导航设置").click()
        d(scrollable=True).scroll.toEnd()
        logging.info("点击清除缓存")
        d(text="清除缓存").click()
        logging.info("点击取消")
        d(text="取消").click()
        time.sleep(1)
        logging.info("点击清除缓存")
        d(text="清除缓存").click()
        logging.info('点击确定')
        d(text="确定").click()
        if d(text="0KB").exists(timeout=2):
            pass
        else:
            return False
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_clear_cache_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_clear_cache_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_clear_cache_field_display(self):
    '''有缓存的情况下点击当前缓存字段热区'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        logging.info("点击导航设置")
        d(text="导航设置").click()
        d(scrollable=True).scroll.toEnd()
        logging.info("点击清除缓存")
        d(text="清除缓存").click()
        logging.info("当前缓存字段热区显示")
        d(text="确认要清除缓存吗?").exists(timeout=2)
        d(text="取消").exists(timeout=2)
        d(text="确定").exists(timeout=2)
        logging.info('点击确定')
        d(text="确定").click()
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_clear_cache_field_display_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_clear_cache_field_display_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_cacheDataIs0_click_clear_cache(self):
    '''当前缓存数据为0点击清除缓存按钮'''
    try:
        self.click_message_page()
        logging.info("点击个人账号")
        d(resourceId="com.baidu.naviauto:id/ll_menu_check_box").click()
        logging.info("点击导航设置")
        d(text="导航设置").click()
        d(scrollable=True).scroll.toEnd()
        logging.info("点击清除缓存")
        for i in range(2):
            d(text="清除缓存").click()
            logging.info('点击确定')
            d(text="确定").click()
            if d(text="0KB").exists(timeout=2):
                pass
            else:
                return False
        d(resourceId="com.baidu.naviauto:id/btnBack").click()
        time.sleep(1)
        d(resourceId="com.baidu.naviauto:id/relative_lion_search_back").click()
        time.sleep(5)
    except Exception as e:
        d.screenshot(f'test_cacheDataIs0_click_clear_cache_{time_now}.png')
        os.popen(f'adb logcat -v -t threadtime 10000> test_cacheDataIs0_click_clear_cache_{time_now}.txt')
        print(e)
        return False
    finally:
        d.app_stop("com.baidu.naviauto")
    return True

def test_01(self):
    """启动地图
    通过包名判断首页元素是否启动成功
    """
    print("1111")
    basemap.enter_map()
    Judge.passIf(self, UIChecker.checkByText("输入目的地"), "进入地图")

def test_02(self):
    print("2222")
    """勾选不在提醒选项
    通过再次进入地图判断是否有弹窗
    """
    basemap.enter_map()
    # Action.adb_cmd("adb shell input keyevent 4")
    # Action.clickByText(u"退出导航")
    Action.adb_cmd("adb shell am start -n com.baidu.naviauto/.NaviAutoActivity")
    sleep(2)
    Judge.passUnless(self,
                     UIChecker.checkByText("免责声明"), "进入免责声明"
                     )

def test_03(self):
    """进入事故上报界面
    """
    print("3333")
    basemap.enter_map()
    basemap.enter_ugc()
    Action.clickByText("事故")
    Judge.passIf(self, UIChecker.checkByTextWait("严重事故"), "进入事故上报界面")
    Action.clickByResourceId(BaiduMap.UGC_Close_id)

def test_04(self):
    """进入拥堵上报界面
    """
    print("44444")
    basemap.enter_map()
    basemap.enter_ugc()
    sleep(2)
    Action.clickByText("拥堵")
    Judge.passIf(self, UIChecker.checkByTextWait("轻微拥堵"), "进入拥堵上报界面")
    Action.clickByResourceId(BaiduMap.UGC_Close_id)

def test_05(self):
    print("5555")
    """进入危险上报界面
    """
    basemap.enter_map()
    basemap.enter_ugc()
    Action.clickByText("危险")
    Judge.passIf(self, UIChecker.checkByTextWait("积水"), "进入危险上报界面")
    Action.clickByResourceId(BaiduMap.UGC_Close_id)

def test_06(self):
    """进入修路上报界面
    """
    print("6666")
    basemap.enter_map()
    basemap.enter_ugc()
    Action.clickByText("修路")
    Judge.passIf(self, UIChecker.checkByTextWait("可以通行"), "进入修路上报界面")
    Action.clickByResourceId(BaiduMap.UGC_Close_id)

def test_07(self):
    """进入封路上报界面
    """
    basemap.enter_map()
    basemap.enter_ugc()
    Action.clickByText("封路")
    Judge.passIf(self, UIChecker.checkByTextWait("临时封路"), "进入封路上报界面")
    Action.clickByResourceId(BaiduMap.UGC_Close_id)

def test_08(self):
    """进入道路报错上报界面
    """
    basemap.enter_map()
    basemap.enter_ugc()
    Action.clickByText("道路报错")
    Judge.passIf(self, UIChecker.checkByTextWait("道路不存在"), "进入道路报错上报界面")
    Action.clickByResourceId(BaiduMap.UGC_Close_id)

def test_09(self):
    """进入更多设置界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    self.assertTrue(Judge.passIf(self, UIChecker.checkByTextWait("收藏夹"), "进入更多设置界面"))

def test_10(self):
    """进入收藏夹
    """
    basemap.enter_map()
    basemap.enter_settings()
    Action.clickByText("收藏夹")
    sleep(5)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Setting_refresh_id), "进入收藏夹")

def test_11(self):
    """点击收藏夹编辑按钮
    """
    basemap.enter_map()
    basemap.enter_settings()
    Action.clickByText("收藏夹")
    sleep(8)
    Action.clickByResourceId(BaiduMap.Collection_edit_id)
    Action.clickByResourceId(BaiduMap.Succees_edit_id)
    # Judge.passIf(self, UIChecker.checkByTextWait("完成"), "点击收藏夹编辑按钮")

    # Action.clickByText("完成")

def test_12(self):
    """进入离线地图数据界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextWait("零流量更新"), "进入离线地图界面")

def test_13(self):
    """进入零流量更新界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("零流量更新")
    Judge.passIf(self, UIChecker.checkByTextWait("U盘更新"), "进入零流量更新界面")
    '''

‘’’

def test_14(self):
    """进入U盘更新界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("零流量更新")
    Action.clickByText("U盘更新")
    Judge.passIf(self, UIChecker.checkByTextWait("未发现U盘"), "进入零流量更新界面")

# def test_15(self):
#     """进入手机更新界面
#     """
#     basemap.enter_map()
#     basemap.enter_settings()
#     basemap.enter_0fflinedata()
#     Action.clickByText("零流量更新")
#     Action.clickByText("手机更新")
#     Judge.passIf(self, UIChecker.checkByTextContains("打开手机热点"), "进入手机更新界面")

@unittest.skip("test")
def test_16(self):
    """进入Wi-Fi界面再返回
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("零流量更新")
    Action.clickByText("手机更新")
    Action.clickByText("网络设置 >")
    Judge.passIf(self, UIChecker.checkByTextWait("Wi-Fi"), "进入Wi-Fi界面")
    Action.adb_cmd("adb shell input keyevent 4")
    sleep(2)

def test_17(self):
    """进入离线地图界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("离线地图")
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextWait("热门城市"), "进入离线地图界面")

def test_18(self):
    """进入热门城市并返回
    """
    basemap.enter_map()
    basemap.enter_settings()
    sleep(2)
    basemap.enter_0fflinedata()
    Action.clickByText("离线地图")
    Action.clickByText("热门城市")
    Judge.passIf(self, UIChecker.checkByTextWait("北京市"), "进入热门城市")
    Action.adb_cmd("adb shell input keyevent 4")
    Judge.passIf(self, UIChecker.checkByTextWait("离线地图"), "返回离线地图界面")

def test_19(self):
    """进入城市搜索,并搜索
    """
    basemap.enter_map()
    sleep(2)
    basemap.enter_settings()
    sleep(2)
    basemap.enter_0fflinedata()
    Action.clickByText("离线地图")
    Action.clickByResourceId(BaiduMap.Offline_search_id)
    input = "请输入城市名或首字母"
    Judge.passIf(self, UIChecker.checkByTextWait(input), "进入城市搜索界面")
    Action.clickByText(input)
    Action.setTextByResourceId(BaiduMap.Offline_input_id, "haer")
    Judge.passIf(self, UIChecker.checkByText("哈尔滨市"), "搜索哈尔滨")

def test_20(self):
    """进入下载管理界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("离线地图")
    Action.clickByResourceId(BaiduMap.Offline_setting_id)
    Judge.passIf(self, UIChecker.checkByText("全部更新"), "进入下载管理界面")

def test_21(self):
    """滑动查找浙江省并点击
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("离线地图")
    sleep(2)
    Action.clickByScrollText("浙江省")
    Judge.passIf(self, UIChecker.checkByText("杭州市"), "滑动查找浙江省并点击")
    Action.clickByResourceId(BaiduMap.Offline_download_id)

def test_22(self):
    """点击回家按钮,进行导航
    """
    basemap.enter_map()
    input = "输入目的地"
    Action.clickByText(input)
    Action.clickByText("回家")

    # 没有设置公司地址,输入关键词,选择第一个结果设为家地址
    # if UIChecker.checkByTextWait(input):
    #     sleep(1)
    #     Action.setTextByResourceId(BaiduMap.Input_via_id, "世界之窗")
    #     sleep(5)
    #     Action.clickByResourceId(BaiduMap.Search_jc_id)
    #     sleep(3)
    #     Judge.passIf(self, UIChecker.checkByTextWait("回家"), "设置家地址")
    #     Action.clickByText("回家")
    sleep(6)
    # Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Start_navigation), "跳转到路线规划界面")
    # Action.clickByResourceId(BaiduMap.Start_navigation)
    # Judge.passIf(self, UIChecker.checkByText('同意'), "百度地图导航使用提示页面")
    Action.clickByText('同意')
    sleep(3)
    # basemap.click_agree_buttom()
    basemap.close_navi()

def test_23(self):
    """点击更多-停车场,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("停车场")
    sleep(2)
    # 点击退出导航按钮
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_24(self):
    """点击更多-加油站,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("加油站")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_25(self):
    """点击更多-4S店,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("4S店")

    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_26(self):
    """点击更多-洗车,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("洗车")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_27(self):
    """点击更多-卫生间,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("卫生间")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_28(self):
    """点击更多-中餐,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("中餐")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_29(self):
    """点击更多-西餐,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("西餐")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_30(self):
    """点击更多-小吃,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("小吃")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_31(self):
    """点击更多-机场,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("机场")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_32(self):
    """点击更多-火车站,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("火车站")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_33(self):
    """点击更多-服务区,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("服务区")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_34(self):
    """点击更多-风景区,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("风景区")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_35(self):
    """点击更多-度假村,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("度假村")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_36(self):
    """点击更多-公园,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("公园")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_37(self):
    """点击更多-星级酒店,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("星级酒店")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_38(self):
    """点击更多-快捷酒店,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("快捷酒店")
    sleep(2)
    if UIChecker.checkByTextWait("发送"):
        Action.clickByText("发送")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

@unittest.skip("test")
def test_39(self):
    """点击更多-旅馆,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("旅馆")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_40(self):
    """点击更多-银行,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("银行")
    sleep(2)
    if UIChecker.checkByTextWait("发送"):
        Action.clickByText("发送")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_41(self):
    """点击更多-医院,进行导航
    """
    basemap.enter_map()
    basemap.enter_morepage("医院")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_42(self):
    """开启路况
    """
    basemap.enter_navi()
    Action.swipeLeftAtCenter()
    # 判断路况控件是否可点击
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextWait("继续当前导航"), "进入操作态")
    # 点击开启路况
    Action.clickByResourceId(BaiduMap.Traffic_panel_id)
    # 数据网络下会弹框提示
    if UIChecker.checkByTextWait("提示"):
        Action.clickByText("我知道了")
    config.logger.info("实时路况已打开")

def test_43(self):
    """关闭导航声音
    """
    basemap.enter_navi()
    Action.swipeLeftAtCenter()
    # 判断是否进入操作态
    Action.waiting(2)
    Judge.passIf(self, UIChecker.checkByTextWait("继续当前导航"), "进入操作态")
    # 点击关闭导航声音
    Action.clickByResourceId(BaiduMap.Traffic_voice_id)
    Judge.passIf(self, UIChecker.checkByTextWait("已关闭“导航声音”"), "关闭导航声音")

def test_44(self):
    """开启导航声音
    在导航时拖动地图
    """
    basemap.enter_navi()
    Action.swipeLeftAtCenter()
    # 判断是否进入操作态
    Action.waiting(1)
    Judge.passIf(self, UIChecker.checkByTextWait("继续当前导航"), "进入操作态")
    # 点击关闭导航声音
    Action.clickByResourceId(BaiduMap.Traffic_voice_id)
    Judge.passIf(self, UIChecker.checkByTextWait("已关闭“导航声音”"), "关闭导航声音")
    Action.swipeLeftAtCenter()
    Action.waiting(1)
    # 点击开启导航声音
    Action.clickByResourceId(BaiduMap.Traffic_voice_id)
    Judge.passIf(self, UIChecker.checkByTextWait("已开启“导航声音”"), "开启导航声音")

def test_45(self):
    """点击刷新路线按钮
    """
    basemap.enter_navi()
    Action.swipeLeftAtCenter()
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextWait("继续当前导航"), "进入操作态")
    Action.clickByResourceId(BaiduMap.Traffic_refresh_id)
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextContains("优路线"), "点击刷新路线")
    if UIChecker.checkByText("当前已是最优路线"):
        Action.clickByText("继续当前导航")

def test_46(self):
    """查看导航设置
    进入导航设置,收起导航设置
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Judge.passIf(self, UIChecker.checkByTextWait("更多"), "进入导航设置界面")
    Action.clickByResourceId(BaiduMap.More_btn_id)
    config.logger.info("收起导航设置界面,pass")

def test_47(self):
    """切换为路况条
    进入导航设置,切换成路况条
    """
    basemap.enter_navi()
    # 进入导航设置
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("全览小窗")
    if UIChecker.checkByText("GPS信号弱,请谨慎驾驶"):
        Action.waiting(3)
    else:
        Judge.passIf(self, UIChecker.checkByTextWait("已切换为“路况条”"), "切换导航小窗为路况条")

def test_48(self):
    """切换全览小窗
    进入导航设置,切换成路况条,再切换成全览小窗
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("全览小窗")
    if UIChecker.checkByText("GPS信号弱,请谨慎驾驶"):
        Action.waiting(3)
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("路况条")
    Judge.passIf(self, UIChecker.checkByTextWait("已切换为“全览小窗”"), "切换路况条为全览小窗")

def test_49(self):
    """切换为2D模式
    进入导航设置,切换成2D模式
    """
    basemap.enter_navi()
    sleep(2)
    Action.clickByResourceId(BaiduMap.More_btn_id)
    # 点击车头朝上
    Action.clickByText("车头朝上")
    if UIChecker.checkByText("GPS信号弱,请谨慎驾驶"):
        Action.waiting(3)
    else:
        Judge.passIf(self, UIChecker.checkByTextWait("已切换导航视角为“正北朝上”"), "切换导航视角为正北朝上")

def test_50(self):
    """切换为3D模式
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    # 点击车头朝上
    Action.clickByText("车头朝上")
    if UIChecker.checkByText("GPS信号弱,请谨慎驾驶"):
        Action.waiting(3)
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("正北朝上")
    sleep(2)
    # Judge.passIf(self, UIChecker.checkByTextWait("已切换导航视角为“车头朝上”"), "切换导航视角为车头朝上")

def test_51(self):
    """点击限行按钮
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("限行")
    Action.waiting(2)
    Judge.passIf(self, UIChecker.checkByTextContains("车牌限行"), "点击限行按钮")
    # 点击界面关闭按钮
    if UIChecker.checkByResourceId(BaiduMap.Quit_common_id):
        Action.clickByResourceId(BaiduMap.Quit_common_id)

def test_52(self):
    """进入沿途搜界面
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("沿途搜")
    Action.waiting(1)
    Judge.passIf(self, UIChecker.checkByTextWait("厕所"), "进入沿途搜索界面")
    # 点击界面关闭按钮
    if UIChecker.checkByResourceId(BaiduMap.Quit_common_id):
        Action.clickByResourceId(BaiduMap.Quit_common_id)

def test_53(self):
    """沿途搜索加油站
    """
    basemap.enter_navi()
    basemap.enter_navi_search("加油站")
    Judge.passUnless(self, UIChecker.checkByResourceId(BaiduMap.Traffic_voice_id), "回到继续导航状态")

def test_54(self):
    """沿途搜充电站
    """
    basemap.enter_navi()
    basemap.enter_navi_search("充电站")
    Judge.passUnless(self, UIChecker.checkByResourceId(BaiduMap.Traffic_voice_id), "回到继续导航状态")

def test_55(self):
    """沿途搜厕所
    """
    basemap.enter_navi()
    basemap.enter_navi_search("厕所")
    Judge.passUnless(self, UIChecker.checkByResourceId(BaiduMap.Traffic_voice_id), "回到继续导航状态")

def test_56(self):
    """沿途搜银行ATM
    """
    basemap.enter_navi()
    basemap.enter_navi_search("银行")
    Judge.passUnless(self, UIChecker.checkByResourceId(BaiduMap.Traffic_voice_id), "回到继续导航状态")

def test_57(self):
    """沿途搜酒店住宿
    """
    basemap.enter_navi()
    basemap.enter_navi_search("酒店")
    Judge.passUnless(self, UIChecker.checkByResourceId(BaiduMap.Traffic_voice_id), "回到继续导航状态")

def test_58(self):
    """沿途搜旅游景点
    """
    basemap.enter_navi()
    basemap.enter_navi_search("景点")
    Judge.passUnless(self, UIChecker.checkByResourceId(BaiduMap.Traffic_voice_id), "回到继续导航状态")

def test_59(self):
    """进入路线偏好界面
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("偏好")
    Judge.passIf(self, UIChecker.checkByTextWait("路线偏好"), "进入路线偏好界面")
    if UIChecker.checkByResourceId(BaiduMap.Quit_common_id):
        Action.clickByResourceId(BaiduMap.Quit_common_id)

def test_60(self):
    """使用时间优先
    路线偏好设置为时间优先
    """
    basemap.enter_navi()
    basemap.navi_choice_routeplan("时间优先")
    Judge.passIf(self, UIChecker.checkByTextWait("已使用时间优先方案"), "切换路线偏好为时间优先")

def test_61(self):
    """使用少收费
    路线偏好设置为少收费
    """
    basemap.enter_navi()
    sleep(3)
    basemap.navi_choice_routeplan("少收费")
    Judge.passIf(self, UIChecker.checkByTextWait("已使用少收费方案"), "切换路线偏好为少收费")

def test_62(self):
    """使用躲避拥堵
    路线偏好设置为躲避拥堵
    """
    basemap.enter_navi()
    basemap.navi_choice_routeplan("躲避拥堵")
    Judge.passIf(self, UIChecker.checkByTextWait("已使用躲避拥堵方案"), "切换路线偏好为躲避拥堵")

def test_63(self):
    """使用不走高速
    路线偏好设置为不走高速
    """
    basemap.enter_navi()
    basemap.navi_choice_routeplan("不走高速")
    Judge.passIf(self, UIChecker.checkByTextWait("已使用不走高速方案"), "切换路线偏好为不走高速")

def test_64(self):
    """使用高速优先
    路线偏好设置为高速优先
    """
    basemap.enter_navi()
    basemap.navi_choice_routeplan("高速优先")
    Judge.passIf(self, UIChecker.checkByTextWait("已使用高速优先方案"), "切换路线偏好为高速优先")

def test_65(self):
    """使用智能推荐
    路线偏好设置为智能推荐
    """
    basemap.enter_navi()
    basemap.navi_choice_routeplan("高速优先")
    sleep(2)
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("偏好")
    Action.clickByText("智能推荐")
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextWait("已使用智能推荐方案"), "切换路线偏好为智能推荐")

def test_66(self):
    """点击行程分享
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("行程分享")
    Action.waiting(2)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Quit_common_id), "进入行程分享界面")

def test_67(self):
    """查看更多设置界面
    进入更多设置界面
    """
    basemap.enter_navi()
    Action.clickByResourceId(BaiduMap.More_btn_id)
    Action.clickByText("更多")
    Judge.passIf(self, UIChecker.checkByTextWait("更多设置"), "进入更多设置界面")

def test_68(self):
    """查看导航中事件上报界面
    进入事件上报界面
    """
    basemap.enter_navi()
    Action.swipeLeftAtCenter()
    # 判断是否进入操作态
    Judge.passIf(self, UIChecker.checkByTextWait("继续当前导航"), "进入操作态,fail")
    # 点击进入事件上报界面
    Action.clickByResourceId(BaiduMap.Traffic_report_id)
    Judge.passIf(self, UIChecker.checkByTextWait("事故"), "进入导航中事件上报界面")
    Action.clickByResourceId(BaiduMap.Traffic_report_id)

def test_69(self):
    """点击事故上报发送
    进入事故上报界面
    """
    basemap.enter_navi()
    basemap.enter_ugc_page("事故")
    Judge.passIf(self, UIChecker.checkByTextWait("追尾"), "进入事故界面")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "点击事故上报发布")

def test_70(self):
    """点击拥堵上报发送
    进入拥堵上报界面
    """
    basemap.enter_navi()
    sleep(3)
    basemap.enter_ugc_page("拥堵")
    Judge.passIf(self, UIChecker.checkByTextWait("缓慢行驶"), "进入拥堵界面")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "点击拥堵上报发布")

def test_71(self):
    """点击危险上报发送
    进入危险上报界面
    """
    basemap.enter_navi()
    basemap.enter_ugc_page("危险")
    Judge.passIf(self, UIChecker.checkByTextWait("积水"), "进入危险界面")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "点击危险上报发布")

def test_72(self):
    """点击修路上报发送
    进入修路上报界面
    """
    basemap.enter_navi()
    basemap.enter_ugc_page("修路")
    Judge.passIf(self, UIChecker.checkByTextWait("可以通行"), "进入修路界面")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "点击修路上报发布")

def test_73(self):
    """点击封路上报发送
    进入封路上报界面
    """
    basemap.enter_navi()
    basemap.enter_ugc_page("封路")
    Judge.passIf(self, UIChecker.checkByTextWait("临时封路"), "进入封路界面")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "点击封路上报发布")

def test_74(self):
    """点击道路报错上报发送
    进入道路报错上报界面
    """
    basemap.enter_navi()
    sleep(3)
    basemap.enter_ugc_page("道路报错")
    Judge.passIf(self, UIChecker.checkByTextWait("道路不存在"), "进入修路界面")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "点击道路报错上报发布")

def test_75(self):
    """进入事故录音界面
    """
    basemap.enter_navi()
    basemap.enter_ugc_page("事故")
    Action.swipeDiretion(BaiduMap.UGC_swipe_id, 'up', 5)
    Action.clickByResourceId(BaiduMap.UGC_record_id)
    Judge.passIf(self, UIChecker.checkByText("详细描述"), "进入事故录音界面")

def test_76(self):
    """点击开始录音,再点击结束录音,发送
    """
    basemap.enter_navi()
    sleep(3)
    basemap.enter_ugc_page("事故")
    sleep(2)
    Action.swipeDiretion(BaiduMap.UGC_swipe_id, 'up', 5)
    Action.clickByResourceId(BaiduMap.UGC_record_id)
    Action.clickByResourceId(BaiduMap.UGC_speech_id)
    # Action.clickByResourceId(BaiduMap.sys_open_btn)
    # Action.clickByText("允许")
    Action.clickByResourceId(BaiduMap.UGC_speech_id)
    sleep(5)
    Judge.passIf(self, UIChecker.checkByResourceId("com.baidu.naviauto:id/ugc_record_page_status"), "点击开始录音")
    # Judge.passIf(self, UIChecker.checkByTextContains("剩余"), "点击开始录音")
    # Action.clickByResourceId(BaiduMap.UGC_speech_id)

    Judge.passIf(self, UIChecker.checkByTextContains("语音描述"), "点击结束录音")
    Action.clickByResourceId(BaiduMap.UGC_Send_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContainsWait("感谢您的反馈!"), "录音后发布")

# 备注:此条case需要调试
def test_77(self):
    """进入离线导航界面点击已下载
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("离线导航")
    Judge.passIf(self, UIChecker.checkByText("已下载"), "进入离线导航界面")
    if UIChecker.checkByText("已下载"):
        Action.clickByText("已下载")
        """获取不到麦克权限"""

@unittest.skip("error")
def test_78(self):
    """滑动查找澳门
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_0fflinedata()
    Action.clickByText("离线导航")
    sleep(1)
    try:
        Action.clickByScrollText("澳门")
        if UIChecker.checkByText("取消"):
            Action.clickByText("取消")
    except:
        if UIChecker.checkByText("已下载"):
            Action.clickByText("已下载")
    finally:
        Judge.passIf(self, UIChecker.checkByTextContains("澳门"), "滑动查找澳门")

def test_79(self):
    """进入组队出行,如有队伍,解散队伍
    """
    basemap.enter_map()
    sleep(2)
    basemap.enter_settings()
    sleep(3)
    basemap.enter_teamtrip_page()
    Action.clickByText("取消")
    Judge.passIf(self, UIChecker.checkByText("组队出行"), "进入组队出行")

def test_80(self):
    """进入加入队伍界面
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        sleep(2)
        Action.clickByText("加入队伍")
        sleep(2)
        Action.setTextByResourceId(BaiduMap.Team_join_id, 111)
        for i in range(6):
            Action.clickByResourceId(BaiduMap.Team_keboard_id)
        Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Team_join_id), "进入加入队伍界面")

def test_81(self):
    """进入组队出行,创建队伍
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    sleep(2)
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        sleep(2)
        Action.clickByText("创建队伍")
    sleep(5)
    Judge.passIf(self, UIChecker.checkByText("我的队伍"), "进入组队出行")

def test_82(self):
    """进入组队出行,操作后点击邀请好友
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    sleep(2)
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        Action.clickByText("创建队伍")
    sleep(5)
    for i in range(5):
        Action.clickByResourceId(BaiduMap.Zoom_out_id)
    Action.clickByResourceId(BaiduMap.Team_show_id)
    Action.clickByText("邀请好友")
    Judge.passIf(self, UIChecker.checkByTextContains("您的队伍口令为"), "点击邀请好友")

def test_83(self):
    """进入组队出行,修改队伍名称
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    sleep(2)
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        Action.clickByText("创建队伍")
    sleep(5)
    Action.clickByResourceId(BaiduMap.Team_setting_id)
    Action.clickByResourceId(BaiduMap.Team_edit_id)
    # Action.setTextByResourceId(BaiduMap.Team_input_id, 'T2@i?')
    # Action.adb_cmd("adb shell input keyevent 4")
    # sleep(1)
    # Judge.passIf(self, UIChecker.checkByTextContains("T2@i?"), "修改队伍名称")

# def test_120(self):
#
#     os.popen("adb reboot").readline()
#     sleep(100)

def test_84(self):
    """进入导航设置的导航语音界面
    """
    basemap.enter_map()
    # Action.backToPre()
    basemap.enter_settings()
    sleep(2)
    basemap.enter_navi_settings()
    sleep(2)
    Action.clickByText("导航语音")
    sleep(2)
    if UIChecker.checkByTextContains("网络未连接"):
        pass
    else:
        Judge.passIf(self, UIChecker.checkByTextContains("普通话"), "进入导航语音界面")

def test_85(self):
    """进入导航语音,点击angel萌语音
    """
    basemap.enter_map()
    sleep(2)
    basemap.enter_settings()
    sleep(2)
    basemap.enter_navi_settings()
    Action.clickByText("导航语音")
    sleep(2)
    Action.clickByText("angel萌")
    sleep(3)
    if UIChecker.checkByText("确定"):
        Action.clickByText("确定")
    Judge.passIf(self, UIChecker.checkByTextContains("使用中"), "点击angel萌语音")

def test_86(self):
    """进入导航设置,清除缓存
    """
    basemap.enter_map()
    sleep(2)
    basemap.enter_settings()
    sleep(2)
    basemap.enter_navi_settings()
    Action.clickByScrollText("清除缓存")
    if UIChecker.checkByText("确认要清除缓存吗?"):
        Action.clickByText("确定")
    Judge.passIf(self, UIChecker.checkByTextContainsWait("0KB"), "清除缓存")

# def test_87(self):
#     """进入导航设置,修改爱车名称
#     """
#     basemap.enter_map()
#     basemap.enter_settings()
#     basemap.enter_navi_settings()
#     Action.clickByScrollText("爱车名称")
#     Action.clearTextByResourceId(BaiduMap.Edit_carname_id)
#     Action.setTextByResourceId(BaiduMap.Edit_carname_id, "@My_Car_01~")
#     sleep(1)
#     Action.clickByText("保存")
#     Judge.passIf(self, UIChecker.checkByTextContains("@My_Car_01~"), "修改爱车名称")

# def test_88(self):
#     """进入导航设置,删除爱车名称并保存
#     """
#     basemap.enter_map()
#     basemap.enter_settings()
#     basemap.enter_navi_settings()
#     Action.clickByScrollText("爱车名称")
#     Action.clearTextByResourceId(BaiduMap.Edit_carname_id)
#     sleep(1)
#     Action.clickByText("保存")
#     Judge.passIf(self, UIChecker.checkByTextContains("我的汽车"), "删除爱车名称并保存")

def test_89(self):
    """进入导航设置,设置经典车标
    """
    basemap.enter_map()
    sleep(2)
    basemap.enter_settings()
    sleep(2)
    basemap.enter_navi_settings()
    sleep(2)
    Action.clickByScrollText("设置车标")
    Action.clickByText("经典车标")
    Action.adb_cmd("adb shell input keyevent 4")
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContains("经典"), "设置经典车标")

def test_90(self):
    """进入导航设置,设置林肯车标
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByScrollText("设置车标")
    Action.clickByText("林肯车标")
    Action.adb_cmd("adb shell input keyevent 4")
    sleep(2)
    Judge.passIf(self, UIChecker.checkByTextContains("林肯"), "设置林肯车标")

def test_91(self):
    """进入导航设置,打开限行开关
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.swipeDiretion(BaiduMap.Edit_carlimit_id, 'up', 15)
    sleep(2)
    Action.clickByText("开启")
    Judge.passIf(self, UIChecker.checkByTextContains("限行规定"), "打开限行开关")

@unittest.skip("error")
def test_92(self):
    """进入限行规定,查找珠海并点击
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.swipeDiretion(BaiduMap.Edit_carlimit_id, 'up', 15)
    sleep(2)
    Action.clickByText("开启")
    Action.clickByText("限行规定")
    sleep(3)
    Action.clickByScrollText("珠海")
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextContains("珠海市"), "查找珠海并点击")

def test_93(self):
    """进入关于我们,点击法律资质
    """
    basemap.enter_map()
    basemap.enter_settings()
    Action.swipeDiretion(BaiduMap.Navi_setting_id, 'up', 5)
    Action.clickByText("关于我们")
    Action.clickByText("法律资质")
    config.logger.info("进入法律资质界面")

def test_94(self):
    """进入关于我们,点击服务条款
    """
    basemap.enter_map()
    basemap.enter_settings()
    Action.swipeDiretion(BaiduMap.Navi_setting_id, 'up', 5)
    Action.clickByText("关于我们")
    Action.clickByText("服务条款")
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Service_text_id), "点击服务条款")

def test_95(self):
    """进入关于我们,点击帮助按钮
    """
    basemap.enter_map()
    basemap.enter_settings()
    Action.swipeDiretion(BaiduMap.Navi_setting_id, 'up', 5)
    Action.clickByText("关于我们")
    Action.clickByResourceId(BaiduMap.About_Help_id)
    Judge.passIf(self, UIChecker.checkByTextContains("帮助"), "点击帮助按钮")

@unittest.skip("error")
def test_96(self):
    """进入关于我们,遍历帮助列表
    """
    help = ("1.离线地图有什么用", "2.如何下载或更新离线地图", "3.如何使用二维码扫描登录",
            "4.如何设置导航偏好", "5.如何设置我的车牌号限行", "6.如何设置沿途搜索")
    basemap.enter_map()
    basemap.enter_settings()
    Action.swipeDiretion(BaiduMap.Navi_setting_id, 'up', 5)
    Action.clickByText("关于我们")
    Action.clickByResourceId(BaiduMap.About_Help_id)
    for i in help:
        Action.clickByText(i)
        sleep(2)
        Action.adb_cmd("adb shell input keyevent 4")
        sleep(2)
    config.logger.info("遍历帮助列表")

@unittest.skip("error")
def test_97(self):
    """在首页底图,进行反GEO操作
    """
    basemap.enter_map()
    Action.swipeLeftAtCenter()
    sleep(1)
    d.long_click(400, 500)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Search_around_id), "进行反GEO操作")

@unittest.skip("error")
def test_98(self):
    """从POI详情页进入周边搜,并输入检索词
    """
    basemap.enter_map()
    Action.swipeLeftAtCenter()
    sleep(2)
    d.long_click(500, 600)
    sleep(3)
    Action.clickByResourceId(BaiduMap.Search_around_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Search_input_id), "从POI详情页进入周边搜")
    Action.clickByResourceId(BaiduMap.Search_input_id)
    Action.setTextByResourceId(BaiduMap.Search_input_id, "~@$UYHdygis/ 打开===++")
    sleep(2)

def test_99(self):
    """设置组队出行目的地
    """
    input = "输入目的地"
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    sleep(2)
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        Action.clickByText("创建队伍")
    sleep(5)
    Action.clickByText(input)
    sleep(2)
    Action.clickByText(input)
    Action.setTextByResourceId(BaiduMap.Input_via_id, "世界之窗")
    # Action.setTextByResourceId(BaiduMap.Input_via_id, "最好用的导航")
    sleep(3)
    Action.clickByResourceId(BaiduMap.Poi_gobtn_id)
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextContains("同步终点"), "设置组队出行目的地")
    Action.clickByText("同步终点")
    sleep(2)

@unittest.skip('no need')
def test_100(self):
    """进入组队出行,进行抢麦
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    sleep(1)
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        Action.clickByText("创建队伍")
    sleep(5)
    Action.clickByText("点击说话")
    sleep(1)
    Judge.passIf(self, UIChecker.checkByTextContains("准备中"), "进行抢麦")

@unittest.skip("no need")
def test_101(self):
    """抢麦后点击返回键结束抢麦
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_teamtrip_page()
    Action.clickByText("组队出行")
    sleep(1)
    if UIChecker.checkByText("服务协议"):
        Action.clickByText("同意并继续")
        Action.clickByText("创建队伍")
    sleep(5)
    Action.clickByText("点击说话")
    Action.adb_cmd("adb shell input keyevent 4")
    if UIChecker.checkByText("确认要停止讲话吗"):
        Action.clickByText("确认")
    Judge.passIf(self, UIChecker.checkByTextContains("组队出行"), "结束抢麦")

def test_102(self):
    """进入路线规划页,切换成时间偏好并导航
    """
    basemap.enter_map()
    basemap.enter_routeplan()
    Action.clickByResourceId(BaiduMap.Route_down_id)
    Action.clickByText("时间优先")
    sleep(2)
    basemap.click_agree_buttom()
    basemap.close_navi()
    sleep(1)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_103(self):
    """进入路线规划页,切换成少收费并导航
    """
    basemap.enter_map()
    basemap.enter_routeplan()
    Action.clickByResourceId(BaiduMap.Route_down_id)
    Action.clickByText("少收费")
    sleep(2)
    basemap.click_agree_buttom()
    basemap.close_navi()
    sleep(1)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_104(self):
    """进入路线规划页,切换成躲避拥堵并导航
    """
    basemap.enter_map()
    basemap.enter_routeplan()
    Action.clickByResourceId(BaiduMap.Route_down_id)
    Action.clickByText("躲避拥堵")
    sleep(2)
    basemap.click_agree_buttom()
    basemap.close_navi()
    sleep(1)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_105(self):
    """进入路线规划页,切换成不走高速并导航
    """
    basemap.enter_map()
    basemap.enter_routeplan()
    Action.clickByResourceId(BaiduMap.Route_down_id)
    Action.clickByText("不走高速")
    sleep(2)
    basemap.click_agree_buttom()
    basemap.close_navi()
    sleep(1)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_106(self):
    """进入路线规划页,切换成高速优先并导航
    """
    basemap.enter_map()
    basemap.enter_routeplan()
    Action.clickByResourceId(BaiduMap.Route_down_id)
    Action.clickByText("高速优先")
    sleep(2)
    basemap.click_agree_buttom()
    basemap.close_navi()
    sleep(1)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_107(self):
    """进行sug检索
    """
    basemap.enter_map()
    basemap.enter_poi_search("世界之窗")
    sleep(3)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Poi_gobtn_id), "sug检索")

def test_108(self):
    """进行精确匹配搜索
    """
    basemap.enter_map()
    basemap.enter_poi_search("世界之窗")
    sleep(1)
    Action.clickByText("搜索")
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextContains("世界之窗"), "进行精确匹配检索")

def test_109(self):
    """检索不到结果
    """
    basemap.enter_map()
    basemap.enter_poi_search("****&?")
    sleep(1)
    Action.clickByText("搜索")
    sleep(2)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Search_nothing_id), "检索不到结果")

def test_110(self):
    """清空历史记录
    """
    basemap.enter_map()
    basemap.enter_poi_search("世界之窗")
    sleep(1)
    Action.clickByText("搜索")
    sleep(3)
    Action.adb_cmd("adb shell input keyevent 4")
    Action.adb_cmd("adb shell input keyevent 4")
    Judge.passIf(self, UIChecker.checkByTextContains("清空历史记录"), "一次检索")
    Action.clickByText("清空历史记录")
    sleep(1)
    Action.clickByText("确定")
    Judge.passUnless(self, UIChecker.checkByTextContains("清空历史记录"), "确认清空历史记录")

def test_111(self):
    """跨市导航
    """
    basemap.enter_map()
    sleep(2)
    basemap.enter_poi_and_navi("广州南站")
    Action.clickByText("搜索")
    sleep(2)
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
        sleep(2)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_112(self):
    """跨省导航
    """
    basemap.enter_map()
    basemap.enter_poi_search("张家界")
    # basemap.enter_poi_and_navi("张家界")
    if UIChecker.checkByResourceId(BaiduMap.Quit_btn_id):
        Action.clickByResourceId(BaiduMap.Quit_btn_id)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.First_location_id), "退出导航")

def test_113(self):
    """进入POI详情页
    """
    basemap.enter_map()
    basemap.enter_poi_search("广州大学城")
    sleep(3)
    Action.clickByText("搜索")
    sleep(3)
    Action.clickByResourceId(BaiduMap.Poi_title_id)
    sleep(1)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Search_around_id), "进入POI详情页")

def test_114(self):
    """搜索结果包含多城市
    """
    basemap.enter_map()
    basemap.enter_poi_search("迪士尼乐园")
    sleep(3)
    Action.clickByText("搜索")
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextContains("请选择下列城市进行搜索"), "搜索结果包含多城市")

def test_115(self):
    """电话搜索
    """
    basemap.enter_map()
    basemap.enter_poi_search("10086")
    sleep(3)
    Judge.passIf(self, UIChecker.checkByTextContains("移动营业厅"), "电话搜索")

def test_116(self):
    """切换黑夜模式
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByText("黑夜")
    Action.adb_cmd("adb shell input keyevent 4")
    basemap.enter_poi_and_navi("世界之窗")

def test_117(self):
    """导航前切换到静音,导航中打开声音
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByText("静音")
    Action.adb_cmd("adb shell input keyevent 4")
    basemap.enter_poi_and_navi("世界之窗")
    Action.swipeLeftAtCenter()
    Action.waiting(1)
    Action.clickByResourceId(BaiduMap.Traffic_voice_id)
    sleep(1)
    Judge.passIf(self, UIChecker.checkByTextWait("已开启“导航声音”"), "开启导航声音")

def test_118(self):
    """点击去公司按钮,进行导航
    """
    basemap.enter_map()
    input = "输入目的地"
    Action.clickByText(input)
    Action.clickByText("去公司")
    # if UIChecker.checkByTextWait(input):
    #     sleep(1)
    #     Action.setTextByResourceId(BaiduMap.Input_via_id, "世界之窗")
    #     sleep(5)
    #     Action.clickByResourceId(BaiduMap.Search_jc_id)
    #     sleep(3)
    #     Judge.passIf(self, UIChecker.checkByTextWait("去公司"), "设置公司地址")
    #     Action.clickByText("去公司")
    sleep(5)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Start_navigation), "跳转到路线规划界面")
    Action.clickByResourceId(BaiduMap.Start_navigation)
    Judge.passIf(self, UIChecker.checkByText('同意'), "百度地图导航使用提示页面")
    Action.clickByText('同意')
    # basemap.click_agree_buttom()
    basemap.close_navi()
    # sleep(5)
    # Judge.passIf(self, UIChecker.checkByTextWait("开始导航"), "跳转到路线规划界面")
    # basemap.click_agree_buttom()
    # basemap.close_navi()

def test_119(self):
    """连续点击比例尺放大,缩小按钮,再点击定位按钮
    """
    basemap.enter_map()
    Action.clickByResourceId(BaiduMap.Traffic_btn_id)
    for i in range(10):
        Action.clickByResourceId(BaiduMap.Zoom_out_id)
    for i in range(10):
        Action.clickByResourceId(BaiduMap.Zoom_in_id)
    sleep(2)
    Action.clickByResourceId(BaiduMap.First_location_id)
    sleep(2)
    Judge.passIf(self, UIChecker.checkByResourceId(BaiduMap.Search_around_id), "点击定位按钮")

def test_120(self):
    """进入导航设置,设置播报模式静音
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByText("播报模式")
    sleep(2)
    Action.clickByText("静音")

def test_121(self):
    """进入导航设置,设置播报模式简洁
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByText("播报模式")
    sleep(2)
    Action.clickByText("简洁")

def test_122(self):
    """进入导航设置,设置播报模式详细
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByText("播报模式")
    sleep(2)
    Action.clickByText("详细")

def test_123(self):
    """进入导航设置,设置在线算路优先关闭
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByScrollText("在线算路优先")
    # sleep(2)
    Action.clickResourceIdChildClassAndIndex('com.baidu.naviauto:id/bt_routplan_mode',
                                             'android.widget.RadioButton',
                                             1)
    # Action.clickByText("关闭")

def test_124(self):
    """进入导航设置,设置自动切换巡航模式关闭
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByScrollText("自动切换巡航")
    # sleep(2)
    Action.clickResourceIdChildClassAndIndex('com.baidu.naviauto:id/bt_auto_cruiser',
                                             'android.widget.RadioButton',
                                             1)

    Action.clickByText("关闭")

def test_125(self):
    """进入导航设置,设置隐私模式开启
    """
    basemap.enter_map()
    basemap.enter_settings()
    basemap.enter_navi_settings()
    Action.clickByScrollText("隐私模式")
    # sleep(2)
    Action.clickResourceIdChildClassAndIndex('com.baidu.naviauto:id/bt_privacy_mode',
                                             'android.widget.RadioButton',
                                             1)
    # Action.clickByText("开启")

class sendEmail:
def sendemail(self):
# msg = email.mime.multipart.MIMEMultipart()
# msg[‘from’] = ‘shixinfa@baidu.com’
# msg[‘to’] = ‘shixinfa@baidu.com’
msg = MIMEMultipart()
tolist = [‘v_wangjiwei01@baidu.com’, ‘shixinfa@baidu.com’, ‘jinghenan@baidu.com’]
msg[‘from’] = ‘v_wangjiwei01@baidu.com’
msg[‘to’] = ‘,’.join(tolist)
msg[‘subject’] = “测试邮件”
content = “测试邮件内容”
txt = email.mime.text.MIMEText(content, ‘plain’, ‘utf-8’)
msg.attach(txt)
# 添加附件地址
part = MIMEApplication(open(r’/Users/v_wangjiwei01/Desktop/report.html’, ‘rb’).read())
part.add_header(‘Content-Disposition’, ‘attachment’, filename=“UI自动化测试结果111.html”) # 发送文件名称
msg.attach(part)

    smtp = smtplib.SMTP()
    smtp.connect('proxy-in.baidu.com', '25')
    smtp.sendmail(msg['from'], tolist, str(msg))

    print("发送成功!")

if name == ‘main’:
suite = unittest.TestSuite()
# #####suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestStringMethods))

suite.addTest(TestStringMethods('test_onlineCalculation_searchPages'))
suite.addTest(TestStringMethods('test_offlineCalculation_searchPages'))
suite.addTest(TestStringMethods('test_goHome_goCompany'))
suite.addTest(TestStringMethods('test_search_cityName'))
suite.addTest(TestStringMethods('test_city_calculateRoad'))
suite.addTest(TestStringMethods('test_no_high_speed'))
suite.addTest(TestStringMethods('test_high_speed_priority'))
suite.addTest(TestStringMethods('test_avoid_congestion'))
suite.addTest(TestStringMethods('test_priority_time'))
suite.addTest(TestStringMethods('test_intelligent_recommendation'))
suite.addTest(TestStringMethods('test_selectionPage_detailsPage_information'))
suite.addTest(TestStringMethods('test_openClose_naviSound'))
suite.addTest(TestStringMethods('test_route_preference'))
suite.addTest(TestStringMethods('test_incident_reporting'))
suite.addTest(TestStringMethods('test_searchAlong_theWay'))
suite.addTest(TestStringMethods('test_global_mode_switch'))
suite.addTest(TestStringMethods('test_page_display'))
suite.addTest(TestStringMethods('test_clickAgree_disclaimerPage'))
suite.addTest(TestStringMethods('test_clickNoAgree_disclaimerPage'))
suite.addTest(TestStringMethods('test_set_home_address'))
suite.addTest(TestStringMethods('test_set_company_address'))
suite.addTest(TestStringMethods('test_switch_browse_mode'))
suite.addTest(TestStringMethods('test_input_keywords'))
suite.addTest(TestStringMethods('test_keyword_search'))
suite.addTest(TestStringMethods('test_click_sug_search'))
suite.addTest(TestStringMethods('test_passing_point_icon'))
suite.addTest(TestStringMethods('test_routePoint_inputDestination'))
suite.addTest(TestStringMethods('test_team_management'))
suite.addTest(TestStringMethods('test_team_name_modification'))
suite.addTest(TestStringMethods('test_favorites_set_company_address'))
suite.addTest(TestStringMethods('test_favorites_set_home_address'))
suite.addTest(TestStringMethods('test_favorites_del_home_address'))
suite.addTest(TestStringMethods('test_favorites_del_company_address'))
suite.addTest(TestStringMethods('test_del_favorites_address'))
suite.addTest(TestStringMethods('test_i_want_report'))
suite.addTest(TestStringMethods('test_i_want_report5'))
suite.addTest(TestStringMethods('test_i_want_report1'))
suite.addTest(TestStringMethods('test_i_want_report2'))
suite.addTest(TestStringMethods('test_i_want_report3'))
suite.addTest(TestStringMethods('test_i_want_report4'))
suite.addTest(TestStringMethods('test_i_want_report6'))
suite.addTest(TestStringMethods('test_i_want_report7'))
suite.addTest(TestStringMethods('test_i_want_report8'))
suite.addTest(TestStringMethods('test_i_want_report9'))
suite.addTest(TestStringMethods('test_i_want_report10'))
suite.addTest(TestStringMethods('test_i_want_report11'))
suite.addTest(TestStringMethods('test_i_want_report12'))
suite.addTest(TestStringMethods('test_i_want_report13'))
suite.addTest(TestStringMethods('test_i_want_report14'))
suite.addTest(TestStringMethods('test_i_want_report15'))
suite.addTest(TestStringMethods('test_i_want_report17'))
suite.addTest(TestStringMethods('test_i_want_report18'))
suite.addTest(TestStringMethods('test_i_want_report19'))
suite.addTest(TestStringMethods('test_i_want_report20'))
suite.addTest(TestStringMethods('test_i_want_report21'))
suite.addTest(TestStringMethods('test_i_want_report22'))
suite.addTest(TestStringMethods('test_i_want_report23'))
suite.addTest(TestStringMethods('test_i_want_report24'))
suite.addTest(TestStringMethods('test_i_want_report25'))
suite.addTest(TestStringMethods('test_i_want_report26'))
suite.addTest(TestStringMethods('test_i_want_report27'))
suite.addTest(TestStringMethods('test_delete_voice_package'))
suite.addTest(TestStringMethods('test_download_voice_package'))
suite.addTest(TestStringMethods('test_download_status_display'))
suite.addTest(TestStringMethods('test_preference_message_notification'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_gasStation'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_atm'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_chargingStation'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_frontBackSwitch'))
suite.addTest(TestStringMethods('test_auto_day_nightMode'))
suite.addTest(TestStringMethods('test_voic_avoidCongestion'))
suite.addTest(TestStringMethods('test_voic_noHighSpeedRoute'))
suite.addTest(TestStringMethods('test_voic_chargeLess'))
suite.addTest(TestStringMethods('test_voic_highSpeedPriority'))
suite.addTest(TestStringMethods('test_openRoad'))
suite.addTest(TestStringMethods('test_closeRoad'))
suite.addTest((TestStringMethods('test_switchFollowMode')))
suite.addTest(TestStringMethods('test_switchDueNorthMode'))
suite.addTest(TestStringMethods('test_switch2DMode'))
suite.addTest(TestStringMethods('test_switch3DMode'))
suite.addTest(TestStringMethods('test_switchDayMode'))
suite.addTest(TestStringMethods('test_switchNightMode'))
suite.addTest(TestStringMethods('test_zoomInMap'))
suite.addTest(TestStringMethods('test_zoomOutMap'))
suite.addTest(TestStringMethods('test_HomeUIDisplay'))
suite.addTest(TestStringMethods('test_morePanels_UIDisplay'))
suite.addTest(TestStringMethods('test_packUp_morePanels'))
suite.addTest(TestStringMethods('test_morePanels_clickSearch'))
suite.addTest(TestStringMethods('test_favorites_page'))
suite.addTest(TestStringMethods('test_search_record_display'))
suite.addTest(TestStringMethods('test_click_clearHistory'))
suite.addTest(TestStringMethods('test_clear_cache_page_display'))
suite.addTest(TestStringMethods('test_clear_cache'))
suite.addTest(TestStringMethods('test_clear_cache_field_display'))
suite.addTest(TestStringMethods('test_cacheDataIs0_click_clear_cache'))
#suite.addTest(unittest.makeSuite(test_mapauto.MyTest))

# with open(r'/Users/v_wangjiwei01/Desktop/report01.html', 'wb') as fp:
#     runner = TestRunner(fp, title='Phase4UITest', description='Phase4UITestDetail', verbosity=2)
#     runner.run(suite)
#     emais = sendEmail()
#     emais.sendemail()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

uiautomator2实例 的相关文章

  • Python智能合约开发指南(以太坊+web3py)

    在以太坊上获得一个基本的智能合约是一个很简单的事 只需google查询 ERC20代币教程 你会发现有关如何做到这一点的大量信息 以编程方式与合约交互完全是另一回事 如果你是一个Python程序员 那么教程就很少 所以写这个Python中的
  • java的队列实现方法_Java实现队列的三种方法集合

    数组实现队列 数组实现队列 class queue int a new int 5 int i 0 入队操作 public void in int m a i m 出队列操作 取出最前面的值 通过循环遍历把所有的数据向前一位 public
  • fairygui简单使用(unity)

    本文主要是引导怎么从fairygui页面ui编辑到unity的过程 如果想详细的那种 最好下载一个官方案例 里面都有详细的教程 不过这个对于新手来说还是挺好的 因为我刚开始以为是自己创建代码 自己写 先去官网下载一个gui编辑器 这是API
  • utf-8和gb2312的相互转换

    最近老是涉及到编码与解码的问题 GB2312转UTF 8 又或者UTF 8转GB2312 无意中在CSDN闲逛发现了一个CString 转UTF 8的思路 现摘寻下来 免得到时又找不着了 CString UTF8Convert CStrin
  • GDB 调试过程

    一 gdb 1 gdb 启动gdb 2 gdb tui 启动gdb 并且分屏显示源代码 3 gdb app 启动gdb调试指定程序app 4 gdb
  • WebSocket 前端使用

    h5提供了WebSocket网络协议 可以实现浏览器与服务器的双向数据传输 构造函数 WebSocket url protocol url WebSocket API URL URL之前需要添加ws 或者wss 类似http https p
  • FastICA代码(matlab版本)

    icasig A W fastica eegdata approach symm g tanh function Out1 Out2 Out3 fastica mixedsig varargin FASTICA Fast Independe
  • 后端开发学习Vue(一)

    Vue的介绍 官网 https cn vuejs org Vue是一个简单容易上手前端框架 例如 下面的代码可以快速构建一个表格
  • Redis数据结构存储系统:第二章:如何使用,BAT等大厂必问技术面试题

    public class RedisUtil private JedisPool jedisPool public void initPool String host int port int database 一线大厂Java面试题解析
  • map与java bean相互转换

    map与java对象的相互转换 1 使用org apache commons beanutils转换 2 使用Introspector转换 3 使用reflect转换 4 使用net sf cglib beans BeanMap转换 5 使
  • ubuntu 强制关闭卡死的pycharm

    ubuntu 环境是 16 04 终端输入 monitor 点击 System monitor 之后输入java 上图是已经删除过的 找到java之后右键点击kill OK
  • Vue(五)&&git

    Vue 三十二 git 1 概述 Git和代码托管中心 2 常用命令 3 本地仓库 4 远程仓库 5 团队内协作 1 非冲突 2 冲突 3 可视化 6 跨团队协作 7 分支 1 分支的好处 2 分支的构建 3 合并分支 8 SSH免密登录
  • html方框打勾字段,HTML+CSS入门 如何设置 checkbox复选框控件的对勾√样式

    本篇教程介绍了HTML CSS入门 如何设置 checkbox复选框控件的对勾 样式 希望阅读本篇文章以后大家有所收获 帮助大家HTML CSS入门 lt 我们要创建方框中的对勾 对于这一点 我们可以使用 after伪类创建一个新的元素 为
  • echarts中toolbox增加自定义图标和事件

    1 echarts提供了丰富的图标 如提供了 saveAsImage保存图片 restore 配置项还原 dataView数据视图工具 dataZoom 数据区域缩放 magicType 动态类型切换 brush 选择组件的控制按钮等 2
  • 开学第五周刷题记录

    Crypto Windows系统密码 首先拿到题目 我们打开看一下 它后缀是 hash 双击之后我们发现打不开 这种情况有两种原因 一是我们没有安装相应的软件 二是该文件被毁坏了 然后我们尝试用记事本打开看一下 结果发现原来重点在这 Adm
  • Jenkins使用问题记录

    1 启动 使用Jenkins的版本为2 138 3 下载war包后启动即可运行 指定使用8080端口 可自定义 java jar jenkins war httpPort 8080 建议后台启动 命令如下 1 启动 指定后台启动 nohup
  • 服务器性能测试脚本大全

    服务器性能测试脚本大全 SFS工具箱集成了数十种服务器性能测试脚本 包括服务器测速 内存测压 CPU跑分 硬盘写入 等待脚本非常齐全 重要的是脚本资源存储于国内节点 执行获取速度快 非那些存储在海外的 执行速度慢等的头疼 下面教大家如何安装
  • git的基本介绍与使用

    一 git的定义与配置 世界上最先进的分布式版本管理系统没有之一 作者 linus linus系统创始人 解决的问题 代码版本管理 多人协作 编写项目 通俗来说 毕业论文初始版 毕业论文修改版 毕业论文最终版 安装网址 Githttps g
  • 基于Sqli-Labs靶场的SQL注入-1~4关

    less 1 Less4联合注入讲解 目录 less 1 基于字符型 单引号 注入点的联合注入 注入类型判断 猜解数据库中字段数 爆破数据库库名以及版本号 爆破数据库中的表名以及数据库安装路径 爆破某张表中的列名以及当前数据库的用户名 查询
  • 分享一个实用的Linux的安全基线检查

    这个脚本主要是用于检查Linux系统的一些基础配置是否存在危险 能够快速的发现问题 定位问题 目前功能还不够全面 后面慢慢完善 喜欢安全的朋友可以微信关注Gamma安全实验室公众号 里面有很多高质量文章以及免费的学习资料 bin bash

随机推荐

  • 使用element-ui上传组件时界面抖动

    参考博客 避免使用push this fileList push name this data key url imgUrl this data key 看项目场景影响 this fileList name this data key ur
  • 原生JS局部刷新

    目录 使用XMLHttpRequest对象进行异步请求 2 使用fetch API进行异步请求 3 使用事件监听器进行局部刷新 4 servlet实现img验证码局部刷新 依赖jar包 Servlet login jsp 在原生JS中 可以
  • c++的初始化与清除

    c 编程思想 阅读笔记 4 第4章 初始化与清除 第2章利用了一些分散的典型c语言库的构件 并把它们封装在一个struct总 从而在库的应用方面做了有意义的改进 从现在起 这个抽象数据类型称为类 1 这样用类名隐藏了类内部的函数名 并且通过
  • 网络层(5.互联网的路由选择协议)

    目录 一 有关路由选择协议的几个基本概念 1 理想的路由算法 2 分层次的路由选择协议 二 内部网关协议RIP 1 工作原理 2 距离向量算法 3 RIP协议的报文格式 4 RIP的优缺点 三 内部网关协议OSPF 1 OSPF协议的基本特
  • jsp服务器文件夹,jsp 服务器建文件夹

    tomcat部署web应用的三种方式 也可以将JSP程序打包成一个war包放在目录下 服务器会自动解开这个war包 并在这个目录下生成一个同名的文件夹 一个war包就是有特性格式的jar包 它是将一个Web程序的所有内容进行压缩得到 具体如
  • 如何使用Visual Studio进行Code Review

    简介 Code Review 不是为了去批斗某个 Coder 而是为了 Team 成员之间相互学习 加深成员对系统业务的理解 使团队成员的代码更加健壮 提早发现代码缺陷 Code Review 的工具有很多种 如 CODING 企业版工具
  • SkyPilot:构建在多云之上的 ML 和数据科学,可节约 3 倍以上成本

    作者 Zongheng Yang 在加州大学伯克利分校研发 SkyPilot 整理 高现起 导读 用于 ML 和数据科学的云计算已经比较困难 如果你想要通过成本优化削减成本 你的整体成本包括资源和人力 可能会不降反增 不想在机器闲置时停止
  • ipad协议优缺点介绍

    大家好 今天给大家介绍下ipad的具体情况以及特点 傻瓜式API 掌握JAVA Go PHP Python等任意一种后端代码 你就可以 通过API 搭建一个 微信机器人功能 用来自动管理微信消息 我们是一家专业提供个人号API的技术团队 服
  • webpack5.0基础配置(全面)

    前言 铁子们好我是跑不快的猪 新的一年 新的开始 先预祝各位都有华丽丽的变身 本篇文章主要进行webpack5 0 版本的配置 在这个脚手架横行的时代 最终还是需要掌握一些基础的配置 对工作 面试 以及各脚手架中webpack的调试都有不小
  • 例说Hausdorff距离

    给定欧氏空间中的两点集 Hausdorff距离就是用来衡量这两个点集间的距离 其中 称为双向Hausdorff距离 称为从点集A到点集B的单向Hausdorff距离 相应地 称为从点集B到点集A的单向Hausdorff距离 下面从一个例子来
  • adb电池节点

    kernel 4 19 lc drivers power supply mtk battery c static enum power supply property battery props POWER SUPPLY PROP STAT
  • BFS java实现

    public class BFS 存放节点关系的hashtable public static void bfs HashMap
  • java实现视频通话

    首先来确定一下基本思路 一 显示阶段 1 打开摄像头 获得一张BufferedImage1 并获得他的宽 高 2 根据宽 高实例化一个BufferedImage2 3 把BufferedImage1上的每一个像素点画到BufferedIma
  • mysql-锁

    一 基础概念 锁是数据库系统区分与文件系统的一个关键特性 为了保证数据一致性 必须有锁的介入 数据库系统使用锁是为了支持对共享资源进行并发访问 提供数据的完整性和一致性 mysql锁主要是为了解决并发写数据时的一种安全机制 lock与lat
  • ROS导航小车3 odom里程计标定(仅作个人记录)

    检测机器人是否需要标定参考链接 1 打开一个新的terminal 运行rviz rviz窗口打开后 将fixed frame选择为odom 关闭其他所有勾选 只保留grid和tf 如没有grid 左下角add新增 打开tf 下拉出来fram
  • 遗传算法解TSP问题(java实现)

    遗传算法解TSP问题 java实现 TSP问题简介 旅行商问题 最短路径问题 英语 travelling salesman problem TSP 是这样一个问题 给定一系列城市和每对城市之间的距离 求解访问每一座城市一次并回到起始城市的最
  • IDEA打不开(找不到)RunDashBoard问题

    我的IDEA版本是2022版 最近学习微服务发现打不开RunDashBoard 可能是更改了名称叫做Services 点击下方的Services 再点击加号 选择Run Configuration Type 之后选择springboot 就
  • vulnhub靶机Me-and-My-Girlfriend-1打靶记录

    准备环境 kali linux ip 172 16 10 149 Me and My Girlfriend 1 虚拟机n 渗透工具 kali虚拟机 nmap 端口扫描工具 pker后台扫描工具 谷歌xff伪造插件 X Forwarded F
  • 基于SpringBoot+微信小程序的失物招领小程序

    基于SpringBoot 微信小程序的失物招领小程序 全网粉丝20W csdn特邀作者 博客专家 CSDN新星计划导师 java领域优质创作者 博客之星 掘金 华为云 阿里云 InfoQ等平台优质作者 专注于Java技术领域和毕业项目实战
  • uiautomator2实例

    from pytestreport import TestRunner import uiautomator2 as u2 import email import os import smtplib import random import