diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html index 7f28fb15564406d520e4f41820ffa7c8155af711..173399492e2a6acafcf2549bb202459101a880a1 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html @@ -171,7 +171,7 @@ <script id="listbox-nav-template" type="text/x-handlebars-template"> <a class="{{previous_classname}}" data-i18n="Previous" href="{{previous_url}}">Previous</a> <a class="{{next_classname}}" data-i18n="Next" href="{{next_url}}">Next</a> - <span class="ui-disabled ui-right" data-i18n="{{record}}">{{record}}</span> + <span class="ui-disabled ui-right">{{record}}</span> </script> <script id="listbox-template" type="text/x-handlebars-template"> diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml index 07128d687e751146cc8d9a8ec5d49f2438ba6e7e..5039f3d66017f9c6e805ed4689fa7898229b60f1 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml @@ -234,7 +234,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>965.14600.20468.49988</string> </value> + <value> <string>965.42445.26451.18841</string> </value> </item> <item> <key> <string>state</string> </key> @@ -252,7 +252,7 @@ </tuple> <state> <tuple> - <float>1518012378.11</float> + <float>1519380501.26</float> <string>UTC</string> </tuple> </state> diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js index 573caa369ccb7d26dd15df3817e75148c9805df7..a8af127d8415ec0322e8d8f21175112ab3b69bf4 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js @@ -446,10 +446,13 @@ // Trigger line content calculation result_queue .push(function () { - var loading_element_classList = gadget.element.querySelector(".listboxloader").classList, + var loading_element = gadget.element.querySelector(".listboxloader"), + loading_element_classList = loading_element.classList, tbody_classList = gadget.element.querySelector("table").querySelector("tbody").classList; // Set the loading icon and trigger line calculation loading_element_classList.add.apply(loading_element_classList, loading_class_list); + // remove pagination information + loading_element.textContent = ''; tbody_classList.add(disabled_class); return gadget.fetchLineContent(false); @@ -463,7 +466,8 @@ var lines = gadget.state.lines, promise_list = [], allDocs_result = gadget.state.allDocs_result, - counter; + counter, + pagination_message = ''; column_list = JSON.parse(gadget.state.column_list_json); // for actual allDocs_result structure see ref:gadget_erp5_jio.js @@ -583,10 +587,16 @@ if ((gadget.state.begin_from === 0) && (counter === 0)) { record = variable.translated_no_record; + pagination_message = 0; } else if ((allDocs_result.data.rows.length <= lines) && (gadget.state.begin_from === 0)) { record = counter + " " + variable.translated_records; + pagination_message = counter; } else { - record = variable.translated_records + " " + (((gadget.state.begin_from + lines) / lines - 1) * lines + 1) + " - " + (((gadget.state.begin_from + lines) / lines - 1) * lines + counter); + pagination_message = (((gadget.state.begin_from + lines) / lines - 1) * lines + 1) + " - " + (((gadget.state.begin_from + lines) / lines - 1) * lines + counter); + if (allDocs_result.count !== undefined) { + pagination_message += ' / ' + allDocs_result.count; + } + record = variable.translated_records + " " + pagination_message; } if (gadget.state.begin_from === 0) { @@ -603,12 +613,11 @@ "next_classname": next_classname, "next_url": next_url }) - ) - .push(function (listbox_nav_html) { - gadget.element.querySelector('nav').innerHTML = listbox_nav_html; - }); + ); }) - .push(function () { + .push(function (listbox_nav_html) { + gadget.element.querySelector('nav').innerHTML = listbox_nav_html; + var result_sum = (gadget.state.allDocs_result.sum || {}).rows || [], // render summary footer if available summary = result_sum.map(function (row, row_index) { var row_editability = row['listbox_uid:list'] !== undefined; @@ -639,8 +648,10 @@ return renderTablePart(gadget, listbox_tfoot_template, summary, "tfoot"); }) .push(function () { - var loading_element_classList = gadget.element.querySelector(".listboxloader").classList; + var loading_element = gadget.element.querySelector(".listboxloader"), + loading_element_classList = loading_element.classList; loading_element_classList.remove.apply(loading_element_classList, loading_class_list); + loading_element.textContent = '(' + pagination_message + ')'; }); }); } diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml index 0ef1ca1f4859a9beb8ee57fcd5fbb278a7edc950..9aafee4b159ce3ff2e8d862b57c82a35fded9b19 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml @@ -236,7 +236,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>964.60204.10137.19421</string> </value> + <value> <string>965.44873.24271.11298</string> </value> </item> <item> <key> <string>state</string> </key> @@ -254,7 +254,7 @@ </tuple> <state> <tuple> - <float>1516364900.78</float> + <float>1519377228.21</float> <string>UTC</string> </tuple> </state> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt index 863aeea9794cba71898f36a0b1b69390340df506..8bc6a578981d3b55331c97f982a35dddcabb8aab 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt @@ -64,11 +64,9 @@ <td></td> </tr> -<tr> - <td>waitForElementPresent</td> - <td>//span[@data-i18n='1 Records']</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr> <td>waitForElementPresent</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEmptyListboxWithStat.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEmptyListboxWithStat.zpt index 59a80ead7964f6066012da58825a0aa3174b5086..5a0389b37685be9d12858129575c521c2fc60954 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEmptyListboxWithStat.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEmptyListboxWithStat.zpt @@ -35,8 +35,10 @@ Ensure empty listbox does not show stat line even though it receives stat data. <tr><td>open</td> <td>${renderjs_url}/#/foo_module</td><td></td></tr> -<tr><td>waitForElementPresent</td> - <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav/span[@data-i18n="No records"]</td><td></td></tr> + +<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr><td>assertElementNotPresent</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//table/tfoot/tr</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testManualPagination.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testManualPagination.zpt index 693b0d6ad448cec95588b5f28344c0eedfdc7359..2d5645b23b196f313f9ec691332626bd528f795b 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testManualPagination.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testManualPagination.zpt @@ -50,8 +50,9 @@ a damn about limits so it is perfect adept for testing. <td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr> <tr><td>assertElementNotPresent</td><!-- "Next" link must be enabled --> <td>${listbox}//a[@data-i18n="Next" and contains(@class, "ui-disabled")]</td><td></td></tr> -<tr><td>assertTextPresent</td> - <td>Records 1 - 3</td><td></td></tr> +<tal:block tal:define="pagination_configuration python: {'header': '(1 - 3)', 'footer': 'Records 1 - 3'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr><td>click</td> <td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr> @@ -60,8 +61,9 @@ a damn about limits so it is perfect adept for testing. <td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr> <tr><td>assertElementNotPresent</td><!-- "Next" link must be enabled --> <td>${listbox}//a[@data-i18n="Next" and contains(@class, "ui-disabled")]</td><td></td></tr> -<tr><td>assertTextPresent</td> - <td>Records 4 - 6</td><td></td></tr> +<tal:block tal:define="pagination_configuration python: {'header': '(4 - 6)', 'footer': 'Records 4 - 6'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr><td>click</td><!-- wait explicitely for the first listbox which holds the modification history --> <td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr> @@ -70,8 +72,9 @@ a damn about limits so it is perfect adept for testing. <td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr> <tr><td>assertElementPresent</td><!-- "Next" link must be disabled because we are at the end --> <td>${listbox}//a[@data-i18n="Next" and contains(@class, "ui-disabled")]</td><td></td></tr> -<tr><td>assertTextPresent</td> - <td>Records 7 - 8</td><td></td></tr> +<tal:block tal:define="pagination_configuration python: {'header': '(7 - 8)', 'footer': 'Records 7 - 8'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> </tbody></table> </body> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt index aa12084b63b26be2e53728508d1f0c8ee9e81532..8c2de735a365657cf74b9341adc7d1195f26d7d8 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt @@ -64,11 +64,9 @@ <td></td> </tr> -<tr> - <td>waitForElementPresent</td> - <td>//span[@data-i18n='1 Records']</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr> <td>waitForElementPresent</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt index 580a040848c36e4deba56c8f43c17c0657821c4c..1819369680075d095691af3ed26f8a5f42d8e812 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt @@ -108,11 +108,9 @@ <td></td> </tr> -<tr> - <td>waitForElementPresent</td> - <td>//span[@data-i18n='1 Records']</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr> <td>waitForElementPresent</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatColumns.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatColumns.zpt index 6bb81377d9c941afca5665c4af32f8f78eb27647..73cf2d825e215858bd4a5b00b5333250e2b03b46 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatColumns.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatColumns.zpt @@ -44,8 +44,9 @@ Ensure Stat Column methods are executed correctly and result displayed in tfoot <tr><td>open</td> <td>${renderjs_url}/#/foo_module</td><td></td></tr> -<tr><td>waitForElementPresent</td> - <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav/span[@data-i18n="2 Records"]</td><td></td></tr> +<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr><td>store</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//table</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMethod.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMethod.zpt index 3e1a3666d436230e2063466e0ca9e412eaf832f5..c048511ab3576c563b0d432158527e169343c0cc 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMethod.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMethod.zpt @@ -44,8 +44,9 @@ Ensure stat_method gets executed and result displayed in tfoot element of the li <tr><td>open</td> <td>${renderjs_url}/#/foo_module</td><td></td></tr> -<tr><td>waitForElementPresent</td> - <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav/span[@data-i18n="3 Records"]</td><td></td></tr> +<tal:block tal:define="pagination_configuration python: {'header': '(3)', 'footer': '3 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr><td>store</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//table</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMissing.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMissing.zpt index ea6584cd7a45adec25ea9ec1deb7d4c4fed40e3f..9bf127910dd01f19a68cf33e9311a705ad1de4b5 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMissing.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testStatMissing.zpt @@ -41,8 +41,9 @@ Ensure no stat line is displayed when no stat_method and no stat_columns are def <tr><td>open</td> <td>${renderjs_url}/#/foo_module</td><td></td></tr> -<tr><td>waitForElementPresent</td> - <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav/span[@data-i18n="3 Records"]</td><td></td></tr> +<tal:block tal:define="pagination_configuration python: {'header': '(3)', 'footer': '3 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tr><td>assertElementNotPresent</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//table/tfoot/tr</td> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormListSearchResetsPagination.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormListSearchResetsPagination.zpt index 280c242de0dc2e9faa9dc4d214749607b2487892..76ffd50cdd9e564b436639642437d50992f54d08 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormListSearchResetsPagination.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormListSearchResetsPagination.zpt @@ -70,21 +70,17 @@ <td>Title 10</td> <td></td> </tr> -<tr> - <td>waitForElementPresent</td> - <td>//span[@data-i18n='1 Records']</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <!-- Pagination keeps search query --> <tal:block tal:define="search_query python: '%'"> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" /> </tal:block> -<tr> - <td>waitForElementPresent</td> - <td>//span[@data-i18n='Records 1 - 3']</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(1 - 3 / 25)', 'footer': 'Records 1 - 3 / 25'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tal:block tal:define="parsed_query python: ''; search_query python: '%'"> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" /> @@ -94,11 +90,9 @@ <td>//a[@data-i18n='Next']</td> <td></td> </tr> -<tr> - <td>waitForElementPresent</td> - <td>//span[@data-i18n='Records 4 - 6']</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(4 - 6 / 25)', 'footer': 'Records 4 - 6 / 25'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <tal:block tal:define="parsed_query python: ''; search_query python: '%'"> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" /> diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_translate_zuite/testPageFront.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_translate_zuite/testPageFront.zpt index 39b6f51e9573ff5c56dec7a057375be8985f24d2..579714582738ae36c49f994fb94e0bf07b303132 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_translate_zuite/testPageFront.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_translate_zuite/testPageFront.zpt @@ -106,9 +106,6 @@ </tr> - -<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" /> - </tbody></table> </body> </html> \ No newline at end of file diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt index 4690ed2f0606900fd59b93f1fa3308a9165129a1..4d9c20a466910a7a62931a7d0add7e20478d3040 100644 --- a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt @@ -168,11 +168,9 @@ <td></td> </tr> -<tr> - <td>waitForTextPresent</td> - <td>2 Records</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <!-- Wait for the action page and click on the delete link --> <tr> @@ -333,17 +331,9 @@ <td></td> </tr> -<tr> - <td>waitForTextPresent</td> - <td>No records</td> - <td></td> -</tr> - -<tr> - <td>verifyTextPresent</td> - <td>No records</td> - <td></td> -</tr> +<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}"> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> +</tal:block> <!-- Wait for the action page and check no delete link is here--> <tr> diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Zuite_CommonTemplateForRenderjsUi.zpt b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Zuite_CommonTemplateForRenderjsUi.zpt index 1ba11bd0607c8441d31bfc5f052e609f425fd676..067214d7f0c946321fd433f4acd6f70aacca8a10 100644 --- a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Zuite_CommonTemplateForRenderjsUi.zpt +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Zuite_CommonTemplateForRenderjsUi.zpt @@ -53,7 +53,7 @@ <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/trash_editor_configuration" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" /> - <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" /> + <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" /> </tal:block> <tal:block metal:define-macro="submit_search_filter"> @@ -231,13 +231,47 @@ </tr> </tal:block> + <tal:block metal:define-macro="check_listbox_pagination_text"> + <tr> + <td colspan="3"><b tal:content="python: 'Check the listbox pagination text: %s' % pagination_configuration"></b></td> + </tr> + <tr> + <td>waitForElementPresent</td> + <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_listbox.html\')]//h1//span[@class=\'listboxloader\' and text()=\'%(header)s\']' % pagination_configuration"></td> + <td></td> + </tr> + <tr> + <td>assertElementPresent</td> + <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_listbox.html\')]//h1//span[@class=\'listboxloader\' and text()=\'%(header)s\']' % pagination_configuration"></td> + <td></td> + </tr> + <tr> + <td>waitForElementPresent</td> + <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_listbox.html\')]//nav//span[@class=\'ui-disabled ui-right\' and text()=\'%(footer)s\']' % pagination_configuration"></td> + <td></td> + </tr> + <tr> + <td>assertElementPresent</td> + <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_listbox.html\')]//nav//span[@class=\'ui-disabled ui-right\' and text()=\'%(footer)s\']' % pagination_configuration"></td> + <td></td> + </tr> + <tr> + <td colspan="3"><p></p></td> + </tr> + </tal:block> + <tal:block metal:define-macro="wait_for_listbox_loaded"> <tr> <td colspan="3"><b>Wait for the listbox to be loaded</b></td> </tr> + <tr> + <td>waitForElementNotPresent</td> + <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//h1//span[contains(@class, "ui-icon-spinner")]</td> + <td></td> + </tr> <tr> <td>waitForElementPresent</td> - <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav//span[contains(@data-i18n, "Records")]</td> + <td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav//span[contains(text(), "ecord")]</td> <td></td> </tr> <tr>