Commit bb0a8ddf authored by Jérome Perrin's avatar Jérome Perrin

trade_ui_test: tests for "Suppliers", "Clients", "Organisations" and "Persons" Proxy Listbox Ids

parent 3db46412
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</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>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>testRelationFieldProxyListboxId</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html>
<head><title>Test Proxy Listbox Ids on relation fields.</title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="4">
Test Proxy Listbox Ids on relation fields.
</td></tr>
</thead>
<tbody tal:define="init_method string:Zuite_createSaleOrderForTradeZuite;">
<!-- Setup {{{ -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForTradeZuite/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/sale_order_module/erp5_trade_ui_test_sale_order_1</td>
<td></td>
</tr>
<!-- }}} -->
<tr>
<td>clickAndWait</td>
<td>//input[@name="field_my_source_title"]/../input[@alt="update..."]</td>
<td></td>
</tr>
<tr>
<td>assertSelected</td>
<td>select_dialog</td>
<td>All</td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>Site Error</td>
<td></td>
</tr>
<tr>
<td>verifyPortalStatusMessage</td>
<td>Please select one object.</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>Site Error</td>
<td></td>
</tr>
<tal:block tal:repeat="node_title python: ('Organisation supplier', 'Organisation client', 'Person supplier', 'Person client')">
<tr>
<td>assertElementPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>selectAndWait</td>
<td>select_dialog</td>
<td>Suppliers</td>
</tr>
<tal:block tal:repeat="node_title python: ('Organisation supplier', 'Person supplier', )">
<tr>
<td>assertElementPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tal:block tal:repeat="node_title python: ('Organisation client', 'Person client')">
<tr>
<td>assertElementNotPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>selectAndWait</td>
<td>select_dialog</td>
<td>Clients</td>
</tr>
<tal:block tal:repeat="node_title python: ('Organisation client', 'Person client')">
<tr>
<td>assertElementPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tal:block tal:repeat="node_title python: ('Organisation supplier', 'Person supplier', )">
<tr>
<td>assertElementNotPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>selectAndWait</td>
<td>select_dialog</td>
<td>Organisations</td>
</tr>
<tal:block tal:repeat="node_title python: ('Organisation supplier', 'Organisation client', )">
<tr>
<td>assertElementPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tal:block tal:repeat="node_title python: ('Person supplier', 'Person client')">
<tr>
<td>assertElementNotPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>selectAndWait</td>
<td>select_dialog</td>
<td>Persons</td>
</tr>
<tal:block tal:repeat="node_title python: ('Person supplier', 'Person client')">
<tr>
<td>assertElementPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
<tal:block tal:repeat="node_title python: ('Organisation supplier', 'Organisation client', )">
<tr>
<td>assertElementNotPresent</td>
<td>//table[contains(@class, "listbox")]//tr/td[2]/a[text() = "<tal:block tal:replace="node_title"/>"]</td>
<td></td>
</tr>
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -4,6 +4,10 @@ object_value_list = [
getattr(portal.sale_order_module, 'erp5_trade_ui_test_sale_order_1', None),
getattr(portal.organisation_module, 'erp5_trade_ui_test_organisation_1', None),
getattr(portal.organisation_module, 'erp5_trade_ui_test_organisation_2', None),
getattr(portal.organisation_module, 'test_trade_ui_test_supplier', None),
getattr(portal.organisation_module, 'test_trade_ui_test_client', None),
getattr(portal.person_module, 'test_trade_ui_test_supplier', None),
getattr(portal.person_module, 'test_trade_ui_test_client', None),
] + [
getattr(portal.getDefaultModule(portal_type), "erp5_trade_ui_test_trade_condition" + suffix, None)
for portal_type in ("Internal Trade Condition", "Purchase Trade Condition", "Sale Trade Condition")
......
portal = context.getPortalObject()
# Reset selections
selection_tool = context.getPortalObject().portal_selections
selection_tool = portal.portal_selections
selection_tool.setSelectionFor('sale_order_selection', None)
# Create role categories
role_base_category = portal.restrictedTraverse('portal_categories/role')
for role_id, role_title in (
('client', 'Client'),
('supplier', 'Supplier')):
if role_base_category.get(role_id) is None:
role_base_category.newContent(
portal_type='Category',
id=role_id,
title=role_title
)
# Set system preferences
preference = portal.portal_preferences.getActiveSystemPreference()
preference.setPreferredClientRoleList(['role/client'])
preference.setPreferredSupplierRoleList(['role/supplier'])
# Create some nodes
for portal_type in ('Person', 'Organisation'):
for role in ('client', 'supplier'):
portal.getDefaultModule(portal_type).newContent(
id='test_trade_ui_test_' + role,
portal_type=portal_type,
title='%s %s' % (portal_type, role),
role_value=role_base_category[role],
).validate()
return "Reset Successfully."
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