[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript FormScriptingTest.java,1.23,1
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-06-23 23:54:07
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv1669/test/com/meterware/httpunit/javascript
Modified Files:
FormScriptingTest.java
Log Message:
Resolve several feature requests
Index: FormScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- FormScriptingTest.java 23 May 2003 21:55:12 -0000 1.23
+++ FormScriptingTest.java 23 Jun 2003 23:54:04 -0000 1.24
@@ -28,6 +28,7 @@
import junit.textui.TestRunner;
import junit.framework.TestSuite;
+import org.xml.sax.SAXException;
/**
@@ -212,6 +213,26 @@
response.getFormWithName( "spectrum" ).getButtons()[0].click();
assertEquals( "Result of submit", "You made it!", wc.getCurrentPage().getText() );
+ }
+
+
+ public void testDisabledScriptButton() throws Exception {
+ defineResource( "DoIt?color=green", "You made it!" );
+ defineResource( "OnCommand.html", "<html><head></head>" +
+ "<body>" +
+ "<form name=spectrum action='DoIt' onsubmit='return false;'>" +
+ " <input type=text name=color value=green>" +
+ " <input type=button id=submitButton disabled value=submit onClick='this.form.submit();'>" +
+ "</form>" +
+ "<a href='#' onClick='document.spectrum.submit(); return false;'>" +
+ "</body></html>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+
+ try {
+ response.getFormWithName( "spectrum" ).getButtons()[0].click();
+ fail( "Should not have permitted click of disabled button" );
+ } catch (IllegalStateException e) {}
}
|