Skip to content
Browse files

Shell script is almost 100% functional. Firefox runs tests, but Safar…

…i hits an error.
  • Loading branch information...
1 parent 64d77fa commit fabfa3a6151165d53aa6802e8dfdb9ba7910f3f7 @arthurakay committed Oct 11, 2011
Showing with 20 additions and 25 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 app/controllers/Contestant.js
  3. +18 −25 test/jsTestDriver/test.sh
View
1 .gitignore
@@ -1 +1,2 @@
.idea/
+test/jsTestDriver/_results/
View
1 app/controllers/Contestant.js
@@ -59,6 +59,7 @@ Ext.regController('app.controllers.Contestant', {
},
generateWinIndex : function(contestantStore) {
+ //TODO Improve random number generator so that it never returns value of store.length
return Math.floor(Math.random() * contestantStore.getCount());
},
View
43 test/jsTestDriver/test.sh
@@ -1,30 +1,23 @@
#!/bin/bash
-while getopts "j:t:" flag
-do
- if [ $flag == "j" ]; then
- JSTD=$OPTARG
- elif [ $flag == "t" ]; then
- TESTS=$OPTARG
- fi
-done
-if [ -z "$JSTD" ]; then
- JSTD=`ls [jJ]s[tT]est[dD]river*.jar`
-fi
+# CONFIGS
+JSTD=`ls [jJ]s[tT]est[dD]river*.jar`
+PORT="4224"
+HOST=http://localhost:$PORT
+CONFIG="jsTestDriver.conf"
+OUTPUT_DIR="_results"
-if [ -z "$TESTS" ]; then
- TESTS="all"
- echo "Running all tests"
-else
- echo "Running '$TESTS'"
-fi
+# Browsers
+CHROME="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
+OPERA="/Applications/Opera.app/Contents/MacOS/Opera"
+FIREFOX="/Applications/Firefox.app/Contents/MacOS/firefox"
+SAFARI="/Applications/Safari.app/Contents/MacOS/Safari"
-FIREFOX=`which firefox`
-if [ "$?" -eq 1 ];
-then
- echo "Firefox not found."
- exit 1
-fi
+# SAFARI is currently adding a "file:///" string to the URL, so it doesn't work as expected.
+# See http://code.google.com/p/js-test-driver/wiki/ContinuousBuild
-#java -jar $JSTD --reset --tests "$TESTS"
-java -jar $JSTD --port "4224 --reset --tests "all" --config jsTestDriver.conf --browser $FIREFOX
+echo "Running all tests"
+
+java -jar $JSTD --port $PORT --reset --config $CONFIG --browser $FIREFOX --tests "all" --testOutput $OUTPUT_DIR
+
+echo "Tests complete."

0 comments on commit fabfa3a

Please sign in to comment.
Something went wrong with that request. Please try again.