[Erp5-report] r9855 - in /erp5/trunk/bt5/erp5_ui_test: PathTemplateItem/portal_tests/listbo...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 12 23:04:25 CEST 2006


Author: jerome
Date: Tue Sep 12 23:04:18 2006
New Revision: 9855

URL: http://svn.erp5.org?rev=9855&view=rev
Log:
test listbox updating selection's checked uids when calling an object action.


Added:
    erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testSelectionCheckedUids.xml
    erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_getSelectionCheckedUidsAsHtml.xml
Modified:
    erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testExchangeActions.xml
    erp5/trunk/bt5/erp5_ui_test/bt/revision

Added: erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testSelectionCheckedUids.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testSelectionCheckedUids.xml?rev=9855&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testSelectionCheckedUids.xml (added)
+++ erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testSelectionCheckedUids.xml Tue Sep 12 23:04:18 2006
@@ -1,0 +1,281 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PageTemplates.ZopePageTemplate</string>
+          <string>ZopePageTemplate</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_dav_writelocks</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
+      xmlns:metal="http://xml.zope.org/namespaces/metal">\n
+<head>\n
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
+<title>Test View Mode</title>\n
+</head>\n
+<body>\n
+<table cellpadding="1" cellspacing="1" border="1">\n
+<thead>\n
+<tr><td rowspan="1" colspan="3">Test View Mode</td></tr>\n
+</thead><tbody>\n
+<tal:block metal:use-macro="here/ListBoxZuite_CommonTemplate/macros/init" />\n
+<tr>\n
+  <td>open</td>\n
+  <td>${base_url}/foo_module/FooModule_createObjects?num:int=5</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertTextPresent</td>\n
+  <td>Created Successfully.</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>open</td>\n
+  <td>${base_url}/portal_types/Foo Module/PortalType_addAction?id=test_action&amp;name=Dummy Action&amp;category=object_action&amp;action=string:%24{object_url}/ListBoxZuite_getSelectionCheckedUidsAsHtml</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>open</td>\n
+  <td>${base_url}/foo_module/ListBoxZuite_waitForActivities</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertTextPresent</td>\n
+  <td>Done.</td>\n
+  <td></td>\n
+</tr>\n
+\n
+<!-- If the list is filtered when invoking an action from object_action, the\n
+selection\'s checked uids are set to the uids of the filtered objects. -->\n
+<tr>\n
+  <td>open</td>\n
+  <td>${base_url}/foo_module/view</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Folder_filter:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>click</td>\n
+  <td>//tr[@id=\'listbox_data_line_1\']/td[1]/input</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Folder_filter:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>selectAndWait</td>\n
+  <td>select_action</td>\n
+  <td>Dummy Action</td>\n
+</tr>\n
+<tr>\n
+  <td>assertTitle</td>\n
+  <td>len(checked_uids) == 1</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//tr[1]/td[2]</td>\n
+  <td>1</td>\n
+</tr>\n
+\n
+<!-- If selection is not in filtered mode, when selection an action from\n
+object_action, selection checked uids will be updated to the list of selected\n
+uids.\n
+-->\n
+<tr>\n
+  <td>open</td>\n
+  <td>${base_url}/foo_module/view</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Folder_show:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>click</td>\n
+  <td>//tr[@id=\'listbox_data_line_1\']/td[1]/input</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>click</td>\n
+  <td>//tr[@id=\'listbox_data_line_2\']/td[1]/input</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>selectAndWait</td>\n
+  <td>select_action</td>\n
+  <td>Dummy Action</td>\n
+</tr>\n
+<tr>\n
+  <td>assertTitle</td>\n
+  <td>len(checked_uids) == 2</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//tr[1]/td[2]</td>\n
+  <td>1</td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//tr[2]/td[2]</td>\n
+  <td>2</td>\n
+</tr>\n
+\n
+<!-- paranoia. Select some uids, filter, unselect some uids and check we\n
+only have selected uids.\n
+-->\n
+<tr>\n
+  <td>open</td>\n
+  <td>${base_url}/foo_module/view</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Folder_show:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>click</td>\n
+  <td>//tr[@id=\'listbox_data_line_1\']/td[1]/input</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>click</td>\n
+  <td>//tr[@id=\'listbox_data_line_2\']/td[1]/input</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Folder_filter:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>click</td>\n
+  <!-- unselect 1 -->\n
+  <td>//tr[@id=\'listbox_data_line_0\']/td[1]/input</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>selectAndWait</td>\n
+  <td>select_action</td>\n
+  <td>Dummy Action</td>\n
+</tr>\n
+<tr>\n
+  <td>assertTitle</td>\n
+  <td>len(checked_uids) == 1</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//tr[1]/td[2]</td>\n
+  <td>2</td>\n
+</tr>\n
+\n
+</tbody></table>\n
+</body>\n
+</html>\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>testSelectionCheckedUids</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Persistence</string>
+          <string>PersistentMapping</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_container</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testExchangeActions.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testExchangeActions.xml?rev=9855&r1=9854&r2=9855&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testExchangeActions.xml (original)
+++ erp5/trunk/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testExchangeActions.xml Tue Sep 12 23:04:18 2006
@@ -86,7 +86,6 @@
   <td>Welcome to ERP5</td>\n
   <td></td>\n
 </tr>\n
-<!-- TODO: test "real workflow actions" -->\n
 </body>\n
 </html>\n
 

Added: erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_getSelectionCheckedUidsAsHtml.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_getSelectionCheckedUidsAsHtml.xml?rev=9855&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_getSelectionCheckedUidsAsHtml.xml (added)
+++ erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_getSelectionCheckedUidsAsHtml.xml Tue Sep 12 23:04:18 2006
@@ -1,0 +1,221 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+"""This scripts prints a table of all checked uids as html.\n
+The title of the html is in the form "len(checked_uids) == %d"\n
+The body contains some /table/tr with td[0] for uid and td[1] for id\n
+"""\n
+\n
+if selection_name is None:\n
+  return "selection_name parameter not passed"\n
+\n
+portal = context.getPortalObject()\n
+checked_uids = portal.portal_selections\\\n
+                    .getSelectionCheckedUidsFor(selection_name)\n
+getObj = portal.portal_catalog.getObject\n
+checked_uids_objs = [getObj(uid) for uid in checked_uids]\n
+checked_uids_objs.sort(lambda x,y:cmp(x.getId(), y.getId()))\n
+\n
+# we produce html for easier Selenium parsing\n
+table = "\\n".join(["<tr><td>%s</td><td>%s</td></tr>" % (\n
+                    x.getUid(), x.getId()) for x in checked_uids_objs])\n
+return """<html>\n
+<head><title>len(checked_uids) == %d</title></head>\n
+<body>\n
+<table>\n
+  %s\n
+</table>\n
+</body>\n
+</html>""" % (len(checked_uids), table)\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_dav_writelocks</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>selection_name=None, **kw</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>selection_name</string>
+                            <string>kw</string>
+                            <string>None</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>checked_uids</string>
+                            <string>getObj</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>uid</string>
+                            <string>checked_uids_objs</string>
+                            <string>x</string>
+                            <string>table</string>
+                            <string>len</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ListBoxZuite_getSelectionCheckedUidsAsHtml</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Persistence</string>
+          <string>PersistentMapping</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_container</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_ui_test/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/bt/revision?rev=9855&r1=9854&r2=9855&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/bt/revision (original)
+++ erp5/trunk/bt5/erp5_ui_test/bt/revision Tue Sep 12 23:04:18 2006
@@ -1,1 +1,1 @@
-61
+62




More information about the Erp5-report mailing list