Skip to content

Instantly share code, notes, and snippets.

@javigomez
Created April 20, 2018 10:30
Show Gist options
  • Save javigomez/60107eadf9208abb881ba10864fc38d0 to your computer and use it in GitHub Desktop.
Save javigomez/60107eadf9208abb881ba10864fc38d0 to your computer and use it in GitHub Desktop.
Wait for Selenium Grid by @diemol
#!/bin/bash
# wait-for-grid.sh
set -e
cmd="$@"
while ! curl -sSL "http://hub:4444/wd/hub/status" 2>&1 \
| jq -r '.value.ready' 2>&1 | grep "true" >/dev/null; do
echo 'Waiting for the Grid'
sleep 1
done
>&2 echo "Selenium Grid is up - executing test"
exec $cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment