Commit ab4f4f01 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui_test] Add pagination macros

parent dc33f078
......@@ -88,11 +88,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tr>
<td>click</td>
<td>//a[@data-i18n="Next"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tr>
<td>waitForElementNotPresent</td>
......@@ -110,16 +106,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_previous" />
<tr>
<td>waitForElementNotPresent</td>
......
......@@ -90,6 +90,7 @@
<td>//a[@data-i18n='Next']</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n = "Title 0"]</td>
......
......@@ -90,19 +90,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Next"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Next"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="search_query python: 'quantity: invalide'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
......@@ -110,7 +98,7 @@
<tr>
<td>waitForElementPresent</td>
<td>//span[@data-i18n="Invalid Search Criteria"]</td>
<td>//span[text()="Invalid Search Criteria"]</td>
<td></td>
</tr>
......@@ -120,12 +108,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Next"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tr>
<td>verifyElementNotPresent</td>
......
......@@ -47,31 +47,27 @@ a damn about limits so it is perfect adept for testing.
<td>${renderjs_url}/#/foo_module/1?editable=1</td><td></td></tr>
<tr><td>waitForElementPresent</td><!-- wait explicitely for the first listbox which holds the modification history -->
<td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr>
<td>${listbox}//a[text()="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>
<td>${listbox}//a[text()="Next" and contains(@class, "ui-disabled")]</td><td></td></tr>
<tal:block tal:define="pagination_configuration python: {'header': '(1 - 3 / 8)', 'footer': 'Records 1 - 3 / 8'}">
<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>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tr><td>waitForElementPresent</td>
<td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr>
<td>${listbox}//a[text()="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>
<td>${listbox}//a[text()="Next" and contains(@class, "ui-disabled")]</td><td></td></tr>
<tal:block tal:define="pagination_configuration python: {'header': '(4 - 6 / 8)', 'footer': 'Records 4 - 6 / 8'}">
<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>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tr><td>waitForElementPresent</td><!-- wait explicitely for the first listbox which holds the modification history -->
<td>${listbox}//a[@data-i18n="Next"]</td><td></td></tr>
<td>${listbox}//a[text()="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>
<td>${listbox}//a[text()="Next" and contains(@class, "ui-disabled")]</td><td></td></tr>
<tal:block tal:define="pagination_configuration python: {'header': '(7 - 8 / 8)', 'footer': 'Records 7 - 8 / 8'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
......
......@@ -107,17 +107,7 @@
<td>Title 2</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Next</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Next</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tr>
<td>waitForElementNotPresent</td>
......@@ -151,17 +141,8 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Next</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tr>
<td>click</td>
<td>link=Next</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
......@@ -194,19 +175,7 @@
<td>Title 8</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Previous</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Previous</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_previous" />
<tr>
<td>waitForElementNotPresent</td>
......
......@@ -54,13 +54,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<!-- start -->
<tr>
<td>click</td>
<td>//a[@data-i18n='Next']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tal:block tal:define="search_query python: 'Title 10'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
......@@ -85,11 +79,9 @@
search_query python: '%'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tr>
<td>click</td>
<td>//a[@data-i18n='Next']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<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>
......
......@@ -214,7 +214,8 @@
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<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="search_in_form_list_without_header_url">
......@@ -362,6 +363,49 @@
</tr>
</tal:block>
<tal:block metal:define-macro="paginate_next">
<tr>
<td colspan="3"><b tal:content="python: 'Paginate to the listbox next page'"></b></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav//a[@class='ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav//a[@class='ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
<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="paginate_previous">
<tr>
<td colspan="3"><b tal:content="python: 'Paginate to the listbox previous page'"></b></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav//a[@class='ui-btn ui-icon-carat-l ui-btn-icon-left responsive ui-first-child']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//nav//a[@class='ui-btn ui-icon-carat-l ui-btn-icon-left responsive ui-first-child']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
<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="wait_for_listbox_loaded">
<tr>
<td colspan="3"><b>Wait for the listbox to be loaded</b></td>
......
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