Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 106 lines (93 sloc) 2.528 kB
#!/usr/bin/env bash
#
# Usage: test <case>
#
source $(dirname $0)/util
EXPECTED_ARGS=1
E_BADARGS=65
DO_showUsage() {
echo "Usage: $(basename $0) {all|core|remote|taxi|window}"
exit $E_BADARGS
}
if [ $# -ne $EXPECTED_ARGS ]; then
DO_showUsage
fi
################################################################################
GRID_RUNNING_DEFAULT=no
GRID_HOST_DEFAULT=127.0.0.1
# API default is 4444, so for testing we'll use 3333
GRID_PORT_DEFAULT=3333
DO_testCore() {
echo ""
echo "##################"
echo "## Testing Core ##"
echo "##################"
echo ""
lein test clj-webdriver.test.util-test
lein test clj-webdriver.test.firefox
lein test clj-webdriver.test.chrome
}
DO_testRemote() {
echo ""
echo "####################"
echo "## Testing Remote ##"
echo "####################"
echo ""
echo -n "Do you have an existing Grid running, yes or no? [${GRID_RUNNING_DEFAULT}] > "
read GRID_RUNNING_DEFAULT
shopt -s nocasematch
if [ "$GRID_RUNNING_DEFAULT" = "yes" ]; then
echo -n "Please enter the ${txtund}${regblu}host${txtrst} on which your Grid hub is running: [${GRID_HOST_DEFAULT}] > "
read WEBDRIVER_GRID_HOST
if [ -z $WEBDRIVER_GRID_HOST ]; then
export WEBDRIVER_GRID_HOST="${GRID_HOST_DEFAULT}"
fi
echo -n "Please enter the ${txtund}${regblu}port${txtrst} on which your Grid hub is listening: [${GRID_PORT_DEFAULT}] > "
read WEBDRIVER_GRID_PORT
if [ -z $WEBDRIVER_GRID_PORT ]; then
export WEBDRIVER_GRID_PORT="${GRID_PORT_DEFAULT}"
fi
lein test clj-webdriver.test.remote-existing
fi
lein test clj-webdriver.test.remote
lein test clj-webdriver.test.remote-capabilities
lein test clj-webdriver.test.wire
}
DO_testTaxi() {
echo ""
echo "##################"
echo "## Testing Taxi ##"
echo "##################"
echo ""
lein test clj-webdriver.test.taxi
}
DO_testWindow() {
echo ""
echo "#############################"
echo "## Testing Window Handling ##"
echo "#############################"
echo ""
lein test clj-webdriver.test.window
}
case "$1" in
all)
DO_testRemote
DO_testCore
DO_testTaxi
DO_testWindow
;;
core)
DO_testCore
;;
remote)
DO_testRemote
;;
taxi)
DO_testTaxi
;;
window)
DO_testWindow
;;
*)
DO_showUsage
esac
Jump to Line
Something went wrong with that request. Please try again.