Files
smart-management-auto-test/zhyy/test_case/jenkins_build.bat
qiaoxinjiu 6994b185a3 addproject
2026-01-22 19:10:37 +08:00

45 lines
1.3 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
REM Jenkins构建脚本Windows
REM 用于在Jenkins中执行测试并生成Allure报告
setlocal enabledelayedexpansion
REM 设置工作目录
if defined WORKSPACE (
cd /d %WORKSPACE%
) else (
cd /d %~dp0..
)
REM 进入测试目录
cd zhyy\test_case
REM 运行测试(根据参数选择运行方式)
if "%RUN_TYPE%"=="" set RUN_TYPE=all
if "%RUN_TYPE%"=="all" (
python run_tests.py --all --no-report
) else if "%RUN_TYPE%"=="feature" (
python run_tests.py --feature "%FEATURE_NAME%" --no-report
) else if "%RUN_TYPE%"=="story" (
python run_tests.py --story "%STORY_NAME%" --no-report
) else if "%RUN_TYPE%"=="dir" (
python run_tests.py --dir "%DIR_PATH%" --no-report
) else if "%RUN_TYPE%"=="file" (
python run_tests.py --file "%FILE_PATH%" --no-report
) else if "%RUN_TYPE%"=="keyword" (
python run_tests.py --keyword "%KEYWORD%" --no-report
) else if "%RUN_TYPE%"=="marker" (
python run_tests.py --marker "%MARKER%" --no-report
) else (
echo 未知的运行类型: %RUN_TYPE%
exit /b 1
)
REM 生成Allure报告Jenkins插件会自动处理这里可选
REM allure generate reports\allure-results -o reports\allure-report --clean
echo 测试执行完成Allure结果已保存到: reports\allure-results
endlocal