Commit 6e41423d authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio_ui_test: Update test for certificate

parent 332b5582
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<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>
<tr> <tr>
<td colspan="3"><b> Request User Certificate</b> </td> <td colspan="3"><b> Request User Certificate</b> </td>
</tr> </tr>
...@@ -75,70 +74,107 @@ ...@@ -75,70 +74,107 @@
</tal:block> </tal:block>
<tr> <tr>
<td colspan="3"><b> Request User Certificate</b> </td> <td colspan="3"><b> Request User Certificate (Again)</b> </td>
</tr> </tr>
<tal:block define="menu_action python: 'Request Certificate'"> <tal:block define="menu_action python: 'Request Certificate'">
<tr> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td> </tal:block>
</tr>
<tal:block define="header python: 'Request New Certificate'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Certificate is Requested.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td <td>//textarea[@name="certificate"]</td>
tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action">
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td <td>//textarea[@name="certificate"]</td>
tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action">
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>waitForElementPresent</td>
<td <td>//textarea[@name="key"]</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>//textarea[@name="key"]</td>
<td></td> <td></td>
</tr> </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" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_page_header" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block <tal:block define="person_name python: 'Demo User Functional'">
tal:define="notification_configuration python: {'class': 'success', <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_account" />
'text': 'This person already has one certificate, please revoke it before request a new one..'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(3)', 'footer': '${count} Records'};
<tal:block define="header python: 'Request New Certificate'; "> dummy python: context.REQUEST.set('mapping', {'count': '3'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_page_header" />
</tal:block> </tal:block>
<!-- We cannot assert title since we UI is generated automatically -->
<tr> <tr>
<td colspan="3"><b> Revoke Certificate</b></td> <td>verifyTextPresent</td>
<td>Certificate Login</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Certificate Login</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>CERTLOGIN-</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>CERTLOGIN-</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="Certificate Login"]</td>
<td></td>
</tr> </tr>
<tal:block define="menu_action python: 'Revoke Certificate'"> <tal:block define="header python: 'Certificate Login: ${title}';
dummy python: context.REQUEST.set('mapping', {'title' : ''})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header_contains" />
</tal:block>
<tal:block define="menu_action python: 'Delete'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block> </tal:block>
<tal:block define="header python: 'Revoke Person Certificate'; "> <tal:block define="header python: 'Disable Login: ${title}';
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> dummy python: context.REQUEST.set('mapping', {'title' : ''})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header_contains" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success', <tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Certificate is Revoked.'}"> 'text': 'Login is Disabled.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block> </tal:block>
...@@ -147,74 +183,106 @@ ...@@ -147,74 +183,106 @@
<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="person_name python: 'Demo User Functional'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_account" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '2'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<!-- We cannot assert title since we UI is generated automatically -->
<tr> <tr>
<td colspan="3"><b> Request User Certificate again</b> </td> <td>verifyTextPresent</td>
<td>Certificate Login</td>
<td></td>
</tr> </tr>
<tal:block define="menu_action python: 'Request Certificate'">
<tr> <tr>
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td> <td>verifyTextPresent</td>
<td>Certificate Login</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>verifyTextPresent</td>
<td <td>CERTLOGIN-</td>
tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action">
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>verifyTextPresent</td>
<td <td>CERTLOGIN-</td>
tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action">
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td <td>//a[text()="Certificate Login"]</td>
tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % menu_action">
</td>
<td></td> <td></td>
</tr> </tr>
<tal:block define="header python: 'Certificate Login: ${title}';
dummy python: context.REQUEST.set('mapping', {'title' : ''}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header_contains" />
</tal:block> </tal:block>
<tal:block define="header python: 'Request New Certificate'; "> <tal:block define="menu_action python: 'Delete'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block define="header python: 'Disable Login: ${title}';
dummy python: context.REQUEST.set('mapping', {'title' : ''}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header_contains" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success', <tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Certificate is Requested.'}"> 'text': 'Login is Disabled.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block> </tal:block>
<tal:block tal:define="header python: 'Your Account : ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'Demo User Functional'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block define="person_name python: 'Demo User Functional'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_account" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<!-- We cannot assert title since we UI is generated automatically -->
<tr> <tr>
<td>waitForElementPresent</td> <td>verifyTextNotPresent</td>
<td>//textarea[@name="certificate"]</td> <td>Certificate Login</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>verifyTextNotPresent</td>
<td>//textarea[@name="certificate"]</td> <td>Certificate Login</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>verifyTextNotPresent</td>
<td>//textarea[@name="key"]</td> <td>CERTLOGIN-</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>verifyTextNotPresent</td>
<td>//textarea[@name="key"]</td> <td>CERTLOGIN-</td>
<td></td> <td></td>
</tr> </tr>
<tal:block define="header python: 'Request New Certificate'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_logout" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_logout" />
</tbody> </tbody>
......
...@@ -147,11 +147,6 @@ function redirect us to the login page --> ...@@ -147,11 +147,6 @@ function redirect us to the login page -->
<td>//a[@data-i18n="Request Certificate"]</td> <td>//a[@data-i18n="Request Certificate"]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@data-i18n="Revoke Certificate"]</td>
<td></td>
</tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td tal:content="python: '//label[contains(text(), \'%s\')]' % (here.Base_translateString('First Name', lang=lang))"></td> <td tal:content="python: '//label[contains(text(), \'%s\')]' % (here.Base_translateString('First Name', lang=lang))"></td>
......
...@@ -462,6 +462,22 @@ ...@@ -462,6 +462,22 @@
</tal:block> </tal:block>
</tal:block> </tal:block>
<tal:block metal:define-macro="assert_page_header_contains">
<tal:block tal:define="header_translation python: here.Base_translateString(header, mapping=context.REQUEST.get('mapping', {}), lang=lang);
dummy python:context.REQUEST.set('mapping', {})">
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[contains(@data-i18n, \'%s\')]' % header_translation"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[contains(@data-i18n, \'%s\')]' % header_translation"></td>
<td></td>
</tr>
</tal:block>
</tal:block>
<tal:block metal:define-macro="click_page_header"> <tal:block metal:define-macro="click_page_header">
<tal:block tal:define="header_translation python: here.Base_translateString(header, mapping=context.REQUEST.get('mapping', {}), lang=lang); <tal:block tal:define="header_translation python: here.Base_translateString(header, mapping=context.REQUEST.get('mapping', {}), lang=lang);
dummy python:context.REQUEST.set('mapping', {})"> dummy python:context.REQUEST.set('mapping', {})">
......
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