Skip to content
Snippets Groups Projects

Resolve "Optimize waiting time for starting e2e tests"

Merged David Dorchies requested to merge 647-optimize-waiting-time-for-starting-e2e-tests into devel
2 files
+ 27
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 25
0
#!/usr/bin/env bash
# Inspired from https://stackoverflow.com/a/25042323/5300212
# How to run e2e test after serving the app
# Start the web app
npm start &
NG_SERVE_PID=$!
echo "**************************************************************************"
echo "Just in case... Use kill -9 -${NG_SERVE_PID} to kill the server if something goes wrong"
echo "**************************************************************************"
# Wait for http response 200 on port 4200
response=0
while [ "$response" != "200" ]; do
response=$(curl --write-out '%{http_code}' --silent --output /dev/null 127.0.0.1:4200 || echo 0)
sleep 5;
done
# Run wdio
npm run e2equick
# Cleanup daemon processes
kill -9 -$NG_SERVE_PID
Loading