forked from silverstripe/silverstripe-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENHANCEMENT Allowing JSTestDriver execution in tests/javascript/ by a…
…dding bash scripts and new Makefile command ("make jasmine")
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
server: http://localhost:9876 | ||
|
||
load: | ||
- ../../thirdparty/jasmine/lib/jasmine.js | ||
- ../../thirdparty/jasmine/lib/jasmine-html.js | ||
- ../../thirdparty/jasmine-jstd-adapter/src/JasmineAdapter.js | ||
- ../../thirdparty/jasmine-jquery/lib/jasmine-jquery.js | ||
- ../../thirdparty/jasmine-dom/lib/jasmine-dom-fixtures.js | ||
- ../../thirdparty/jasmine-ajax/lib/mock-ajax.js | ||
- ../../thirdparty/jasmine-ajax/lib/spec-helper.js | ||
- ../../thirdparty/jquery/jquery.js | ||
- ../../thirdparty/jquery-entwine/dist/* | ||
- ../../thirdparty/jstree/jquery.jstree.js | ||
- ../../javascript/TreeDropdownField.js | ||
- TreeDropdownField/TreeDropdownField.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
while getopts "j:p:" flag | ||
do | ||
if [ $flag == "j" ]; then | ||
JSTD=$OPTARG | ||
elif [ $flag == "p" ]; then | ||
PORT=$OPTARG | ||
fi | ||
done | ||
|
||
TESTPATH=`dirname $0` | ||
|
||
if [ -z "$PORT" ]; then | ||
PORT=9876 | ||
fi | ||
|
||
if [ -z "$JSTD" ]; then | ||
# Download test driver dependency if required (too large to include in core) | ||
JSTD="$TESTPATH/JsTestDriver-1.3.1.jar" | ||
if [ ! -f $JSTD ]; then | ||
wget -O $JSTD http://js-test-driver.googlecode.com/files/JsTestDriver-1.3.1.jar | ||
fi | ||
fi | ||
|
||
echo "####################################################" | ||
echo "Please capture a browser by visiting http://localhost:$PORT" | ||
echo "Run tests by executing ./tests/javascript/test.sh" | ||
echo "####################################################" | ||
|
||
java -jar $JSTD --port $PORT --config "$TESTPATH/jstestdriver.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
while getopts "j:t:" flag | ||
do | ||
if [ $flag == "j" ]; then | ||
JSTD=$OPTARG | ||
elif [ $flag == "t" ]; then | ||
TESTS=$OPTARG | ||
fi | ||
done | ||
|
||
TESTPATH=`dirname $0` | ||
|
||
if [ -z "$JSTD" ]; then | ||
# Download test driver dependency if required (too large to include in core) | ||
JSTD="$TESTPATH/JsTestDriver-1.3.1.jar" | ||
if [ ! -f $JSTD ]; then | ||
wget -O $JSTD http://js-test-driver.googlecode.com/files/JsTestDriver-1.3.1.jar | ||
fi | ||
fi | ||
|
||
if [ -z "$TESTS" ]; then | ||
TESTS="all" | ||
echo "Running all tests" | ||
else | ||
echo "Running '$TESTS'" | ||
fi | ||
|
||
java -jar $JSTD --reset --config "$TESTPATH/jstestdriver.conf" --tests "$TESTS" |