def test_case2(self):
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time",wake_finish_time)
        get_mic_status.get_mic_status(self.driver)
        play("调幅九百", path.men_qa_file)
        time.sleep(0.5)
        self.driver.screenshot(path.Cache_img_path2)
        time.sleep(9)
        self.driver.screenshot(path.src_path + "file.png")
        get_ROIimg()
        time.sleep(1)
        ret = get_str()
        print(ret)
        if ret == "900":
            result = True
        else:
            result = False
        # result = img_match.picture_match(self.driver,"radio900.png",0.99)

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        ck.check(check_time, result, 'radio_case2')
    def test_case4(self):
        self.driver.screenshot(path.src_path + "file.png")
        get_ROIimg()
        time.sleep(1)
        ret_bef = get_str()
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        get_mic_status.get_mic_status(self.driver)
        play("下一个频道", path.men_qa_file)
        print("wake_finish_time",wake_finish_time)
        time.sleep(0.5)
        self.driver.screenshot(path.Cache_img_path2)
        time.sleep(9)
        self.driver.screenshot(path.src_path + "file.png")
        get_ROIimg()
        time.sleep(1)
        ret_aft = get_str()
        print(ret_bef,ret_aft)
        if float(ret_aft)>float(ret_bef) and ret_aft!="0" and ret_bef!="0":
            result = True
        else:
            result = False
        # result = img_match.picture_match(self.driver,"radio88.png",0.99)

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        ck.check(check_time, result, 'radio_case4')
예제 #3
0
 def test_case20(self):
     play('你好小西', path.wake_up_file)
     wake_finish_time = self.GDL.get_local_time()
     print("wake_finish_time", wake_finish_time)
     get_mic_status.get_mic_status(self.driver)
     play("上海后天有雨", path.men_handle_file)
     time.sleep(5)
     self.driver.screenshot(path.Cache_img_path2)
     time.sleep(35)
     # 惠州明天会下雨,天气情况是:暴雨转雷阵雨,25至29℃,微风(无持续风向)。雨天请您带好雨具,路面湿滑,出行注意安全。
     self.GDL.get_device_log()
     start_time, new_result = self.GDL.get_device_wake()
     print("start_time", start_time)
     check_time = abs(wake_finish_time - start_time)
     result = self.GDL.get_last_4_ret("上海后天|天气情况")
     ck.check(check_time, result, 'weather_case20')
예제 #4
0
 def test_case11(self):
     play('你好小西', path.wake_up_file)
     wake_finish_time = self.GDL.get_local_time()
     print("wake_finish_time", wake_finish_time)
     get_mic_status.get_mic_status(self.driver)
     play("深圳明天的", path.men_handle_file)
     time.sleep(5)
     self.driver.screenshot(path.Cache_img_path2)
     time.sleep(35)
     self.GDL.get_device_log()
     start_time, new_result = self.GDL.get_device_wake()
     print("start_time", start_time)
     check_time = abs(wake_finish_time - start_time)
     print(check_time)
     result = self.GDL.get_last_4_ret("深圳明天的温度|深圳明天天气情况")
     ck.check(check_time, result, 'weather_case11')
 def test_case1(self):
     play('你好小西', path.wake_up_file)
     wake_finish_time = self.GDL.get_local_time()
     print("wake_finish_time",wake_finish_time)
     get_mic_status.get_mic_status(self.driver)   #获取麦克风图标状态
     play("打开收音机", path.men_qa_file)          #播放问题
     self.driver.screenshot(path.Cache_img_path2)
     time.sleep(9)
     result = img_match.picture_match(self.driver,["radio.png"],0.95)
     print('result',result)
     self.GDL.get_device_log()
     start_time, new_result = self.GDL.get_device_wake()
     print("start_time",start_time)
     check_time = abs(wake_finish_time-start_time)
     print(check_time)
     ck.check(check_time,result,'radio_case1')
