Commit 505497a3 authored by Jérome Perrin's avatar Jérome Perrin

Tests more features of the matrix box:

* using "cell_index" in TALES
* using field for global properties
both with lines columns tabs or returned by an as cell range script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30161 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 114aad17
......@@ -51,7 +51,7 @@
<tr><td rowspan="1" colspan="3">Test MatrixBox Column Title</td></tr>\n
</thead><tbody>\n
\n
<tal:block metal:use-macro="here/ListBoxZuite_CommonTemplate/macros/init" />\n
<tal:block metal:use-macro="here/MatrixBoxZuite_CommonTemplate/macros/init" />\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?create_line:int=1</td>\n
......
......@@ -51,7 +51,7 @@
<tr><td rowspan="1" colspan="3">Test MatrixBox Cell Creation</td></tr>\n
</thead><tbody>\n
\n
<tal:block metal:use-macro="here/ListBoxZuite_CommonTemplate/macros/init" />\n
<tal:block metal:use-macro="here/MatrixBoxZuite_CommonTemplate/macros/init" />\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?create_line:int=1</td>\n
......@@ -201,6 +201,53 @@
<td>2 records</td>\n
</tr>\n
\n
<!-- Matrix box editable fields can use the cell coordinates as "cell_index" in their TALES-->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_0/getTitle</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'a\', \'one\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_1/getTitle</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'a\', \'two\']</td>\n
<td></td>\n
</tr>\n
\n
<!-- Matrix box global properties fields can be used to edit all cells with the\n
same values.\n
The field must be in the \'bottom\' group for this to work.\n
-->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_0/getFooCategoryTitleList</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'a\', \'b\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_1/getFooCategoryTitleList</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'a\', \'b\']</td>\n
<td></td>\n
</tr>\n
\n
</tbody>\n
</table>\n
</body>\n
......
<?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 Dynamic MatrixBox Column Title</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Dynamic MatrixBox Column Title</td></tr>\n
</thead><tbody>\n
\n
<tal:block metal:use-macro="here/MatrixBoxZuite_CommonTemplate/macros/init" />\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?create_line:int=1</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
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/FooLine_viewDynamicMatrixBox</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyText</td>\n
<td>//tr[@class="matrixbox_label_line"]/td[2]</td>\n
<td>Three</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//tr[@class="matrixbox_label_line"]/td[3]</td>\n
<td>Four</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//tr[@class="matrixbox_label_line"]/../tr[2]/td</td>\n
<td>C</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//tr[@class="matrixbox_label_line"]/../tr[3]/td</td>\n
<td>D</td>\n
</tr>\n
\n
</tbody>\n
</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>testDynamicColumnTitle</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 Dynamic MatrixBox Cell Creation</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Dynamic MatrixBox Cell Creation</td></tr>\n
</thead><tbody>\n
\n
<tal:block metal:use-macro="here/MatrixBoxZuite_CommonTemplate/macros/init" />\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?create_line:int=1</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
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/FooLine_viewDynamicMatrixBox</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>field_matrixbox_quantity_cell_0_0_0</td>\n
<td>1.0</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Base_edit:method</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_0_0_0</td>\n
<td>1.0</td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_0_1_0</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_1_0_0</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_1_1_0</td>\n
<td></td>\n
</tr>\n
\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
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/Folder_viewContentList?reset:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>id=listbox_record_number</td>\n
<td>1 records</td>\n
</tr>\n
<tal:block tal:condition="python: context.TestTool_getSkinName()!=\'Mobile\'">\n
<tr>\n
<td>verifyText</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]</td>\n
<td>Foo Line</td>\n
</tr>\n
</tal:block>\n
<tal:block tal:condition="python: context.TestTool_getSkinName()==\'Mobile\'">\n
<tr>\n
<td>verifyText</td>\n
<td>//*[@id="listbox_data_line_0"]/div[3]//span[@id=\'data_short\']</td>\n
<td>Foo Line</td>\n
</tr>\n
</tal:block>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/FooLine_viewDynamicMatrixBox</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>type</td>\n
<td>field_matrixbox_quantity_cell_0_1_0</td>\n
<td>2.0</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Base_edit:method</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_0_0_0</td>\n
<td>1.0</td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_0_1_0</td>\n
<td>2.0</td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_1_0_0</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_matrixbox_quantity_cell_1_1_0</td>\n
<td></td>\n
</tr>\n
\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
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/Folder_viewContentList?reset:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>id=listbox_record_number</td>\n
<td>2 records</td>\n
</tr>\n
\n
<!-- Matrix box editable fields can use the cell coordinates as "cell_index" in their TALES-->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_0/getTitle</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'c\', \'three\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_1/getTitle</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'c\', \'four\']</td>\n
<td></td>\n
</tr>\n
\n
<!-- Matrix box global properties fields can be used to edit all cells with the\n
same values.\n
The field must be in the \'bottom\' group for this to work.\n
-->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_0/getFooCategoryTitleList</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'a\', \'b\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/1/cell_0_1/getFooCategoryTitleList</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>[\'a\', \'b\']</td>\n
<td></td>\n
</tr>\n
\n
</tbody>\n
</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>testDynamicCreateCell</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>if matrixbox:\n
return [(\'c\', \'C\'), (\'d\', \'D\')], [(\'three\', \'Three\'), (\'four\', \'Four\')], \n
return [\'c\', \'d\'], [\'three\', \'four\'],\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>matrixbox</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>matrixbox</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>FooLine_asCellRange</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Display a matrix box for selenium tests</string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>matrixbox</string>
<string>foo_category_list</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>matrixbox_quantity</string>
<string>matrixbox_title</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>FooLine_viewDynamicMatrixBox</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Foo_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Foo Line</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -79,6 +79,7 @@
<value>
<list>
<string>matrixbox</string>
<string>foo_category_list</string>
</list>
</value>
</item>
......@@ -93,6 +94,7 @@
<value>
<list>
<string>matrixbox_quantity</string>
<string>matrixbox_title</string>
</list>
</value>
</item>
......
......@@ -194,6 +194,10 @@
<key> <string>cell_base_id</string> </key>
<value> <string>cell</string> </value>
</item>
<item>
<key> <string>cell_getter_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>cell_portal_type</string> </key>
<value> <string>Foo Line</string> </value>
......@@ -237,6 +241,10 @@
<string>quantity</string>
<string>quantity</string>
</tuple>
<tuple>
<string>title</string>
<string>title</string>
</tuple>
</list>
</value>
</item>
......@@ -255,7 +263,12 @@
<item>
<key> <string>global_attributes</string> </key>
<value>
<list/>
<list>
<tuple>
<string>foo_category_list</string>
<string>foo_category_list</string>
</tuple>
</list>
</value>
</item>
<item>
......
502
\ No newline at end of file
503
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment