From 34539573235064608b863157808d0097868afee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Thu, 7 Jan 2010 15:07:48 +0000 Subject: [PATCH] Tests that the jump dialog uses columns and title from the relation field configuration git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31637 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../testRelationFieldJump.xml | 219 ++++++++++++++++++ .../my_bar_category_title_list.xml | 11 +- bt5/erp5_ui_test/bt/revision | 2 +- 3 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml new file mode 100644 index 0000000000..97be86e096 --- /dev/null +++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml @@ -0,0 +1,219 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <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>_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 Relation Field Jump</title>\n +</head>\n +<body>\n +<table cellpadding="1" cellspacing="1" border="1">\n +<thead>\n +<tr><td rowspan="1" colspan="3">Test Relation Field Jump</td></tr>\n +</thead>\n +<tbody tal:define="is_selenium_0_8 python:here.getPortalObject().portal_tests.getZeleniumVersion() > \'Zelenium-0.8\'">\n +<tal:block metal:use-macro="here/RelationFieldZuite_CommonTemplate/macros/init" />\n +<tr>\n + <td>open</td>\n + <td>${base_url}/foo_module/FooModule_createObjects?num:int=2</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}/foo_module/Zuite_waitForActivities</td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>assertTextPresent</td>\n + <td>Done.</td>\n + <td></td>\n +</tr>\n +<!-- jump when there is exactly one relation, we jump directly to the object\n +-->\n +<tr>\n + <td>open</td>\n + <td>${base_url}/foo_module/0/Base_viewMetadata</td>\n + <td></td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>type</td>\n + <td>field_my_category_list</td>\n + <td>bar_category/foo_module/1</td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>clickAndWait</td>\n + <td>//button[@title=\'Save\']</td>\n + <td></td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>open</td>\n + <td>${base_url}/foo_module/0/Foo_viewRelationField</td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>clickAndWait</td>\n + <td>//fieldset[@id=\'fieldset_left\']/div[4]/div/a/img[@alt="jump"]</td>\n + <td></td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>assertAbsoluteLocation</td>\n + <td tal:content="string:glob:${here/portal_url}/foo_module/1/view"/>\n + <td></td>\n + <td></td>\n +</tr>\n +\n +<!-- jump when there are more than one relation, then an intermediate listbox\n +will be shown\n +-->\n +<tr>\n + <td>open</td>\n + <td>${base_url}/foo_module/0/Base_viewMetadata</td>\n + <td></td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>type</td>\n + <td>field_my_category_list</td>\n +<tal:block tal:condition="is_selenium_0_8">\n + <td>bar_category/foo_module/0<br />bar_category/foo_module/1</td>\n +</tal:block>\n +<tal:block tal:condition="not:is_selenium_0_8">\n + <td>bar_category/foo_module/0\n +bar_category/foo_module/1</td>\n +</tal:block>\n + <td></td>\n +</tr>\n +<tr>\n + <td>clickAndWait</td>\n + <td>//button[@title=\'Save\']</td>\n + <td></td>\n + <td></td>\n +</tr>\n +\n +<tr>\n + <td>open</td>\n + <td>${base_url}/foo_module/0/Foo_viewRelationField</td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>clickAndWait</td>\n + <td>//fieldset[@id=\'fieldset_left\']/div[4]/div/a/img[@alt="jump"]</td>\n + <td></td>\n + <td></td>\n +</tr>\n +\n +<!-- this is the jump listbox -->\n +<tr>\n + <td>verifyText</td>\n + <td>listbox_record_number</td>\n + <td>2 records</td>\n +</tr>\n +\n +<!-- the title of the listbox is the title of the relation field -->\n +<tr>\n + <td>verifyText</td>\n + <td>id=listbox_title</td>\n + <td>exact:Bar Titles:</td>\n +</tr>\n +\n +<!-- the columns are the one defined in the relation field. -->\n +<tr>\n + <td>verifyText</td>\n + <td>//tr[@id="listbox_label_line"]/td[1]</td>\n + <td>Title</td>\n +</tr>\n +<tr>\n + <td>verifyText</td>\n + <td>//tr[@id="listbox_label_line"]/td[2]</td>\n + <td>Quantity</td>\n +</tr>\n +\n +<!-- it has links to the related objects -->\n +<tr>\n + <td>clickAndWait</td>\n + <td>//tr[@id=\'listbox_data_line_0\']/td[1]/a</td>\n + <td></td>\n + <td></td>\n +</tr>\n +<tr>\n + <td>assertAbsoluteLocation</td>\n + <td tal:content="string:glob:${here/portal_url}/foo_module/1/view"/>\n + <td></td>\n + <td></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>testRelationFieldJump</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewRelationField/my_bar_category_title_list.xml b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewRelationField/my_bar_category_title_list.xml index 380ac58521..e050889f2e 100644 --- a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewRelationField/my_bar_category_title_list.xml +++ b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewRelationField/my_bar_category_title_list.xml @@ -397,7 +397,16 @@ <item> <key> <string>columns</string> </key> <value> - <list/> + <list> + <tuple> + <string>title</string> + <string>Title</string> + </tuple> + <tuple> + <string>quantity</string> + <string>Quantity</string> + </tuple> + </list> </value> </item> <item> diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision index 7c2b018235..8db1e5f188 100644 --- a/bt5/erp5_ui_test/bt/revision +++ b/bt5/erp5_ui_test/bt/revision @@ -1 +1 @@ -521 \ No newline at end of file +522 \ No newline at end of file -- 2.30.9