selenium / run-tests.sh

#!/bin/bash
# Run the test suite

jar=$(./selenium.sh jar)
if [ ! -f $jar ]; then
	echo "error: can't find ${jar} (use './selenium.sh download' to get it)"
	exit 1
fi

./selenium.sh start
# Wait for selenium to start
max_wait=20
start_time=$(date +%s)
while true;
do
	now=$(date +%s)
	wait_time=$((now - start_time))
	curl -s http://127.0.0.1:4444/wd/hub > /dev/null
	if [ $? -eq 0 ]; then
		echo "selenium server started after ${wait_time} seconds"
		break
	fi
	if [ $wait_time -gt $max_wait ]; then
		echo "error: selenium server didn't start after ${max_wait} seconds"
		./selenium.sh stop
		exit 1
	fi
done

GOPATH=$(dirname $(dirname $PWD)) go test -v $@ selenium -test.parallel 4
value=$!
./selenium.sh stop
exit $value
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.