Commit f9fa2a34 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: handle timezone in datetimefield gadget

1.add DateTimeField tabs in Bar for selenium test
2.add selenium test for datetimefield gadget
parent e84f0aea
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_datetime_field</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>DateTimeField</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Foo_viewDateTimeField</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -2,6 +2,7 @@ Bar Module | view ...@@ -2,6 +2,7 @@ Bar Module | view
Bar | list Bar | list
Bar | performance Bar | performance
Bar | view Bar | view
Bar | view_datetime_field
Foo Bar Module | view Foo Bar Module | view
Foo Line | view Foo Line | view
Foo Module | list Foo Module | list
......
...@@ -101,11 +101,10 @@ ...@@ -101,11 +101,10 @@
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
/*global window, rJS, RSVP */\n /*global window, rJS, RSVP, document, loopEventListener */\n
/*jslint indent: 2, maxerr: 3 */\n /*jslint indent: 2 */\n
(function (window, rJS, RSVP) {\n (function (window, rJS, RSVP) {\n
"use strict";\n "use strict";\n
\n
rJS(window)\n rJS(window)\n
.ready(function (gadget) {\n .ready(function (gadget) {\n
return gadget.getElement()\n return gadget.getElement()\n
...@@ -115,28 +114,106 @@ ...@@ -115,28 +114,106 @@
});\n });\n
})\n })\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n .declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareMethod(\'render\', function (options) {\n .declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n var input = this.element.querySelector(\'input\'),\n
date,\n date,\n
tmp,\n
timezone,\n
tmp_year,\n
tmp_month,\n
tmp_date,\n
tmp_hour,\n
tmp_minute,\n
select,\n
time = "",\n time = "",\n
leapyear,\n
i,\n
field_json = options.field_json || {},\n field_json = options.field_json || {},\n
lastDateOfMonth = [[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n
[31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]],//leapyear\n
select_options = ["GMT-12", "GMT-11", "GMT-10", "GMT-9", "GMT-8", "GMT-7", "GMT-6",\n
"GMT-5", "GMT-4", "GMT-3", "GMT-2", "GMT-1", "GMT", "GMT+1",\n
"GMT+2", "GMT+3", "GMT+4", "GMT+5", "GMT+6", "GMT+7", "GMT+8",\n
"GMT+9", "GMT+10", "GMT+11", "GMT+12"],\n
select_option,\n
value = field_json.value || field_json.default || "";\n value = field_json.value || field_json.default || "";\n
this.props.field_json = field_json;\n this.props.field_json = field_json;\n
\n \n
\n
if (field_json.timezone_style) {\n
//change date to local\n
select = document.createElement("select");\n
for (i = 0; i < select_options.length; i += 1) {\n
select_option = document.createElement("option");\n
select_option.value = select_options[i];\n
select_option.innerHTML = select_options[i];\n
select.appendChild(select_option);\n
}\n
select.setAttribute("class", "gmt_select");\n
select.selectedIndex = 12;\n
this.element.appendChild(select);\n
}\n
if (field_json.date_only === 0) {\n
input.setAttribute("type", "datetime-local");\n
}\n
//Change type to datetime/datetime local if configured in the field\n //Change type to datetime/datetime local if configured in the field\n
if (value !== "") {\n if (value !== "") {\n
value = new Date(value).toISOString();\n tmp = new Date(value);\n
// XXX Ensure the timezone is not lost\n //get date without timezone\n
date = value.substring(0, 10);\n tmp_date = tmp.getUTCDate();\n
tmp_month = tmp.getUTCMonth() + 1;\n
tmp_year = tmp.getUTCFullYear();\n
\n
if (field_json.date_only === 0) {\n if (field_json.date_only === 0) {\n
time = value.substring(10, 19);\n tmp_hour = tmp.getUTCHours();\n
input.setAttribute("type", "datetime-local");\n tmp_minute = tmp.getUTCMinutes();\n
\n
//timezone required\n
//convert time to GMT\n
timezone = parseInt(value.slice(-5), 10) / 100;\n
\n
if (field_json.timezone_style) {\n
select.selectedIndex = timezone + 12;\n
}\n
leapyear = (tmp_year % 4 === 0 && tmp_year % 100 !== 0) ? 1 : 0;\n
if (timezone !== 0) {\n
tmp_hour += timezone;\n
if (tmp_hour < 0) {\n
tmp_hour += 24;\n
tmp_date -= 1;\n
if (tmp_date === 0) {\n
tmp_month -= 1;\n
if (tmp_month === 0) {\n
tmp_month = 12;\n
tmp_year -= 1;\n
}\n
tmp_date = lastDateOfMonth[leapyear][tmp_month - 1];\n
}\n }\n
} else if (tmp_hour > 23) {\n
tmp_hour -= 24;\n
tmp_date += 1;\n
if (tmp_date > lastDateOfMonth[leapyear][tmp_month - 1]) {\n
tmp_date = 1;\n
tmp_month += 1;\n
if (tmp_month > 12) {\n
tmp_month = 1;\n
tmp_year += 1;\n
}\n }\n
}\n
}\n
}\n
time = "T" + Math.floor(tmp_hour / 10) + tmp_hour % 10 + ":"\n
+ Math.floor(tmp_minute / 10) + (tmp_minute % 10) + ":00";\n
}\n
date = tmp_year + "-" + Math.floor(tmp_month / 10) + (tmp_month % 10) + "-"\n
+ Math.floor(tmp_date / 10) + (tmp_date % 10);\n
\n
input.setAttribute(\n input.setAttribute(\n
\'value\',\n \'value\',\n
date + time\n date + time\n
);\n );\n
}\n
input.setAttribute(\'name\', field_json.key);\n input.setAttribute(\'name\', field_json.key);\n
input.setAttribute(\'title\', field_json.title);\n input.setAttribute(\'title\', field_json.title);\n
if (field_json.required === 1) {\n if (field_json.required === 1) {\n
...@@ -146,12 +223,12 @@ ...@@ -146,12 +223,12 @@
input.setAttribute(\'readonly\', \'readonly\');\n input.setAttribute(\'readonly\', \'readonly\');\n
input.setAttribute(\'data-wrapper-class\', \'ui-state-disabled ui-state-readonly\');\n input.setAttribute(\'data-wrapper-class\', \'ui-state-disabled ui-state-readonly\');\n
input.setAttribute(\'disabled\', \'disabled\');\n input.setAttribute(\'disabled\', \'disabled\');\n
\n
}\n }\n
})\n })\n
.declareMethod(\'getDateTime\', function () {\n .declareMethod(\'getContent\', function () {\n
var input = this.element.querySelector(\'input\'),\n var input = this.element.querySelector(\'input\'),\n
result = {},\n result = {},\n
select,\n
year,\n year,\n
month,\n month,\n
field_json = this.props.field_json,\n field_json = this.props.field_json,\n
...@@ -159,22 +236,23 @@ ...@@ -159,22 +236,23 @@
hour,\n hour,\n
minute,\n minute,\n
value = input.value;\n value = input.value;\n
if (value) {\n if (value !== "") {\n
value += "+0000";\n
value = new Date(value);\n value = new Date(value);\n
year = value.getFullYear();\n year = value.getUTCFullYear();\n
month = value.getMonth() + 1;\n month = value.getUTCMonth() + 1;\n
date = value.getUTCDate();\n
if (field_json.hide_day === 1) {\n if (field_json.hide_day === 1) {\n
date = 1;\n date = 1;\n
} else {\n
date = value.getDate();\n
}\n }\n
//get time\n
if (field_json.date_only === 0) {\n if (field_json.date_only === 0) {\n
if (field_json.allow_empty_time === 1) {\n if (field_json.allow_empty_time === 1) {\n
hour = 0;\n hour = 0;\n
minute = 0;\n minute = 0;\n
} else {\n } else {\n
hour = value.getUTCHours();\n hour = value.getUTCHours();\n
minute = value.getMinutes();\n minute = value.getUTCMinutes();\n
}\n }\n
if (field_json.ampm_time_style === 1) {\n if (field_json.ampm_time_style === 1) {\n
if (hour > 12) {\n if (hour > 12) {\n
...@@ -187,6 +265,7 @@ ...@@ -187,6 +265,7 @@
result[field_json.subfield_hour_key] = hour;\n result[field_json.subfield_hour_key] = hour;\n
result[field_json.subfield_minute_key] = minute;\n result[field_json.subfield_minute_key] = minute;\n
}\n }\n
\n
if (field_json.hidden_day_is_last_day === 1) {\n if (field_json.hidden_day_is_last_day === 1) {\n
if (month === 12) {\n if (month === 12) {\n
year += 1;\n year += 1;\n
...@@ -198,25 +277,95 @@ ...@@ -198,25 +277,95 @@
result[field_json.subfield_year_key] = year;\n result[field_json.subfield_year_key] = year;\n
result[field_json.subfield_month_key] = month;\n result[field_json.subfield_month_key] = month;\n
result[field_json.subfield_day_key] = date;\n result[field_json.subfield_day_key] = date;\n
\n if (field_json.timezone_style) {\n
// XXX Ensure the timezone is not lost\n //set timezone\n
// result[field_json.subfield_timezone_key] = value.getDate();\n select = this.element.querySelector("select");\n
result[field_json.subfield_timezone_key] = select.options[select.selectedIndex].value;\n
}\n
}\n }\n
return result;\n return result;\n
})\n })\n
.declareMethod(\'checkValidity\', function () {\n .declareMethod(\'checkValidity\', function () {\n
//xxx check time range (start_datetime, end_datetime)\n var gadget = this,\n
return true;\n valide = true,\n
})\n start_datetime = false,\n
.declareMethod(\'getContent\', function () {\n end_datetime = false,\n
var gadget = this;\n datetime_string,\n
select = gadget.element.querySelector("select"),\n
datetime,\n
input = gadget.element.querySelector(\'input\'),\n
field_json = gadget.props.field_json;\n
if (!input.checkValidity()) {\n
return false;\n
}\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return gadget.getDateTime();\n return gadget.notifyValid();\n
})\n
.push(function () {\n
return gadget.getContent();\n
})\n })\n
.push(function (result) {\n .push(function (result) {\n
return result;\n datetime_string = result[field_json.subfield_month_key];\n
datetime_string += "," + result[field_json.subfield_day_key];\n
datetime_string += "," + result[field_json.subfield_year_key];\n
if (field_json.date_only === 0) {\n
if (result[field_json.subfield_ampm_key] === "pm") {\n
result[field_json.subfield_hour_key] += 12;\n
}\n
datetime_string += " " + result[field_json.subfield_hour_key];\n
datetime_string += ":" + result[field_json.subfield_minute_key] + ":00";\n
datetime_string += "+0000";\n
}\n
if (datetime_string.indexOf("NaN") !== -1) {\n
valide = false;\n
return gadget.notifyInvalid("Invalide DateTime");\n
}\n
if (field_json.start_datetime) {\n
start_datetime = Date.parse(field_json.start_datetime);\n
}\n
if (field_json.end_datetime) {\n
end_datetime = Date.parse(field_json.end_datetime);\n
}\n
if ((start_datetime === false) && (end_datetime === false)) {\n
return;\n
}\n
datetime = Date.parse(datetime_string);\n
datetime -= (select.selectedIndex - 12) * 60 * 60 * 1000;\n
if (start_datetime) {\n
if (start_datetime > datetime) {\n
valide = false;\n
return gadget.notifyInvalid("The date and time you entered earlier than the start time");\n
}\n
}\n
if (end_datetime) {\n
if (end_datetime <= datetime) {\n
valide = false;\n
return gadget.notifyInvalid("The date and time you entered later than the end time");\n
}\n
}\n
})\n
.push(function () {\n
return valide;\n
});\n });\n
})\n
.declareService(function () {\n
////////////////////////////////////\n
// Inform when the field input is invalid\n
////////////////////////////////////\n
var field_gadget = this;\n
\n
function notifyInvalid(evt) {\n
return field_gadget.notifyInvalid(evt.target.validationMessage);\n
}\n
\n
// Listen to input change\n
return loopEventListener(\n
field_gadget.element.querySelector(\'input\'),\n
\'invalid\',\n
false,\n
notifyInvalid\n
);\n
});\n });\n
\n \n
}(window, rJS, RSVP)); }(window, rJS, RSVP));
...@@ -356,7 +505,7 @@ ...@@ -356,7 +505,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>940.62359.8275.23142</string> </value> <value> <string>941.11170.29635.26282</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -374,7 +523,7 @@ ...@@ -374,7 +523,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1423850641.53</float> <float>1424711511.37</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_ui_datetimefield_zuite</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>
<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>_text</string> </key>
<value> <unicode 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 RenderJS UI</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<!-- Clean Up -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<!-- Initialize -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/web_site_module/renderjs_runner/</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Bars\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Bars</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Add\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Bar</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td>9915-14-21T11:00</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>pause</td>\n
<td>3000</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td></td>\n
</tr>\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </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>testInvalidDateTime</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>
<?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>_text</string> </key>
<value> <unicode 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 RenderJS UI</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<!-- Clean Up -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<!-- Initialize -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/web_site_module/renderjs_runner/</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Bars\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Bars</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Add\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Bar</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td>2004-02-29T23:10</td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT-10</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>pause</td>\n
<td>3000</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td>2004-02-29T23:10:00</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT-10</td>\n
</tr>\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </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>testLeapYear</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>
<?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>_text</string> </key>
<value> <unicode 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 RenderJS UI</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<!-- Clean Up -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<!-- Initialize -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/web_site_module/renderjs_runner/</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Bars\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Bars</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Add\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Bar</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td>2015-12-21T11:00</td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td>2016-12-21T12:00</td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT+5</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>pause</td>\n
<td>3000</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td>2015-12-21T11:00:00</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td>2016-12-21T12:00:00</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT+5</td>\n
</tr>\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </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>testSetDateTimeZone</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>
<?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>_text</string> </key>
<value> <unicode 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 RenderJS UI</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<!-- Clean Up -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<!-- Initialize -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/web_site_module/renderjs_runner/</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Bars\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Bars</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Add\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Bar</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td>0016-12-21T12:00</td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td>0022-12-21T09:00</td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT+5</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>pause</td>\n
<td>3000</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_stop_date\']</td>\n
<td>2016-12-21T12:00:00</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT+5</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_start_date\']</td>\n
<td>2022-12-21T09:00:00</td>\n
</tr>\n
\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </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>testSetDateTimeZone2DigitsYear</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>
<?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>_text</string> </key>
<value> <unicode 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 RenderJS UI</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<!-- Clean Up -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<!-- Initialize -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/web_site_module/renderjs_runner/</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//h3[@data-i18n=\'Other\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Bars\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Bars</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Add\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Bar</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT+5</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>pause</td>\n
<td>3000</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Tabs\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'DateTimeField\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//select[@class=\'gmt_select\']</td>\n
<td>GMT</td>\n
</tr>\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </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>testSetTimeZoneWithoutDateTime</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>
portal_tests/renderjs_ui_datetimefield_zuite
portal_tests/renderjs_ui_datetimefield_zuite/**
portal_tests/renderjs_ui_zuite portal_tests/renderjs_ui_zuite
portal_tests/renderjs_ui_zuite/** portal_tests/renderjs_ui_zuite/**
\ 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