feature也支持多个参数(用逗号分隔)

This commit is contained in:
qiaoxinjiu
2026-05-09 16:14:18 +08:00
parent 0302d713e0
commit 6a5bd58576

View File

@@ -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()