feat: 新增售后政策管理接口测试用例
- 新增售后政策管理接口方法到 Dlizhan_interface.py - 新增 AfterSalesPolicyManage.py 业务关键字层 - 新增 Joyhub_AfterSalesPolicy.py 测试用例文件 - 修复 Jenkins Allure 报告路径配置问题
This commit is contained in:
@@ -22,8 +22,8 @@ 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')
|
||||
ALLURE_PATH = os.path.join(project_root, 'allure', 'allure-2.28.0', 'bin', 'allure.bat')
|
||||
|
||||
print(ALLURE_REPORT_DIR)
|
||||
@@ -44,11 +44,13 @@ def run_pytest(args_list):
|
||||
# 检测Jenkins环境
|
||||
is_jenkins = 'JENKINS_URL' in env or 'BUILD_NUMBER' in env
|
||||
if is_jenkins and 'WORKSPACE' in env:
|
||||
# Jenkins环境下使用绝对路径
|
||||
# Jenkins环境下使用绝对路径 - 确保与Jenkins Allure插件配置一致
|
||||
global ALLURE_RESULTS_DIR, ALLURE_REPORT_DIR
|
||||
ALLURE_RESULTS_DIR = os.path.join(env['WORKSPACE'], 'dulizhan', 'test_case', 'reports', 'allure-results')
|
||||
ALLURE_REPORT_DIR = os.path.join(env['WORKSPACE'], 'dulizhan', 'test_case', 'reports', 'allure-report')
|
||||
# Jenkins配置的路径是 /home/dulizhan/allure-report
|
||||
ALLURE_RESULTS_DIR = os.path.join(env['WORKSPACE'], 'allure-results')
|
||||
ALLURE_REPORT_DIR = os.path.join(env['WORKSPACE'], 'allure-report')
|
||||
ensure_dirs()
|
||||
print(f"Jenkins环境检测到,使用路径: {ALLURE_RESULTS_DIR}")
|
||||
|
||||
cmd = ['python', '-m', 'pytest'] + args_list
|
||||
print("执行命令: {}".format(' '.join(cmd)))
|
||||
|
||||
Reference in New Issue
Block a user