Created
February 16, 2024 15:56
-
-
Save albertopasqualetto/26a296a89f2ab7e34ab9e725cfdf46ed to your computer and use it in GitHub Desktop.
Wait selenium grid until is up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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