Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/deploys/docker/selenium.sh
2884 views
1
#!/usr/bin/env bash
2
3
export PATH=$PATH:/opt/selenium/bin
4
5
mkdir -p ${HOME}/.vnc && x11vnc -storepasswd secret ${HOME}/.vnc/passwd
6
7
# Start the underlying X Server
8
echo "Starting xvfb"
9
10
export GEOMETRY="${SCREEN_WIDTH:-1920}""x""${SCREEN_HEIGHT:-1080}""x""${SCREEN_DEPTH:-24}"
11
12
rm -f /tmp/.X*lock
13
14
/usr/bin/Xvfb ${DISPLAY} -screen 0 ${GEOMETRY} -dpi ${SCREEN_DPI:-300} -ac +extension RANDR &
15
16
# Start the VNC server
17
X11VNC_OPTS=-usepw
18
19
for i in $(seq 1 10)
20
do
21
sleep 1
22
xdpyinfo -display ${DISPLAY} >/dev/null 2>&1
23
if [ $? -eq 0 ]; then
24
break
25
fi
26
echo "Waiting for X server..."
27
done
28
29
echo "Starting window manager"
30
fluxbox -display ${DISPLAY} &
31
32
echo "Starting vnc server"
33
34
# -noxrecord fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859213 in x11vnc 0.9.13-2
35
x11vnc ${X11VNC_OPTS} -forever -shared -rfbport 5900 -display ${DISPLAY} -noxrecord &
36
37
# Now start the Node
38
39
echo /opt/selenium/bin/selenium $@
40
/opt/selenium/bin/selenium $@
41
42