From 6a5bd58576baf8caf180556035beedf486fef3dc Mon Sep 17 00:00:00 2001 From: qiaoxinjiu Date: Sat, 9 May 2026 16:14:18 +0800 Subject: [PATCH] =?UTF-8?q?feature=E4=B9=9F=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E5=8F=82=E6=95=B0=EF=BC=88=E7=94=A8=E9=80=97=E5=8F=B7?= =?UTF-8?q?=E5=88=86=E9=9A=94=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhyy/test_case/run_tests.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/zhyy/test_case/run_tests.py b/zhyy/test_case/run_tests.py index 2b3feac..4be604a 100644 --- a/zhyy/test_case/run_tests.py +++ b/zhyy/test_case/run_tests.py @@ -20,8 +20,8 @@ TEST_CASE_DIR = 'zhyy/test_case/TestCase' case_dir = os.path.join(project_root,TEST_CASE_DIR) # 报告目录 REPORT_DIR = os.path.join(os.path.dirname(current_file_path), 'reports') -ALLURE_RESULTS_DIR = os.path.join(REPORT_DIR, 'allure-results') -ALLURE_REPORT_DIR = os.path.join(REPORT_DIR, 'allure-report') +ALLURE_RESULTS_DIR = os.path.join(project_root, 'allure-results') +ALLURE_REPORT_DIR = os.path.join(project_root, 'allure-report') print(ALLURE_REPORT_DIR) def ensure_dirs(): @@ -138,7 +138,13 @@ def run_tests(target, test_type='all', **kwargs): if not test_files: print("错误: 未找到测试文件") return 1 - args = test_files + [f'--allure-features={target}'] + base_args + if ',' in target: + features = [f.strip() for f in target.split(',')] + print(f"多个feature标签: {features}") + feature_args = [f'--allure-features={f}' for f in features] + args = test_files + feature_args + base_args + else: + args = test_files + [f'--allure-features={target}'] + base_args elif test_type == 'story': print(f"按story标签运行: {target}") test_files = get_all_test_files()