-
-
Notifications
You must be signed in to change notification settings - Fork 399
Expand file tree
/
Copy pathrunUiTests.sh
More file actions
executable file
·39 lines (30 loc) · 692 Bytes
/
Copy pathrunUiTests.sh
File metadata and controls
executable file
·39 lines (30 loc) · 692 Bytes
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
#!/bin/bash
set -e
function finish {
set +e
echo "Exiting, cleaning up.."
if [[ ! -z "$PID_MOSQUITTO" ]]; then
echo "Stopping mosquitto ($PID_MOSQUITTO).."
kill "$PID_MOSQUITTO" || echo "Already stopped"
fi
if [[ ! -z "$PID_XVFB" ]]; then
echo "Stopping XVFB ($PID_XVFB).."
kill "$PID_XVFB" || echo "Already stopped"
fi
}
trap finish EXIT
DIMENSIONS="1024x720"
SCR=99
# Start new window manager
Xvfb :$SCR -screen 0 "$DIMENSIONS"x24 -ac &
export PID_XVFB=$!
sleep 2
# Start mqtt broker
mosquitto &
export PID_MOSQUITTO=$!
sleep 1
# Run UI tests
DISPLAY=:$SCR yarn test:ui
TEST_EXIT_CODE=$?
echo "UI tests exited with $TEST_EXIT_CODE"
exit $TEST_EXIT_CODE