def test_config_file_success(self): working_dir = "test_online_report_%s" % get_time_str() cmdline = 'runtest --report-type html tests.sampletest.hellotest.FailedCase --config-file tests/sampletest/test.json' cmdline += " -w " + working_dir self.addCleanup(shutil.rmtree, working_dir, ignore_errors=True) sys.argv = ["qtaf"] sys.argv.extend(cmdline.split()) exitcode = ManagementTools().run() self.assertEqual(exitcode, 0)
def test_config_file_with_global_parameters(self): with modify_settings(QTAF_PARAM_MODE=True): working_dir = "test_online_report_%s" % get_time_str() cmdline = 'runtest --config-file tests/sampletest/test_global_parameters.json' cmdline += " -w " + working_dir self.addCleanup(shutil.rmtree, working_dir, ignore_errors=True) sys.argv = ["qtaf"] sys.argv.extend(cmdline.split()) exitcode = ManagementTools().run() self.assertEqual(exitcode, 0)
# -*- coding: utf-8 -*- ''' 项目管理和辅助工具 ''' #2019/01/18 QTAF自动生成 import sys import os proj_root = os.path.dirname(os.path.abspath(__file__)) if proj_root not in sys.path: sys.path.insert(0, proj_root) exlib_dir = os.path.join(proj_root, 'exlib') if os.path.isdir(exlib_dir): for filename in os.listdir(exlib_dir): if filename.endswith('.egg'): lib_path = os.path.join(exlib_dir, filename) if os.path.isfile(lib_path) and lib_path not in sys.path: sys.path.insert(0, lib_path) from testbase.management import ManagementTools if __name__ == '__main__': ManagementTools().run()