[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript ScriptingTest.java,1.27,1.28
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-10-08 13:14:34
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory usw-pr-cvs1:/tmp/cvs-serv8408/test/com/meterware/httpunit/javascript Modified Files: ScriptingTest.java Log Message: some minor cleanup Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ScriptingTest.java 1 Oct 2002 16:11:49 -0000 1.27 +++ ScriptingTest.java 8 Oct 2002 13:14:31 -0000 1.28 @@ -111,6 +111,20 @@ } + public void testJavaScriptURLWithIncludedFunction() throws Exception { + defineResource( "saycheese.js", "function sayCheese() { alert( \"Cheese!\" ); }" ); + defineResource( "OnCommand.html", "<html><head><script language='JavaScript' src='saycheese.js'>" + + "</script></head>" + + "<body>" + + "<a href=\"javascript:sayCheese()\">go</a>" + + "</body></html>" ); + WebConversation wc = new WebConversation(); + WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); + response.getLinkWith( "go" ).click(); + assertEquals( "Alert message", "Cheese!", wc.popNextAlert() ); + } + + public void testSingleCommandOnLoad() throws Exception { defineResource( "OnCommand.html", "<html><head></head>" + "<body onLoad='alert(\"Ouch!\")'></body>" ); |