File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -36,21 +36,37 @@ function killServer () {
3636
3737trap killServer EXIT
3838
39+ function waitForUrl {
40+ URL=$1
41+ COUNT=0
42+ MAX_COUNT=120
43+ until curl $URL & > /dev/null || [[ $COUNT == $MAX_COUNT ]]; do
44+ sleep 1
45+ echo waiting $(( COUNT++ )) seconds
46+ done
47+ if [[ $COUNT == $MAX_COUNT ]]; then
48+ return 1
49+ else
50+ return 0
51+ fi
52+ }
53+
3954./node_modules/.bin/webdriver-manager update
4055
4156echo Starting webserver
4257./node_modules/.bin/gulp serve.js.prod serve.js.dart2js&
4358serverPid=$!
59+ waitForUrl http://localhost:8001
60+ echo Started webserver
4461
4562if [[ $IOS_BROWSER ]]; then
4663 echo Starting ios selenium server
4764 java -jar $IOS_SERVER_BINARY -real&
4865 iosServerPid=$!
66+ waitForUrl http://localhost:5555/wd/hub
67+ echo Started ios selenium server
4968fi
5069
51- # wait for server to come up!
52- sleep 120
53-
5470if [[ $IOS_BROWSER ]]; then
5571 echo Running ios tests
5672 $PROTRACTOR protractor-js.conf.js --benchmark --browsers=$IOS_BROWSER $IOS_ARGS
You can’t perform that action at this time.
0 commit comments