Beispiel #1
0
    def run_test(self):
        server = Server()
        server.execute_command_on_thread()
        suite = unittest.TestSuite()
        my_custom_name = My_Custom_Name()
        device_list = self.deal_device_info()

        for device_info in range(len(device_list)):
            print('device_info:',device_list[device_info])
            room_name = device_list[device_info][0]
            device_name = device_list[device_info][1]
            model = device_list[device_info][2]
 def run_test(self):
     server = Server()
     server.execute_command_on_thread()
     suite = unittest.TestSuite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(T1))
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(T2))
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(T3))
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(T4))
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(T5))
     filename = '../report//HTMLReport.html'
     with open(filename, 'wb') as  f:
         HTMLTestRunner.HTMLTestRunner(stream=f,
                                       title='MathFunc Test Report',
                                       description='测试报告详情:').run(suite)
     server.kill_server()
Beispiel #3
0
    suite.addTest(Ctrl_Ln1_V1_Case('test_case25'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case26'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case27'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case28'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case29'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case30'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case31'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case32'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case33'))
    suite.addTest(Ctrl_Ln1_V1_Case('test_case34'))

    # unittest.TextTestRunner().run(suite)
    # 定义个报告存放的路径,支持相对路径
    # filename = '../report/tesecase'+str(i)+'_report'+'.html'
    # filename = '../report/HTMLReport.html'
    filename = '/Users/lumi/Documents/items/MIOT/Appium_Android_RPC/report/HTMLReport.html'
    file_result = open(filename, 'wb')
    # 定义测试报告
    HTMLTestRunner.HTMLTestRunner(stream=file_result,
                                  title='Aqara墙壁开关(零火线单键版)测试用例结果',
                                  description='测试报告详情:').run(suite)
    file_result.close()


if __name__ == '__main__':
    server = Server()
    server.execute_command_on_thread()
    get_suite()
    server.kill_server()