[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript FormScriptingTest.java,1.20,1
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-04-01 13:42:15
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv11716/test/com/meterware/httpunit/javascript
Modified Files:
FormScriptingTest.java
Log Message:
#709979: Correct Select.selectedIndex when nothing selected
Index: FormScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- FormScriptingTest.java 14 Mar 2003 17:41:30 -0000 1.20
+++ FormScriptingTest.java 1 Apr 2003 13:42:09 -0000 1.21
@@ -599,6 +599,29 @@
public void testFormSelectWriteableProperties() throws Exception {
+ defineResource( "OnCommand.html", "<html><head></head>" +
+ "<body>" +
+ "<form name='the_form'>" +
+ " <select name='choices'>" +
+ " <option value='1'>red" +
+ " <option value='3'>blue" +
+ " <option value='5'>green" +
+ " <option value='7'>azure" +
+ " </select>" +
+ "</form>" +
+ "<a href='#' onclick='alert( \"Selected index is \" + document.the_form.choices.selectedIndex );'>" +
+ "</body></html>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ WebForm form = response.getFormWithName( "the_form" );
+ assertEquals( "initial selection", "1", form.getParameterValue( "choices" ) );
+
+ response.getLinks()[0].click();
+ assertEquals( "Notification", "Selected index is 0", wc.popNextAlert() );
+ }
+
+
+ public void testFormSelectDefaultProperties() throws Exception {
defineResource( "OnCommand.html", "<html><head><script language='JavaScript'>" +
"function selectOptionNum( the_select, index ) { \n" +
" for (var i = 0; i < the_select.length; i++) {\n" +
|