def web_ui_init():
    """
    初始化必要的数据
    :return:
    """
    # 初始化java依赖的libs
    java_maven_init()
    # demoProject项目初始化
    DemoProjectInit().init()
Beispiel #2
0
    parser=argparse.ArgumentParser()
    parser.add_argument('-k','--keyword',help='只执行匹配关键字的用例,会匹配文件名、类名、方法名',type=str)
    parser.add_argument('-d','--dir',help='指定要测试的目录',type=str)
    parser.add_argument('-m', '--markexpr', help='只运行符合给定的mark表达式的测试')
    parser.add_argument('-s', '--capture', help='是否在标准输出流中输出日志,1:是、0:否,默认为0')
    parser.add_argument('-r', '--reruns', help='失败重跑次数,默认为0')
    parser.add_argument('-lf', '--lf', help='是否运行上一次失败的用例,1:是、0:否,默认为0')
    parser.add_argument('-tt', '--test_type', help='【必填】测试类型,phone、windows')
    parser.add_argument('-dif', '--devices_info_file', help='多设备并行信息文件,当--test_type为android、ios、chrome时,此选项需提供')
    args=parser.parse_args()

    # 处理pytest文件
    deal_pytest_ini_file()

    # 初始化java依赖的libs
    java_maven_init()

    if not args.test_type:
        sys.exit('请指定测试类型,查看帮助:python run_app_ui_test.py --help')
    keyword=args.keyword
    dir=args.dir
    markexpr=args.markexpr
    capture=args.capture
    reruns=args.reruns
    lf=args.lf
    test_type=args.test_type.lower()
    devices_info_file=args.devices_info_file
    if test_type=='phone':
        if not devices_info_file:
            sys.exit('请指定多设备并行信息文件,查看帮助:python run_app_ui_test.py --help')
        # 初始化进程池