mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 19:50:37 +00:00
Actually wait for Selenium to start.
This commit is contained in:
parent
dc368bb652
commit
689dddee7f
1 changed files with 13 additions and 1 deletions
|
|
@ -16,5 +16,17 @@ NODE_DB_URI="$TEST_DB_URI" PORT=$TEST_SERVER_PORT node ./src/server.js > /dev/nu
|
||||||
NODE_PID=$!
|
NODE_PID=$!
|
||||||
trap "kill $NODE_PID && curl http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer" EXIT
|
trap "kill $NODE_PID && curl http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer" EXIT
|
||||||
|
|
||||||
sleep 3 # Wait for Selenium
|
# Wait for selenium
|
||||||
|
MAX_WAIT=30
|
||||||
|
WAITED=0
|
||||||
|
until nc -z localhost 4444; do
|
||||||
|
if [ $WAITED -ge $MAX_WAIT ]; then
|
||||||
|
echo "Waited $MAX_WAIT seconds, but Selenium never responded" >&2
|
||||||
|
kill $NODE_PID
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
let 'WAITED+=1'
|
||||||
|
done
|
||||||
|
|
||||||
mocha && grunt karma:continuous && ./node_modules/protractor/bin/protractor protractor.conf.js
|
mocha && grunt karma:continuous && ./node_modules/protractor/bin/protractor protractor.conf.js
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue