Commit 6e49c55d authored by Boxiang Sun's avatar Boxiang Sun

erp5_user_tutorial_ui_test: Update some macros in Zuite_viewTestMacroLibrary.zpt for ERP5JS UI

parent a0fc4b68
<tal:block metal:define-macro="init_test_environment">
<tr>
<td colspan="3"><b>Init test environment</b></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python:
here.REQUEST.get('URL')[0:here.REQUEST.get('URL').find('/portal_tests/')]">erp5</td>
here.REQUEST.get('URL')[0:here.REQUEST.get('URL').find('/portal_tests/')] + '/web_site_module/osoe_runner/'"></td>
<td>base_url</td>
</tr>
<!-- Always initialize browser to English language -->
......@@ -18,24 +21,41 @@
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/view</td>
<td>${base_url}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/login_as_manager">Login As Manager</span>
</tal:block>
<tal:block metal:define-macro="login_as_manager">
<!-- Login as manager -->
<tal:block metal:define-macro="logout">
<tr>
<td colspan="3"><b>Logout</b></td>
</tr>
<!-- Logout -->
<tr>
<td>openAndWait</td>
<td>${base_url}/logout</td>
<td>${base_url}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Logout'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>openAndWait</td>
<td>${base_url}/login_form</td>
<td>click</td>
<td>//input[@value="Confirm"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
</tal:block>
<tal:block metal:define-macro="login_as_manager">
<tr>
<td colspan="3"><b>Login as manager</b></td>
</tr>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/logout">Logout</span>
<tr>
<td>type</td>
<td>//input[@name="__ac_name"]</td>
......@@ -49,25 +69,18 @@
here.Zuite_getHowToInfo()['manager_password']"></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@name="logged_in:method"]</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/view</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['manager_username']"></td>
<td>click</td>
<td>//input[@value="Login"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
</tal:block>
<tal:block metal:define-macro="wait_for_activities">
<!-- Wait for activities to finish -->
<tr>
<td colspan="3"><b>Wait for activities to finish</b></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_waitForActivities</td>
......@@ -77,7 +90,7 @@
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
</tr>
</tal:block>
<tal:block metal:define-macro="invoke_simulation_alarms">
......@@ -91,11 +104,14 @@
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
</tr>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities </span>
</tal:block>
<tal:block metal:define-macro="login_as_functional_test_user">
<tr>
<td colspan="3"><b>Login as functional test user</b></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_createFunctionalTestUser</td>
......@@ -117,17 +133,15 @@
<td>Cleared.</td>
<td></td>
</tr>
<!-- login with functional test user -->
<tr>
<td>openAndWait</td>
<td>${base_url}/logout</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/login_form</td>
<td>open</td>
<td>${base_url}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- login with functional test user -->
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/logout">Logout</span>
<tr>
<td>type</td>
<td>//input[@name="__ac_name"]</td>
......@@ -141,21 +155,11 @@
here.Zuite_getHowToInfo()['functional_test_user_password']"></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@name="logged_in:method"]</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/view</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['functional_test_username']"></td>
<td>click</td>
<td>//input[@value="Login"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities</span>
<tr>
<td>openAndWait</td>
......@@ -179,9 +183,10 @@
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/view</td>
<td>${base_url}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
</tal:block>
<tal:block metal:define-macro="login_as_functional_another_test_user">
......
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