[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript ScriptingTest.java,1.21,1.22
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-09-13 18:35:02
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory usw-pr-cvs1:/tmp/cvs-serv23375/test/com/meterware/httpunit/javascript Modified Files: ScriptingTest.java Log Message: Added control of script error messages Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ScriptingTest.java 5 Sep 2002 19:10:44 -0000 1.21 +++ ScriptingTest.java 13 Sep 2002 18:34:58 -0000 1.22 @@ -106,6 +106,21 @@ } + public void testOnLoadErrorBypass() throws Exception { + defineResource( "OnCommand.html", "<html><head></head>" + + "<body onLoad='noSuchFunction()'>" + + "<img src=sample.jpg>" + + "</body>" ); + WebConversation wc = new WebConversation(); + HttpUnitOptions.setExceptionsThrownOnScriptError( false ); + HttpUnitOptions.clearScriptErrorMessages(); + + WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); + assertEquals( "Number of images on page", 1, response.getImages().length ); + assertEquals( "Number of script failures logged", 1, HttpUnitOptions.getScriptErrorMessages().length ); + } + + public void testConfirmationDialog() throws Exception { defineWebPage( "OnCommand", "<a href='NextPage' id='go' onClick='return confirm( \"go on?\" );'>" ); defineResource( "NextPage", "Got the next page!" ); |