Commit 68dad4af authored by Jérome Perrin's avatar Jérome Perrin

renderjs: adjust <input type="datetime-local"> support

We were setting the value to a string with seconds like
`2010-01-01T00:00:00` and all the tests were testing that the value of
the input element was exactly the same (ie. with seconds), but [the spec]
mentions that value is:

 - A valid date string representing the date.
 - A U+0054 LATIN CAPITAL LETTER T character (T).
 - A valid time string representing the time, expressed as the shortest
  possible string for the given time (e.g. omitting the seconds
  component entirely if the given time is zero seconds past the minute).

The test works fine when running on firefox 68 (the one from testnodes),
because this version does not implements datetime-local and such field
behave like text inputs, but when running with a modern browser
implementing the spec, the test fails because the value from the fields
`.value` does not have seconds.

While the change to rjs_gadget_erp5_datetimefield_js is not strictly
necessary, because when setting the value on a datetime-local the value
will be normalized and having 00 seconds or omitting the seconds is same,
this is done to keep the test passing on old browsers without support
for datetime-local fields.

[the spec]: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#concept-datetime-local
parent 91adac4b
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'send',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -49,7 +49,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_create_event_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Sent',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -42,7 +42,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'send',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -79,7 +79,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_create_event_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Sent',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -50,7 +50,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_create_event_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Draft',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -47,7 +47,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_response_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Draft',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -47,7 +47,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_response_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Draft',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -49,7 +49,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -49,7 +49,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_notification_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -47,7 +47,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -47,7 +47,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_notification_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'Test event',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'send',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -51,7 +51,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'Test event',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Sent',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -54,7 +54,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'Test event',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'send',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -93,7 +93,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'Test event',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Sent',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -51,7 +51,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_create_event_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Draft',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -49,7 +49,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_response_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Draft',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -49,7 +49,7 @@
<tal:block tal:define="response_configuration python: {'field_my_title': 'erp5_crm_ui_test_response_title',
'field_my_portal_type': 'Letter',
'field_my_resource': '',
'field_my_start_date': '2010-01-01T00:00:00',
'field_my_start_date': '2010-01-01T00:00',
'simulation_state': 'Draft',
'field_my_source_title': 'erp5_crm_ui_test_agent_title',
'field_my_destination_title': 'erp5_crm_ui_test_customer_title',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -51,7 +51,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......
......@@ -28,7 +28,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_create_event_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......@@ -51,7 +51,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_title': 'erp5_crm_ui_test_notification_title',
'field_your_portal_type': 'Letter',
'field_your_resource': '',
'field_your_start_date': '2010-01-01T00:00:00',
'field_your_start_date': '2010-01-01T00:00',
'field_your_notification_message': '',
'field_your_event_workflow_action': 'draft',
'field_your_source': 'erp5_crm_ui_test_agent_title',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -49,7 +49,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......
......@@ -27,7 +27,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_response_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': 'erp5_crm_ui_test_notification_reference',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......@@ -49,7 +49,7 @@
<tal:block tal:define="dialog_content_configuration python: {'field_your_response_event_title': 'erp5_crm_ui_test_notification_title',
'field_your_response_event_portal_type': 'Letter',
'field_your_response_event_resource': '',
'field_your_response_event_start_date': '2010-01-01T00:00:00',
'field_your_response_event_start_date': '2010-01-01T00:00',
'field_your_response_event_notification_message': '',
'field_your_response_workflow_action': 'draft',
'field_my_default_destination': 'person_module/erp5_crm_ui_test_agent',
......
......@@ -223,7 +223,7 @@
if (!gadget.state.date_only) {
time = "T" + Math.floor(tmp_hour / 10) + tmp_hour % 10 + ":" +
Math.floor(tmp_minute / 10) + (tmp_minute % 10) + ":00";
Math.floor(tmp_minute / 10) + (tmp_minute % 10);
}
date = tmp_year + "-" + Math.floor(tmp_month / 10) +
(tmp_month % 10) + "-" +
......
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1609253131.45</float>
<float>1609253131.46</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -78,7 +78,7 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_start_date']//div[@data-gadget-scope='field']//p[@data-date='2015-12-21T11:00:00']</td>
<td>//div[@data-gadget-scope='field_my_start_date']//div[@data-gadget-scope='field']//p[@data-date='2015-12-21T11:00']</td>
<td></td>
</tr>
......@@ -90,7 +90,7 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//div[@data-gadget-scope='field']//p[@data-date='2016-12-21T12:00:00']</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//div[@data-gadget-scope='field']//p[@data-date='2016-12-21T12:00']</td>
<td></td>
</tr>
......@@ -145,7 +145,7 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//div[@data-gadget-scope='field']//p[@data-date='2016-12-21T12:00:00']</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//div[@data-gadget-scope='field']//p[@data-date='2016-12-21T12:00']</td>
<td></td>
</tr>
......
......@@ -67,7 +67,7 @@
<tr>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//input</td>
<td>2004-02-29T23:10:00</td>
<td>2004-02-29T23:10</td>
</tr>
<tr>
......
......@@ -123,9 +123,9 @@
</tal:block>
<tr>
<td>assertElementPresent</td>
<td>//input[@value='2017-02-22T22:22:00']</td>
<td></td>
<td>assertValue</td>
<td>//input[@name='field_my_start_date']</td>
<td>2017-02-22T22:22</td>
</tr>
<tr>
......
......@@ -78,7 +78,7 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_start_date']//div[@data-gadget-scope='field']//p[@data-date='2015-12-21T11:00:00']</td>
<td>//div[@data-gadget-scope='field_my_start_date']//div[@data-gadget-scope='field']//p[@data-date='2015-12-21T11:00']</td>
<td></td>
</tr>
......@@ -89,13 +89,13 @@
<tr>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_start_date']//input</td>
<td>2015-12-21T11:00:00</td>
<td>2015-12-21T11:00</td>
</tr>
<tr>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//input</td>
<td>2016-12-21T12:00:00</td>
<td>2016-12-21T12:00</td>
</tr>
<tr>
......
......@@ -73,7 +73,7 @@
<tr>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//input</td>
<td>2016-12-21T12:00:00</td>
<td>2016-12-21T12:00</td>
</tr>
<tr>
......@@ -85,7 +85,7 @@
<tr>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_start_date']//input</td>
<td>2022-12-21T09:00:00</td>
<td>2022-12-21T09:00</td>
</tr>
......
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