[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit FormSubmitTest.java,1.21,1.22
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-08-27 16:26:07
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv9481/test/com/meterware/httpunit Modified Files: FormSubmitTest.java Log Message: Added support for reset button and associated JavaScript Index: FormSubmitTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormSubmitTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- FormSubmitTest.java 19 Aug 2002 18:52:26 -0000 1.21 +++ FormSubmitTest.java 27 Aug 2002 16:26:05 -0000 1.22 @@ -172,6 +172,22 @@ } + public void testResetButtonDetection() throws Exception { + defineWebPage( "Default", "<form method=GET action = \"/ask\">" + + "<Input type=text name=age value=12>" + + "<Input type=submit name=update>" + + "<Input type=reset id=clear>" + + "<Input type=button value=recalculate>" + + "</form>" ); + WebResponse page = _wc.getResponse( getHostPath() + "/Default.html" ); + WebForm form = page.getForms()[0]; + form.setParameter( "age", "15" ); + Button reset = form.getButtonWithID( "clear" ); + reset.click(); + assertEquals( "Value after reset", "12", form.getParameterValue( "age" ) ); + } + + public void testDisabledSubmitButtonDetection() throws Exception { defineWebPage( "Default", "<form method=GET action = \"/ask\">" + "<Input type=text name=age value=12>" + |