[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript FormScriptingTest.java,1.16,1
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-02-17 03:17:09
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv17624/test/com/meterware/httpunit/javascript
Modified Files:
FormScriptingTest.java
Log Message:
#682518: now run onClick script when WebForm.submit(button) is called
Index: FormScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- FormScriptingTest.java 27 Dec 2002 05:09:38 -0000 1.16
+++ FormScriptingTest.java 17 Feb 2003 03:17:05 -0000 1.17
@@ -232,6 +232,23 @@
}
+ public void testSubmitButtonScript() throws Exception {
+ defineResource( "DoIt?color=green", "You made it!" );
+ defineResource( "OnCommand.html", "<html><head></head>" +
+ "<body>" +
+ "<form name=spectrum action='DoIt'>" +
+ " <input type=text name=color value=red>" +
+ " <input type=submit onClick='form.color.value=\"green\";'>" +
+ "</form>" +
+ "</body></html>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+
+ response.getFormWithName( "spectrum" ).submit();
+ assertEquals( "Result of submit", "You made it!", wc.getCurrentPage().getText() );
+ }
+
+
public void testSetFormTextValue() throws Exception {
defineResource( "OnCommand.html", "<html><head></head>" +
"<body onLoad=\"document.realform.color.value='green'\">" +
|