-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·87 lines (79 loc) · 2.2 KB
/
test.sh
File metadata and controls
executable file
·87 lines (79 loc) · 2.2 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
#!/bin/bash
# Run tests for the PassGen project.
#
# Usage:
# ./test.sh # Kotlin unit tests + fast E2E tests (~10s)
# ./test.sh --full # Kotlin unit tests + ALL E2E tests (~2-3 min)
# ./test.sh --headed # Fast tests with browser visible
# ./test.sh --full --headed # All tests with browser visible
#
# Exit codes:
# 0 - All tests passed
# 1 - Tests failed
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
# Parse arguments
FULL=false
HEADED=false
for arg in "$@"; do
case $arg in
--full)
FULL=true
;;
--headed)
HEADED=true
;;
--help|-h)
echo "Usage: $0 [--full] [--headed]"
echo ""
echo "Options:"
echo " --full Include slow E2E tests (persistence scenarios)"
echo " --headed Run E2E tests with browser visible"
echo ""
echo "Examples:"
echo " $0 # Unit tests + fast E2E tests (~10s)"
echo " $0 --full # Unit tests + ALL E2E tests (~2-3 min)"
echo " $0 --headed # Fast E2E with visible browser"
echo " $0 --full --headed # All tests with visible browser"
exit 0
;;
*)
echo "Unknown option: $arg"
echo "Use --help for usage information"
exit 1
;;
esac
done
echo "==================================="
echo " PassGen Test Suite"
echo "==================================="
echo ""
# Step 1: Run Kotlin unit tests
echo ">>> Running Kotlin unit tests..."
./gradlew test
echo ""
echo "✓ Kotlin unit tests passed"
echo ""
# Step 2: Run E2E tests
if [ "$FULL" = true ]; then
echo ">>> Running ALL E2E tests (including slow tests)..."
if [ "$HEADED" = true ]; then
npm run test:e2e:headed
else
npm run test:e2e
fi
else
echo ">>> Running fast E2E tests..."
if [ "$HEADED" = true ]; then
npm run test:e2e:fast:headed
else
npm run test:e2e:fast
fi
fi
echo ""
echo "✓ E2E tests passed"
echo ""
echo "==================================="
echo " All tests passed!"
echo "==================================="