예제 #6
0
 def test_case39(self):
     play('你好小西', path.wake_up_file)
     wake_finish_time = self.GDL.get_local_time()
     print("wake_finish_time", wake_finish_time)
     get_mic_status.get_mic_status(self.driver)
     play("讲个笑话", path.men_handle_file)
     time.sleep(5)
     self.driver.screenshot(path.Cache_img_path2)
     time.sleep(35)
     # 孙子说:“爷爷,水牛是啥样子?”爷爷说:“水牛跟普通牛长的差不多,不同的是它喜欢在水中生活。”孙子说:“噢,我懂啦,它一定是喜欢吃鱼吧。,,,,
     self.GDL.get_device_log()
     start_time, new_result = self.GDL.get_device_wake()
     print("start_time", start_time)
     check_time = abs(wake_finish_time - start_time)
     print(check_time)
     result = self.GDL.get_last_4_ret("..................................")
     ck.check(check_time, result, 'weather_case39')
    def test_case3(self):
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time",wake_finish_time)
        get_mic_status.get_mic_status(self.driver)
        play("调频88", path.men_qa_file)
        time.sleep(0.5)
        self.driver.screenshot(path.Cache_img_path2)
        time.sleep(9)
        result = img_match.picture_match(self.driver,["radio88.png"],0.99)

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        ck.check(check_time, result, 'radio_case3')
예제 #8
0
    def test_case2(self):
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time",wake_finish_time)
        time.sleep(2)
        play("给妖铃铃八", path.men_qa_file)
        time.sleep(10)
        play("第一个", path.men_qa_file)
        time.sleep(10)
        result = img_match.picture_match(self.driver,"phone_call.png")

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        time.sleep(60)
        ck.check(check_time, result, '电话case2')
예제 #9
0
    def test_case4(self):
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time",wake_finish_time)
        get_mic_status.get_mic_status(self.driver)
        play("我想打个电", path.men_qa_file)
        time.sleep(10)
        play("第一个", path.men_qa_file)
        time.sleep(7)
        result = img_match.picture_match(self.driver,["phone_call.png","phone_call1.png","phone_call2.png"],0.9)

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        time.sleep(60)
        ck.check(check_time, result, 'phone_call_case4')
예제 #10
0
    def test_case9(self):
        self.driver.screenshot(path.src_path + "file.png")
        get_ROIimg()
        time.sleep(1)
        ret_bef = get_str()
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time",wake_finish_time)
        get_mic_status.get_mic_status(self.driver)
        play("上一个电台", path.men_qa_file)
        time.sleep(0.5)
        self.driver.screenshot(path.Cache_img_path2)
        time.sleep(9)
        self.driver.screenshot(path.src_path + "file.png")
        get_ROIimg()
        time.sleep(1)
        ret_aft = get_str()
        print(ret_bef,ret_aft)
        if float(ret_aft)<float(ret_bef) and ret_aft!="0" and ret_bef!="0":
            result = True
        else:
            result = False
        # result = img_match.picture_match(self.driver,"radio88.png",0.99)

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        ck.check(check_time, result, 'radio_case9')

#
# if __name__ == "__main__":
#     ask = Music_ask()
#     ask.test_case1()
#     ask.test_case2()
#     ask.test_case3()
#     ask.test_case4()
#     ask.test_case5()
#     ask.test_case6()
#     ask.test_case7()
#     ask.test_case8()
예제 #11
0
 def test_case1(self):
     play('你好小西', path.wake_up_file)
     wake_finish_time = self.GDL.get_local_time()
     print("wake_finish_time", wake_finish_time)
     get_mic_status.get_mic_status(self.driver)
     play("明天雨大不", path.men_handle_file)
     time.sleep(5)
     self.driver.screenshot(path.Cache_img_path2)
     time.sleep(32)
     # play("第一个", path.men_qa_file)
     # time.sleep(10)
     # result = img_match.picture_match(self.driver,"phone_call.png")
     # 惠州明天会下雨,天气情况是:暴雨转雷阵雨,25至29℃,微风(无持续风向)。雨天请您带好雨具,路面湿滑,出行注意安全。
     self.GDL.get_device_log()
     start_time, new_result = self.GDL.get_device_wake()
     print("start_time", start_time)
     check_time = abs(wake_finish_time - start_time)
     print(check_time)
     result = self.GDL.get_last_4_ret("惠州明天|天气情况")
     ck.check(check_time, result, 'weather_case1')
예제 #12
0
    def test_case41(self):
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time", wake_finish_time)
        get_mic_status.get_mic_status(self.driver)
        play("中国最高的", path.men_handle_file)
        time.sleep(5)
        self.driver.screenshot(path.Cache_img_path2)
        time.sleep(35)
        # 惠州明天会下雨,天气情况是:暴雨转雷阵雨,25至29℃,微风(无持续风向)。雨天请您带好雨具,路面湿滑,出行注意安全。
        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time", start_time)
        check_time = abs(wake_finish_time - start_time)
        print(check_time)
        result = self.GDL.get_last_4_ret("中国最高的山|珠穆朗玛峰")
        ck.check(check_time, result, 'weather_case41')


