示例#1
0
    global_cases_list = run_mode_conf.get_global_cases()

    project_httpobj_dict = {}
    for item in global_cases_list:
        project_name = item[0]
        cases_list = item[1]
        httpobj = get_http_conf_of_project(project_name)
        if not httpobj:
            logger.critical('初始化用例所在项目配置存在问题,提前终止程序运行')
            exit()
        else:
            logger.info('正在运行项目:"%s"的全局初始化用例id列表:%s' %
                        (project_name, cases_list))
            project_httpobj_dict[project_name] = httpobj
            for case_id in cases_list:
                res = run_testcase_by_id(case_id, httpobj)
                logger.info('用例[%s]运行结果:%s' % (id, res))

    if 1 == run_mode:
        logger.info('按项目运行测试')
        project_mode = run_mode_conf.get_project_mode()
        testplans_name_list = []
        if 1 == project_mode:
            logger.info('运行所有项目')
            projects = mytestlink.getProjects()
            for project in projects:
                # 构造项目对象
                active_status = project['active']
                project_name = project['name']
                project_notes = other_tools.conver_date_from_testlink(
                    project['notes'])
示例#2
0
    logger.info('正在创建测试步骤报告报表')
    testdb.execute_create(create_case_step_reporter_tb_sql)

    logger.info('正在读取运行模式配置')
    if sys.argv[1] == '1':
        run_mode_conf = RunModeConfig('./config/runmodeconfig_test.conf')
    elif sys.argv[1] == '2':
        run_mode_conf = RunModeConfig('./config/runmodeconfig_release.conf')
    run_mode = int(run_mode_conf.get_run_mode())

    logger.info('正在运行全局初始化用例……')
    global_case_id_list = run_mode_conf.get_global_case_id_list()
    logger.info('待运行全局初始化用例id列表:%s', global_case_id_list)
    for id in global_case_id_list:
        res = run_testcase_by_id(id)
        logger.info('用例[%s]运行结果:%s'% (id, res))

    if 1 == run_mode:
        logger.info('按项目运行测试')
        project_mode = run_mode_conf.get_project_mode()
        testplans_name_list = []
        if 1 == project_mode:
            logger.info('运行所有项目')
            projects = mytestlink.getProjects()
            for project in projects:
                # 构造项目对象
                active_status = project['active']
                project_name = project['name']
                project_notes = other_tools.conver_date_from_testlink(project['notes'])
                project_id = int(project['id'])