Commit 94cf3d82 authored by Boxiang Sun's avatar Boxiang Sun

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

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