Commit f4e93e19 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: add support for 'Default Sort' & 'Parameter List' paramete…

…r in (multi)relation field

/reviewed-on nexedi/erp5!556
parent 2b94959d
...@@ -492,6 +492,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key ...@@ -492,6 +492,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
portal_type_list = field.get_value('portal_type') portal_type_list = field.get_value('portal_type')
translated_portal_type = [] translated_portal_type = []
jump_reference_list = [] jump_reference_list = []
relation_sort = field.get_value('sort')
if portal_type_list: if portal_type_list:
portal_type_list = [x[0] for x in portal_type_list] portal_type_list = [x[0] for x in portal_type_list]
translated_portal_type = [Base_translateString(x) for x in portal_type_list] translated_portal_type = [Base_translateString(x) for x in portal_type_list]
...@@ -513,10 +514,10 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key ...@@ -513,10 +514,10 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
result.update({ result.update({
"editable": False "editable": False
}) })
relation_query_kw = kw.copy()
relation_query_kw['portal_type'] = portal_type_list
query = url_template_dict["jio_search_template"] % { query = url_template_dict["jio_search_template"] % {
"query": make_query({"query": sql_catalog.buildQuery( "query": make_query({"query": sql_catalog.buildQuery(relation_query_kw).asSearchTextExpression(sql_catalog)})
{"portal_type": portal_type_list}
).asSearchTextExpression(sql_catalog)})
} }
title = field.get_value("title") title = field.get_value("title")
column_list = field.get_value("columns") column_list = field.get_value("columns")
...@@ -543,11 +544,15 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key ...@@ -543,11 +544,15 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
# overwrite, like Base_getRelatedObjectParameter does # overwrite, like Base_getRelatedObjectParameter does
if subfield["portal_type"] == []: if subfield["portal_type"] == []:
subfield["portal_type"] = field.get_value('portal_type') subfield["portal_type"] = field.get_value('portal_type')
if relation_sort:
subfield["sort"] = relation_sort
listbox_query_kw = kw.copy()
listbox_query_kw.update(dict(portal_type = [x[-1] for x in subfield["portal_type"]],
**subfield["default_params"]))
subfield["query"] = url_template_dict["jio_search_template"] % { subfield["query"] = url_template_dict["jio_search_template"] % {
"query": make_query({"query": sql_catalog.buildQuery( "query": make_query({"query": sql_catalog.buildQuery(
dict(portal_type = [x[-1] for x in subfield["portal_type"]], listbox_query_kw, ignore_unknown_columns=True
**subfield["default_params"]), ignore_unknown_columns=True ).asSearchTextExpression(sql_catalog)})
).asSearchTextExpression(sql_catalog)})
} }
# Kato: why? # Kato: why?
if "list_method_template" in subfield: if "list_method_template" in subfield:
...@@ -570,6 +575,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key ...@@ -570,6 +575,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
"translated_portal_types": translated_portal_type, "translated_portal_types": translated_portal_type,
"portal_types": portal_type_list, "portal_types": portal_type_list,
"query": query, "query": query,
"sort": relation_sort,
"catalog_index": field.get_value('catalog_index'), "catalog_index": field.get_value('catalog_index'),
"allow_jump": field.get_value('allow_jump'), "allow_jump": field.get_value('allow_jump'),
"allow_creation": field.get_value('allow_creation'), "allow_creation": field.get_value('allow_creation'),
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
return input_gadget.render({ return input_gadget.render({
editable: gadget.state.editable, editable: gadget.state.editable,
query: gadget.state.query, query: gadget.state.query,
sort_list_json: gadget.state.sort_list_json,
catalog_index: gadget.state.catalog_index, catalog_index: gadget.state.catalog_index,
allow_jump: gadget.state.allow_jump, allow_jump: gadget.state.allow_jump,
// required: field_json.required, // required: field_json.required,
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
state_dict = { state_dict = {
editable: field_json.editable, editable: field_json.editable,
query: field_json.query, query: field_json.query,
sort_list_json: JSON.stringify(field_json.sort),
catalog_index: field_json.catalog_index, catalog_index: field_json.catalog_index,
allow_jump: field_json.allow_jump, allow_jump: field_json.allow_jump,
required: field_json.required, required: field_json.required,
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.38497.25325.33501</string> </value> <value> <string>964.60244.25298.44253</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1515062767.93</float> <float>1516369404.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -62,15 +62,6 @@ ...@@ -62,15 +62,6 @@
filter_action: true filter_action: true
}); });
}) })
.allowPublicAcquisition('getUrlParameter', function (argument_list) {
return this.getUrlParameter(argument_list)
.push(function (result) {
if ((result === undefined) && (argument_list[0] === 'field_listbox_sort_list:json')) {
return [];
}
return result;
});
})
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this, var gadget = this,
select_template = options.select_template || ""; select_template = options.select_template || "";
......
...@@ -71,7 +71,9 @@ ...@@ -71,7 +71,9 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
...@@ -234,7 +236,7 @@ ...@@ -234,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.5791.20424.25736</string> </value> <value> <string>964.60339.56148.38212</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +254,7 @@ ...@@ -252,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1474556136.49</float> <float>1516373132.37</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -145,7 +145,17 @@ ...@@ -145,7 +145,17 @@
value_uid: options.value_uid, value_uid: options.value_uid,
value_text: options.value_text, value_text: options.value_text,
value_portal_type: options.value_portal_type value_portal_type: options.value_portal_type
}; },
sort_list = JSON.parse(options.sort_list_json);
sort_list.map(function (sort) {
var order = sort[1].toLowerCase();
if (order.startsWith('asc')) {
sort[1] = 'ascending';
} else if (order.startsWith('desc')) {
sort[1] = 'descending';
}
});
state_dict.sort_list_json = JSON.stringify(sort_list);
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
...@@ -299,7 +309,8 @@ ...@@ -299,7 +309,8 @@
] ]
})), })),
limit: [0, 10], limit: [0, 10],
select_list: [gadget.state.catalog_index, "uid"] select_list: [gadget.state.catalog_index, "uid"],
sort_on: JSON.parse(gadget.state.sort_list_json)
}); });
}) })
.push(function (result) { .push(function (result) {
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.8568.54116.8601</string> </value> <value> <string>964.64317.62914.20172</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1513266821.11</float> <float>1516635043.86</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
var render_options = { var render_options = {
editable: field_json.editable, editable: field_json.editable,
query: field_json.query, query: field_json.query,
sort_list_json: JSON.stringify(field_json.sort),
catalog_index: field_json.catalog_index, catalog_index: field_json.catalog_index,
allow_jump: field_json.allow_jump, allow_jump: field_json.allow_jump,
// required: field_json.required, // required: field_json.required,
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.19776.55952.3225</string> </value> <value> <string>959.26374.14159.14984</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1490691939.14</float> <float>1516369688.01</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<?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>testMultiRelationDefaultSortAndParameterList</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 xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/foo_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_main</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name='field_sort']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name='field_sort']</td>
<td>id | DESC</td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_talesForm</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_parameter_list']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_parameter_list']</td>
<td>python: [('id', '<5 AND >2')]</td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Quantity</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_foo_relation_field_view" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_my_bar_category_title_list']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_my_bar_category_title_list']</td>
<td>%</td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name='field_my_bar_category_title_list']</td>
<td>input</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']//li</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>verifyAttribute</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']/li[1]@data-relative-url</td>
<td>foo_module/4</td>
</tr>
<tr>
<td>verifyAttribute</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']/li[2]@data-relative-url</td>
<td>foo_module/3</td>
</tr>
<!-- test parameter list -->
<tr>
<td>verifyElementNotPresent</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']//li[@data-relative-url='foo_module/5']</td>
<td></td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name="field_my_bar_category_title_list"]</td>
<td>blur</td>
</tr>
<tr>
<td>click</td>
<td>//li[@data-explore="true"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//tbody/tr[1]</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//tbody/tr[1]//a[contains(text(), '4')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//tbody/tr[2]//a[contains(text(), '3')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//a[contains(text(), '5')]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_main</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name='field_sort']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name='field_sort']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_talesForm</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_parameter_list']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_parameter_list']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?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>testRelationDefaultSortAndParameterList</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 xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/foo_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_successor_title/manage_main</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name='field_sort']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name='field_sort']</td>
<td>id | DESC</td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_successor_title/manage_talesForm</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_parameter_list']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_parameter_list']</td>
<td>python: [('id', '<5 AND >2')]</td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Quantity</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_foo_relation_field_view" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_my_successor_title']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_my_successor_title']</td>
<td>%</td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name='field_my_successor_title']</td>
<td>input</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']//li</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>verifyAttribute</td>
<td>//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']/li[1]@data-relative-url</td>
<td>foo_module/4</td>
</tr>
<tr>
<td>verifyAttribute</td>
<td>//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']/li[2]@data-relative-url</td>
<td>foo_module/3</td>
</tr>
<!-- test parameter list -->
<tr>
<td>verifyElementNotPresent</td>
<td>//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']//li[@data-relative-url='foo_module/5']</td>
<td></td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name="field_my_successor_title"]</td>
<td>blur</td>
</tr>
<tr>
<td>click</td>
<td>//li[@data-explore="true"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//tbody/tr[1]</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//tbody/tr[1]//a[contains(text(), '4')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//tbody/tr[2]//a[contains(text(), '3')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//div[@data-gadget-scope='field_listbox']//a[contains(text(), '5')]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_successor_title/manage_main</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name='field_sort']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name='field_sort']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Foo_viewRelationField/my_successor_title/manage_talesForm</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_parameter_list']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_parameter_list']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Save Changes']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='system-msg']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ 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