Files
JS-MOCHA-SE-AL/run.bat
2026-02-08 20:36:43 -06:00

82 lines
1.8 KiB
Batchfile
Raw 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
setlocal enabledelayedexpansion
REM ============================
REM QKF Full Test Runner
REM ============================
echo.
echo ============================
echo QKF Test Execution
echo ============================
echo.
REM --- Config (edit if needed) ---
set QKF_BROWSER=chrome
set QKF_HEADLESS=true
set QKF_TEST_TIMEOUT_MS=120000
set QKF_BASE_URL=http://gitea.cloud.qacg/user/login
REM --- Paths ---
set FEATURES_DIR=features
set GENERATED_DIR=test\generated
set ALLURE_RESULTS=allure-results
set ALLURE_REPORT=allure-report
REM --- Clean previous output ---
if exist "%GENERATED_DIR%" (
echo Cleaning generated specs...
rmdir /s /q "%GENERATED_DIR%"
)
if exist "%ALLURE_RESULTS%" (
echo Cleaning Allure results...
rmdir /s /q "%ALLURE_RESULTS%"
)
if exist "%ALLURE_REPORT%" (
echo Cleaning Allure report...
rmdir /s /q "%ALLURE_REPORT%"
)
REM --- Generate specs ---
echo.
echo [1/3] Generating specs from Gherkin...
node scripts\transform.js --features "%FEATURES_DIR%" --verbose
if errorlevel 1 (
echo ❌ Spec generation failed
exit /b 1
)
REM --- Run tests ---
echo.
echo [2/3] Running Mocha + Selenium + Allure...
npx mocha ^
--timeout %QKF_TEST_TIMEOUT_MS% ^
--reporter allure-mocha ^
"%GENERATED_DIR%\*.spec.js"
if errorlevel 1 (
echo ⚠️ Tests finished with failures (continuing to report generation)
)
REM --- Generate Allure report ---
echo.
echo [3/3] Generating Allure report...
allure generate "%ALLURE_RESULTS%" -o "%ALLURE_REPORT%" --clean
if errorlevel 1 (
echo ❌ Allure report generation failed
exit /b 1
)
REM --- Open report ---
echo.
echo Opening Allure report...
allure open "%ALLURE_REPORT%"
echo.
echo ✅ Done.
endlocal