# if __name__ == "__main__":
#     ask = Music_ask()
# ask.test_case1()
# ask.test_case2()
# ask.test_case3()
# ask.test_case4()
# ask.test_case5()
# ask.test_case6()
# ask.test_case7()
# ask.test_case8()
# ask.test_case9()
# ask.test_case10()
# ask.test_case11()
# ask.test_case12()
# ask.test_case13()
# ask.test_case14()
# ask.test_case15()
# ask.test_case16()
# ask.test_case17()
# ask.test_case18()
# ask.test_case19()
# ask.test_case20()
# ask.test_case21()
# ask.test_case22()
# ask.test_case23()
# ask.test_case24()
# ask.test_case25()
# ask.test_case26()
# ask.test_case27()
# ask.test_case28()
# ask.test_case29()
# ask.test_case30()
# ask.test_case31()
# ask.test_case32()
# ask.test_case33()
# ask.test_case34()
# ask.test_case35()
# ask.test_case36()
# ask.test_case37()
# ask.test_case38()
# ask.test_case39()
# ask.test_case40()
# ask.test_case41()
예제 #13
0
    def test_case8(self):
        play('你好小西', path.wake_up_file)
        wake_finish_time = self.GDL.get_local_time()
        print("wake_finish_time",wake_finish_time)
        get_mic_status.get_mic_status(self.driver)
        play("我想给邓伦", path.men_qa_file)
        time.sleep(10)
        play("第一个", path.men_qa_file)
        time.sleep(7)
        result = img_match.picture_match(self.driver,["phone_call.png","phone_call1.png","phone_call2.png"],0.9)

        self.GDL.get_device_log()
        start_time, new_result = self.GDL.get_device_wake()
        print("start_time",start_time)
        check_time = abs(wake_finish_time-start_time)
        print(check_time)
        time.sleep(60)
        ck.check(check_time, result, 'phone_call_case8')

    # @allure.story('0009.call一下马云马老板')
    # def test_case9(self):
    #     play('你好小西', path.wake_up_file)
    #     wake_finish_time = self.GDL.get_local_time()
    #     print("wake_finish_time",wake_finish_time)
    #     time.sleep(2)
    #     play("call一", path.men_qa_file)
    #     time.sleep(10)
    #     play("第一个", path.men_qa_file)
    #     time.sleep(10)
    #     result = img_match.picture_match(self.driver,["phone_call.png"])
    #
    #     self.GDL.get_device_log()
    #     start_time, new_result = self.GDL.get_device_wake()
    #     print("start_time",start_time)
    #     check_time = abs(wake_finish_time-start_time)
    #     print(check_time)
    #     time.sleep(60)
    #     ck.check(check_time, result, '电话case9')

    # def test_case3(self):
    #     play('你好小西', path.wake_up_file)
    #     wake_finish_time = self.GDL.get_local_time()
    #     print("wake_finish_time", wake_finish_time)
    #     time.sleep(2)
    #     play("接听", path.men_qa_file)
    #     time.sleep(10)
    #     # play("第一个", path.men_qa_file)
    #     # time.sleep(10)
    #     result = img_match.picture_match(self.driver, "phone_call.png")
    #
    #     self.GDL.get_device_log()
    #     start_time, new_result = self.GDL.get_device_wake()
    #     print("start_time", start_time)
    #     check_time = abs(wake_finish_time - start_time)
    #     print(check_time)
    #     if check_time >= 5:
    #         print("\033[7;44mcase1唤醒失败\033[0m")
    #     else:
    #         print("\033[7;31mcase1唤醒成功\033[0m")
    #     if result:
    #         print("\033[7;31mcase1测试通过\033[0m")
    #     else:
    #         print("\033[7;44mcase1测试失败\033[0m")
    #         fail_dir_name = time.strftime("%y_%m_%d_%H_%M_%S")
    #         cmd = "adb pull sdcard/txz/log " + path.DIR_PATH + "\\report\\error_log\\" + fail_dir_name + "case1\\"
    #         subprocess.call(cmd)
예제 #14
0
# -*- coding: utf-8 -*-