forked from rmurphey/srchr
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up subtests and removed search_tabs directory, which was not …
…being used.
- Loading branch information
jeremyckahn
committed
Oct 16, 2010
1 parent
7a56aa4
commit e046bda
Showing
16 changed files
with
125 additions
and
196 deletions.
There are no files selected for viewing
Submodule documentjs
updated
from 279627 to bfa20d
Submodule funcunit
updated
from 469366 to e8c413
Submodule jquery
updated
from a52a7a to 7c69de
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,59 @@ | ||
:: This script checks for arguments, if they don't exist it opens the Rhino dialog | ||
:: if arguments do exist, it loads the script in the first argument and passes the other arguments to the script | ||
:: ie: js jmvc\script\controller Todo | ||
@echo off | ||
SETLOCAL ENABLEDELAYEDEXPANSION | ||
if "%1"=="" ( | ||
java -cp steal\rhino\js.jar org.mozilla.javascript.tools.shell.Main | ||
GOTO END | ||
) | ||
if "%1"=="-h" GOTO PRINT_HELP | ||
if "%1"=="-?" GOTO PRINT_HELP | ||
if "%1"=="--help" GOTO PRINT_HELP | ||
|
||
if "%1"=="-d" ( | ||
java -classpath funcunit/java/selenium-java-client-driver.jar;steal/rhino/js.jar org.mozilla.javascript.tools.debugger.Main | ||
GOTO END | ||
) | ||
if "%1"=="-selenium" ( | ||
java -jar funcunit\java\selenium-server.jar | ||
GOTO END | ||
) | ||
SET CP=funcunit/java/selenium-java-client-driver.jar;steal\rhino\js.jar | ||
if "%1"=="-mail" ( | ||
SET CP=steal/rhino/mail.jar;funcunit/java/selenium-java-client-driver.jar;steal\rhino\js.jar | ||
SHIFT /0 | ||
) | ||
SET ARGS=[ | ||
SET FILENAME=%1 | ||
SET FILENAME=%FILENAME:\=/% | ||
::haven't seen any way to loop through all args yet, so for now this goes through arg 2-7 | ||
for /f "tokens=2,3,4,5,6,7 delims= " %%a in ("%*") do SET ARGS=!ARGS!'%%a','%%b','%%c','%%d','%%e','%%f' | ||
::remove the empty args | ||
:: for %%a in (",''=") do ( call set ARGS=%%ARGS:%%~a%% ) | ||
SET ARGS=%ARGS:,''=% | ||
::remove the spaces | ||
:: for /f "tokens=1*" %%A in ("%ARGS%") do SET ARGS=%%A | ||
SET ARGS=%ARGS: =% | ||
SET ARGS=%ARGS%] | ||
set ARGS=%ARGS:\=/% | ||
java -Xmx170m -Xss1024k -cp %CP% org.mozilla.javascript.tools.shell.Main -opt -1 -e _args=%ARGS% -e load('%FILENAME%') | ||
|
||
GOTO END | ||
|
||
:PRINT_HELP | ||
echo Load a command line Rhino JavaScript environment or run JavaScript script files in Rhino. | ||
echo Available commands: | ||
echo js Opens a command line JavaScript environment | ||
echo js -d Opens the Rhino debugger | ||
echo js -selenium Starts selenium server | ||
echo js [FILE] Runs FILE in the Rhino environment | ||
|
||
echo JavaScriptMVC script usage: | ||
echo js steal/generate/app [NAME] Creates a new JavaScriptMVC application | ||
echo js steal/generate/page [APP] [PAGE] Generates a page for the application | ||
echo js steal/generate/controller [NAME] Generates a Controller file | ||
echo js steal/generate/model [TYPE] [NAME] Generates a Model file | ||
echo js apps/[NAME]/compress.js Compress your application and generate documentation | ||
|
||
:END |
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 |
---|---|---|
@@ -1,51 +1,43 @@ | ||
module("srchr/history",{ | ||
setup : function(){ | ||
S.open('//srchr/history/history.html') | ||
S.open('//srchr/history/history.html'); | ||
} | ||
}); | ||
|
||
|
||
test("Add and remove history", function(){ | ||
|
||
S("#searchText").type("hello world\r", function(){ | ||
|
||
equals( S(".search:contains('hello world')").size(), 1 , "there is one hello world" ); | ||
|
||
}); | ||
|
||
S(".search:contains('hello world')").find(".remove").click() | ||
S(".search:contains('hello world')").find(".remove").click(); | ||
|
||
S(".search:contains('hello world')").size(0, function(){ | ||
ok("no more world") | ||
ok('no more "hello world"'); | ||
}); | ||
|
||
}); | ||
|
||
|
||
test("add and refresh", function(){ | ||
test("Add and refresh", function(){ | ||
|
||
S("#searchText").type("hello world\r", function(){ | ||
|
||
equals( S(".search:contains('hello world')").size(), 1 , "there is one hello world" ); | ||
|
||
}); | ||
|
||
S(".search:contains('hello world')").find(".remove").click() | ||
}) | ||
S(".search:contains('hello world')").find(".remove").click(); | ||
}); | ||
|
||
test("populate search", function(){ | ||
test("Populate search", function(){ | ||
|
||
S("#searchText").type("hello world\r", function(){ | ||
|
||
equals( S(".search:contains('hello world')").size(), 1 , "there is one hello world" ); | ||
|
||
}) | ||
//.type("[ctrl]a[ctrl-up]\b"); | ||
.type("\b\b\b\b\b\b\b\b\b\b\b\b\b") | ||
}); | ||
|
||
S('.search').visible() | ||
S('.search').visible(); | ||
|
||
S(".search").click( function(){ | ||
equals( S("#searchText").val(), "hello world" , "hello world is set again" ); | ||
|
||
S(".search:contains('hello world')").click( function(){ | ||
equals( S("#searchText").val(), "hello world" , "hello world is set again" ); | ||
}); | ||
}) | ||
}); |
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 |
---|---|---|
@@ -1,75 +1,69 @@ | ||
module("srchr/search",{ | ||
setup : function(){ | ||
S.open('//srchr/search/search.html') | ||
S.open('//srchr/search/search.html'); | ||
} | ||
}); | ||
|
||
function search(query){ | ||
S('input[name=query]').type(query+"\r") | ||
S('input[name=query]').type(query+"\r"); | ||
} | ||
|
||
// This wait is needed because IE is slow to clear out the textbox when clicked | ||
function clearout(){ | ||
S('input[name=query]').click() | ||
S('input[name=query]').val(new String()) | ||
S('input[name=query]').click(); | ||
S('input[name=query]').val(new String()); | ||
} | ||
|
||
|
||
test("Empty the search field and blur it", function(){ | ||
S('input[name=query]').click(function(){ | ||
ok(!S('input[name=query]').val().length, 'Text field is empty!') | ||
}) | ||
|
||
ok(!S('input[name=query]').val().length, 'Text field is empty!'); | ||
}); | ||
|
||
S('html').click( function(){ | ||
|
||
|
||
ok(S('input[name=query]').val(), 'Text field is filled!') | ||
ok(S('input[name=query]').hasClass('blurred'), 'Clicked query box is grayed out') | ||
}) | ||
}); | ||
|
||
}); | ||
|
||
|
||
test("Selected search box is not blurred and is empty", function(){ | ||
|
||
S('input[name=query]').click({}, function(){ | ||
ok(!S('input[name=query]').hasClass('blurred'), 'Clicked query box is not grayed out') | ||
|
||
ok(!S('input[name=query]').hasClass('blurred'), 'Clicked query box is not grayed out'); | ||
}) | ||
}); | ||
|
||
test("Submit form with no query and no type", function(){ | ||
S('input[type=submit]').click({}, function(){ | ||
|
||
S('input[type=submit]').click() | ||
|
||
S.wait(20, function(){ | ||
ok(!S('#results').text(), "A search was not submitted: no query and no type") | ||
}) | ||
}); | ||
|
||
test("Submit form with a query but no type", function(){ | ||
clearout() | ||
clearout(); | ||
|
||
S('input[name=query]').type('hello world') | ||
S('input[type=submit]').click() | ||
|
||
S.wait(20, function(){ | ||
S('input[type=submit]').click({}, function(){ | ||
ok(!S('#results').text(), "A search was not submitted: valid query, no type") | ||
}) | ||
|
||
}); | ||
|
||
test("Submit form with a valid query and type", function(){ | ||
|
||
clearout() | ||
clearout(); | ||
|
||
S('input[name=query]').type('testing...', function(){ | ||
S('input[type=checkbox]:eq(0)').click({}, function(){ | ||
|
||
S('input[type=submit]').click() | ||
|
||
S.wait(100, function(){ | ||
ok(S('#results').text(), "A search was submitted, valid query and type") | ||
}) | ||
}) | ||
}) | ||
S('input[type=submit]').click({}, function(){ | ||
ok(S('#results').text(), "A search was submitted, valid query and type"); | ||
}); | ||
}); | ||
}); | ||
|
||
}); |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.