mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 23:42:12 +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=$!
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue