-
Notifications
You must be signed in to change notification settings - Fork 4
/
jcat.sh
executable file
·41 lines (36 loc) · 908 Bytes
/
jcat.sh
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
#!/bin/sh
set -e
highlight() {
echo " >>> ${*}"
}
wait_selenium() {
highlight "Waiting for Selenium daemon is ready to accept connections..."
counter=0
while true; do
counter=$((counter+1))
( wget --quiet --output-document - ${SELENIUM_URL}/status | grep 'true,') ||
{
if test ${counter} -gt 30 ; then
echo "Operation timed out!" >&2
echo "Selenium daemon on is not ready after 30 seconds." >&2
echo "Selenium daemon URL: ${SELENIUM_URL}" >&2
exit 1
fi
echo 'Selenium daemon is not ready... Waiting one more second...'
sleep 1s
continue
}
highlight 'Selenium daemon is ready!'
break
done
}
run_jcat() {
COMMAND="java -Dselenium-url=${SELENIUM_URL} -Dbrowser=${BROWSER} -jar jcat.jar"
highlight "Run tests: ${COMMAND}"
exec ${COMMAND}
}
main() {
wait_selenium
run_jcat
}
main