Skip to content

Instantly share code, notes, and snippets.

@albertopasqualetto
Created February 16, 2024 15:56
Show Gist options
  • Save albertopasqualetto/26a296a89f2ab7e34ab9e725cfdf46ed to your computer and use it in GitHub Desktop.
Save albertopasqualetto/26a296a89f2ab7e34ab9e725cfdf46ed to your computer and use it in GitHub Desktop.
Wait selenium grid until is up
#!/bin/bash
# wait-for-grid.sh
set -e
cmd="$@"
sleep 2
while ! curl -sSL "localhost: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 tests"
exec $cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment