forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·47 lines (40 loc) · 1.26 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·47 lines (40 loc) · 1.26 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
#!/usr/bin/env bash
# Omi App — Test Runner
# Usage:
# bash app/scripts/test.sh # Run unit + widget tests
# bash app/scripts/test.sh --e2e # Run Maestro E2E functional tests
# bash app/scripts/test.sh --e2e --tags all # Run all E2E tests (incl. device-required)
# bash app/scripts/test.sh --all # Run everything
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APP_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
RUN_UNIT=false
RUN_E2E=false
E2E_ARGS=()
# Parse args
if [[ $# -eq 0 ]]; then
RUN_UNIT=true
fi
while [[ $# -gt 0 ]]; do
case "$1" in
--e2e) RUN_E2E=true; shift ;;
--all) RUN_UNIT=true; RUN_E2E=true; shift ;;
--tags) E2E_ARGS+=(--tags "$2"); shift 2 ;;
--device-id) E2E_ARGS+=(--device-id "$2"); shift 2 ;;
*) E2E_ARGS+=("$1"); shift ;;
esac
done
# Run unit/widget tests
if $RUN_UNIT; then
echo "🧪 Running unit & widget tests..."
cd "$APP_DIR"
bash scripts/validate_mobile_build_config_test.sh
bash scripts/mobile_build_wrapper_test.sh
flutter test
echo ""
fi
# Run E2E functional tests
if $RUN_E2E; then
echo "🎭 Running Maestro E2E functional tests..."
bash "$APP_DIR/.maestro/scripts/run_all.sh" "${E2E_ARGS[@]}"
fi