Commit c464b07a authored by Lu Xu's avatar Lu Xu 👀

slapos_jio_ui_test: add test part for language navigation

parent 262d93a7
......@@ -75,6 +75,11 @@
<td>//a[@data-i18n='Networks']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Language']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Logout']</td>
......@@ -124,6 +129,12 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_front_page" />
</tal:block>
<tal:block define="menu_item python: 'Language'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_language" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_page_header" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_front_page" />
</tal:block>
<tr>
<td colspan="3"><b>Access modules and verify the redirect</b></td>
</tr>
......
......@@ -42,6 +42,11 @@
</tal:block>
</tal:block>
<tal:block metal:define-macro="access_menu_item_language">
<tal:block tal:define="panel_gadget_id python: 'gadget_slapos_panel.html'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_language_base" />
</tal:block>
</tal:block>
......@@ -337,12 +342,12 @@
dummy python:context.REQUEST.set('mapping', {})">
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[@data-i18n=\'%s\']' % header_translation"></td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[contains(text(), \'%s\')]' % header_translation"></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\']' % header_translation"></td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[contains(text(), \'%s\')]' % header_translation"></td>
<td></td>
</tr>
</tal:block>
......@@ -387,6 +392,44 @@
</tr>
</tal:block>
<tal:block metal:define-macro="access_menu_item_language_base">
<tr>
<td colspan="3"><b tal:content="python: 'Access Entry on the Menu for Language'"> Menu Item </b></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'%s\')]//a[@data-i18n=\'%s\']' % (panel_gadget_id, menu_item)"></td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_slapos_header.html\')]//a[contains(text(), \'%s\')]' % here.Base_translateString(menu_item, lang=lang)"></td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_label_field.html\')]//label[text()=\'%s\']' % here.Base_translateString(menu_item, lang=lang)"></td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_label_field.html\')]//label[text()=\'%s\']' % here.Base_translateString(menu_item, lang=lang)"></td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="add_simple_with_title">
<tr>
<td colspan="3"><b tal:content="python: 'Add an entry with title as %s' % title"> Menu Item </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