2023-03-23 14:46:25 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
2023-03-27 11:40:49 +02:00
|
|
|
# DISPLAY variable is used by Selenium to know which X server to use
|
2023-03-23 14:46:25 +01:00
|
|
|
export DISPLAY_NUM=99
|
|
|
|
export DISPLAY=":${DISPLAY_NUM}"
|
|
|
|
|
2023-03-27 11:40:49 +02:00
|
|
|
# Wait for Xvfb to be ready. If not ready after 2 seconds, try next display
|
2023-03-23 14:46:25 +01:00
|
|
|
while ! xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; do
|
|
|
|
DISPLAY_NUM=$((DISPLAY_NUM+1))
|
|
|
|
DISPLAY=":${DISPLAY_NUM}"
|
|
|
|
echo "Trying to launch XVFB on display ${DISPLAY}..."
|
|
|
|
/usr/bin/Xvfb "${DISPLAY}" -screen 0 1280x720x16 &
|
|
|
|
sleep 2s
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Running tests... Please wait..."
|
|
|
|
|
|
|
|
python3 main.py "$@"
|