-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun-component-tests.sh
More file actions
executable file
·72 lines (63 loc) · 2 KB
/
run-component-tests.sh
File metadata and controls
executable file
·72 lines (63 loc) · 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
#!/bin/bash
# Bgee Component Tests Runner
# This script runs end-to-end tests for the GeneExpressionMatrix and GeneExpressionGraph components
echo "Bgee Component Tests Runner"
echo "==============================="
# Check if the dev server is running
if ! curl -s http://localhost:5173 > /dev/null; then
echo "Development server is not running on http://localhost:5173"
echo "Please start the dev server first with: npm run dev"
exit 1
fi
echo "Development server is running"
echo ""
# Function to run specific test file
run_test() {
local test_file=$1
local test_name=$2
echo "Running $test_name tests..."
echo "----------------------------------------"
if npx playwright test "$test_file" --headed; then
echo "$test_name tests passed!"
else
echo "$test_name tests failed!"
return 1
fi
echo ""
}
# Check command line arguments
if [ $# -eq 0 ]; then
echo "Usage: $0 [matrix|graph|website|all]"
echo ""
echo "Options:"
echo " matrix - Run GeneExpressionMatrix page tests"
echo " graph - Run GeneExpressionGraph component tests"
echo " website - Run general website tests"
echo " all - Run all component tests"
echo ""
exit 1
fi
case $1 in
"matrix")
run_test "tests/gene-expression-matrix.test.ts" "GeneExpressionMatrix"
;;
"graph")
run_test "tests/gene-expression-graph.test.ts" "GeneExpressionGraph"
;;
"website")
run_test "tests/website.test.ts" "Website"
;;
"all")
echo "Running all component tests..."
echo ""
run_test "tests/gene-expression-matrix.test.ts" "GeneExpressionMatrix"
run_test "tests/gene-expression-graph.test.ts" "GeneExpressionGraph"
run_test "tests/website.test.ts" "Website"
echo "All component tests completed!"
;;
*)
echo "Invalid option: $1"
echo "Use 'matrix', 'graph', 'website', or 'all'"
exit 1
;;
esac