-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.bat
More file actions
87 lines (77 loc) · 1.73 KB
/
run_tests.bat
File metadata and controls
87 lines (77 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
setlocal enabledelayedexpansion
title Serenity BDD Test Runner
color 0A
:menu
cls
echo ====================================
echo Serenity BDD Test Runner
echo ====================================
echo 1. Run FormPage Test (Serenity)
echo 2. Clean and Run All Tests
echo 3. Generate Reports Only
echo 4. Open Last Report
echo 5. Exit
echo ====================================
set /p choice=Choose an option (1-5):
if "%choice%"=="1" (
set "test=FormTest"
goto run_test
)
if "%choice%"=="2" (
set "clean=yes"
goto run_all
)
if "%choice%"=="3" goto generate_reports
if "%choice%"=="4" goto open_report
if "%choice%"=="5" goto exit
echo Invalid option. Please choose a number between 1 and 5.
pause
goto menu
:run_test
cls
echo Running Serenity test: !test!
echo ------------------------------------
call mvn clean verify -Dtest=!test!
goto check_result
:run_all
cls
if defined clean (
echo Running ALL tests with clean...
echo ------------------------------------
call mvn clean verify
) else (
echo Running ALL tests...
echo ------------------------------------
call mvn verify
)
goto check_result
:generate_reports
cls
echo Generating Serenity reports...
echo ------------------------------------
call mvn serenity:aggregate
goto check_result
:open_report
cls
echo Opening last Serenity report...
echo ------------------------------------
start "" "target\site\serenity\index.html"
goto menu
:check_result
if %errorlevel% equ 0 (
echo.
echo TEST EXECUTION SUCCESSFUL
echo Reports available at: target\site\serenity\index.html
) else (
echo.
echo TEST EXECUTION FAILED (Error: %errorlevel%)
)
pause
set "test="
set "clean="
goto menu
:exit
echo Exiting Serenity BDD Test Runner...
pause
exit