Commit 16064cd6 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio_ui_test: Fix Functional Tests

Mostly make it more reliable against slowliness and particular corner cases (slow indexation, data formating)
parent d55e2a2f
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr> <tr><td rowspan="1" colspan="3">Test SlapOS UI Account Certificate</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_init" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_init" />
...@@ -66,8 +66,25 @@ ...@@ -66,8 +66,25 @@
</tr> </tr>
<tal:block define="menu_action python: 'Request Certificate'"> <tal:block define="menu_action python: 'Request Certificate'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tr>
</tal:block> <td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
</tal:block>
<tal:block define="header python: 'Request New Certificate'; "> <tal:block define="header python: 'Request New Certificate'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
...@@ -115,7 +132,24 @@ ...@@ -115,7 +132,24 @@
</tr> </tr>
<tal:block define="menu_action python: 'Request Certificate'"> <tal:block define="menu_action python: 'Request Certificate'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tr>
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
</tal:block> </tal:block>
<tal:block define="header python: 'Request New Certificate'; "> <tal:block define="header python: 'Request New Certificate'; ">
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr> <tr><td rowspan="1" colspan="3">Test SlapOS JS Account Token</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_init" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_init" />
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%s%s-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td> <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%02d%02d-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%s%s-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td> <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%02d%02d-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -217,6 +217,33 @@ ...@@ -217,6 +217,33 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block define="menu_item python: 'Servers'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block define="header python: 'Computer: TEST-SLAPOSJS-COMPUTER 0'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//th/a[text()="Software Release"]</td> <td>//th/a[text()="Software Release"]</td>
...@@ -243,7 +270,24 @@ ...@@ -243,7 +270,24 @@
</tal:block> </tal:block>
<tal:block define="menu_action python: 'Destroy'"> <tal:block define="menu_action python: 'Destroy'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tr>
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
</tal:block> </tal:block>
<tal:block define="header python: 'Destroy Software Installation'; "> <tal:block define="header python: 'Destroy Software Installation'; ">
...@@ -279,7 +323,24 @@ ...@@ -279,7 +323,24 @@
<tal:block define="menu_action python: 'Request Certificate'"> <tal:block define="menu_action python: 'Request Certificate'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tr>
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
</tal:block> </tal:block>
<tal:block define="header python: 'Request New Certificate'; "> <tal:block define="header python: 'Request New Certificate'; ">
...@@ -306,8 +367,24 @@ ...@@ -306,8 +367,24 @@
</tr> </tr>
<tal:block define="menu_action python: 'Revoke Certificate'"> <tal:block define="menu_action python: 'Revoke Certificate'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tr>
</tal:block> <td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr></tal:block>
<tal:block define="header python: 'Revoke Computer Certificate'; "> <tal:block define="header python: 'Revoke Computer Certificate'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
...@@ -330,7 +407,24 @@ ...@@ -330,7 +407,24 @@
</tal:block> </tal:block>
<tal:block define="menu_action python: 'Request Certificate'"> <tal:block define="menu_action python: 'Request Certificate'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tr>
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action"></td>
<td></td>
</tr>
</tal:block> </tal:block>
<tal:block define="header python: 'Request New Certificate'; "> <tal:block define="header python: 'Request New Certificate'; ">
...@@ -385,11 +479,11 @@ ...@@ -385,11 +479,11 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block> </tal:block>
<tr> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<td>click</td>
<td>//th/a[text()="Title"]</td> <tal:block define="menu_item python: 'Servers'; header menu_item">
<td></td> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tr> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}"> <tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
......
...@@ -58,12 +58,12 @@ ...@@ -58,12 +58,12 @@
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%s%s-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td> <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%02d%02d-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%s%s-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td> <td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_field_string.html\')]//p[contains(text(), \'%s%02d%02d-\')]' % (DateTime().year(),DateTime().month(),DateTime().day())"></td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -156,6 +156,31 @@ ...@@ -156,6 +156,31 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block define="menu_item python: 'Tickets'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SUPPORT-REQUEST 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-SUPPORT-REQUEST 0"]</td>
<td></td>
</tr>
<tal:block define="header python: 'Support Request : TEST-SLAPOSJS-SUPPORT-REQUEST 0'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}"> <tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block> </tal:block>
......
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