Make continuous deployment safe by comparing before and after webpage screenshots for each release. Depicted shows when any visual, perceptual differences are found. This is the ultimate, automated end-to-end test.
Waiting for a URL to resolve with some sort of timeout will be a very common pattern for tests (in fact, I'm having trouble thinking what else you would want to wait for).
Here's the incantation I'm currently using:
waitFor: |
timeout=$(($(date +%s) + 5)) # 5 second timeout
until \
curl --silent -I 'http://localhost:5001/' | grep '200 OK' || \
[[ $(date +%s) -gt $timeout ]]; do
echo 'Waiting for server to start up...'
sleep 1
done
if [[ $(date +%s) -gt $timeout ]]; then
echo 'Server failed to start.' 1>&2
exit 1
else
echo 'Server started!'
fi
Waiting for a URL to resolve with some sort of timeout will be a very common pattern for tests (in fact, I'm having trouble thinking what else you would want to wait for).
Here's the incantation I'm currently using:
It would be better if this could be written as: