Skip to content

Commit

Permalink
Debug safaridriver
Browse files Browse the repository at this point in the history
  • Loading branch information
foolip committed Oct 20, 2018
1 parent 256ba9d commit e3f1983
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/ci/safaridriver_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ PORT=55555
"/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver" -p $PORT &
PID=$!
# safaridriver isn't immediately responsive, so loop
TMPFILE=$(mktemp)
while true; do
# https://superuser.com/a/442395
http_code=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:$PORT/status")
http_code=$(curl -s -S -o $TMPFILE -w "%{http_code}" "http://localhost:$PORT/status")
if [ "$http_code" == "200" ]; then
echo "safaridriver status OK"
break
fi
echo "waiting for safaridriver to start"
cat $TMPFILE
sleep 1
done
kill $PID

0 comments on commit e3f1983

Please sign in to comment.