[KSS-checkins] r49262 - in kukit/kss.core/trunk/kss/core/plugins/core/demo: parameterfunction selenium_tests

jvloothuis at codespeak.net jvloothuis at codespeak.net
Sun Dec 2 09:12:02 CET 2007


Author: jvloothuis
Date: Sun Dec  2 09:12:02 2007
New Revision: 49262

Modified:
   kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/forms.pt
   kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/parameterfunction_view.py
   kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/pf_forms.html
Log:

Added an explicit test for multi selection fields. This proves that
these work as they should when submitting a full form. To prove this
the server side handler returns a sorted list of (key, value) tuples
(not a dict since the ordering of that might change between test
runs).


Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/forms.pt
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/forms.pt	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/forms.pt	Sun Dec  2 09:12:02 2007
@@ -182,7 +182,7 @@
       <div class="help">
           Click the button.
       </div>
-      <a class="button click cursorPointer" id="fullform-current">Click me !</a>
+      <a class="button click cursorPointer" id="fullform-current" href="#">Click me !</a>
       <fieldset>
         value1:
         <input class="click cursorPointer" 
@@ -197,6 +197,12 @@
         <input class="click cursorPointer" 
                type="text" name="listval:list" value="listval2"/>
         <br>
+        listval with multiselect:
+        <select name="multiple-select:list" multiple="multiple">
+          <option selected="selected">Value 1</option>
+          <option>Value 2</option>
+          <option selected="selected">Value 3</option>
+        </select>
         recordval:
         <input class="click cursorPointer" 
                type="text" name="recordval.a:record" value="recordval_a"/>

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/parameterfunction_view.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/parameterfunction_view.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/parameterfunction/parameterfunction_view.py	Sun Dec  2 09:12:02 2007
@@ -19,4 +19,5 @@
     def submitFullFormIntoRequest(self):
         # marshall back the repr of this dict.
         ksscore = self.getCommandSet('core')
-        ksscore.replaceInnerHTML('#target', repr(self.request.form))
+        ksscore.replaceInnerHTML('#target', repr(list(sorted(
+                        self.request.form.items()))))

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/pf_forms.html
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/pf_forms.html	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/pf_forms.html	Sun Dec  2 09:12:02 2007
@@ -113,6 +113,21 @@
 	<td>target</td>
 	<td>radio-2</td>
 </tr>
+<tr>
+	<td>click</td>
+	<td>fullform-current</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForText</td>
+	<td>target</td>
+	<td>[('listval', ['listval1', 'listval2']), ('multiple-select', ['Value 1', 'Value 3']), ('recordsval', [{'a': 'recordval_a_1', 'b': 'recordval_b_1'}, {'a': 'recordval_a_2', 'b': 'recordval_b_2'}]), ('recordval', {'a': 'recordval_a', 'b': 'recordval_b'}), ('value1', 'value1'), ('value2', 'value2')]</td>
+</tr>
+<tr>
+	<td>verifyTextPresent</td>
+	<td>[('listval', ['listval1', 'listval2']), ('multiple-select', ['Value 1', 'Value 3']), ('recordsval', [{'a': 'recordval_a_1', 'b': 'recordval_b_1'}, {'a': 'recordval_a_2', 'b': 'recordval_b_2'}]), ('recordval', {'a': 'recordval_a', 'b': 'recordval_b'}), ('value1', 'value1'), ('value2', 'value2')]</td>
+	<td></td>
+</tr>
 
 </tbody></table>
 </body>


More information about the Kukit-checkins mailing list