Commit a1ef9e80 authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_web_monitoring_ui_test: Update the test with Zuites

parent 288a1967
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
tal:define="global TEST_NAME string:Test SlapOS Monitoring UI Manual Synchronization">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="TEST_NAME"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="TEST_NAME"></td></tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/monitoring_ui_setup"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/add_monitoring_endpoint"/>
<tr>
<td colspan="3"><b>Synchronize manually</b></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Synchronize'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Synchronizing Data...'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Synchronisation finished.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tr>
<td>assertTextPresent</td>
<td>Problem with test:
<ul>
<li><i>Synchronizing Data...</i> and <i>Synchronisation finished.</i>, even if there are problems</li>
</ul>
</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_web_monitoring_ui_test</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>description</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>text</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_CommonTemplateForMonitoringUi</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Common Template for All Monitoring ui Zuite</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="add_monitoring_endpoint">
<tr>
<td colspan="3"><b>Add monitoring endpoint</b></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Monitoring Configurations'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//input[@name='check_online_access']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/save" />
<tal:block tal:define="click_configuration python: {'text': 'Add'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/wait_for_content_loaded" />
<tr>
<td>type</td>
<td>name=url</td>
<td>${MONITORING_OPML_URL}</td>
</tr>
<tr>
<td>type</td>
<td>name=username</td>
<td>${MONITORING_USERNAME}</td>
</tr>
<tr>
<td>type</td>
<td>name=password</td>
<td>${MONITORING_PASSWORD}</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//span[contains(@class, 'ui-text-error')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@data-i18n='Monitoring Promises Status']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@data-i18n='Monitoring Promises Status']</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Monitoring Configurations'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//button[@id="destroyOPML"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@id="destroyOPML"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a["${MONITORING_OPML_URL}"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a["${MONITORING_OPML_URL}"]</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="monitoring_ui_setup">
<tr tal:define="
global MONITORING_INSTANCE_ROOT string:rootInstance;
global MONITORING_INSTANCE_1 string:subInstance-1;
global MONITORING_INSTANCE_2 string:subInstance-2;
global MONITORING_USERNAME string:admin;
global MONITORING_PASSWORD string:ntpvmhkg;
global MONITORING_HOSTING_TITLE string:TEST Hosting Subscription">
<td colspan="3"><b>Monitoring UI Zuite Setup</b></td>
</tr>
<tr>
<td>store</td>
<td tal:content="MONITORING_INSTANCE_ROOT"></td>
<td>MONITORING_INSTANCE_ROOT</td>
</tr>
<tr>
<td>store</td>
<td tal:content="MONITORING_INSTANCE_1"></td>
<td>MONITORING_INSTANCE_1</td>
</tr>
<tr>
<td>store</td>
<td tal:content="MONITORING_INSTANCE_2"></td>
<td>MONITORING_INSTANCE_2</td>
</tr>
<tr>
<td>store</td>
<td tal:content="MONITORING_USERNAME"></td>
<td>MONITORING_USERNAME</td>
</tr>
<tr>
<td>store</td>
<td tal:content="MONITORING_PASSWORD"></td>
<td>MONITORING_PASSWORD</td>
</tr>
<tr>
<td>store</td>
<td tal:content="MONITORING_HOSTING_TITLE"></td>
<td>MONITORING_HOSTING_TITLE</td>
</tr>
<tr>
<td>store</td>
<td tal:content="here/portal_tests/web_monitoring_ui_zuite/MonitorBackend_getBaseUrl">http://example.com/erp5</td>
<td>MONITORING_SIMULATOR_URL</td>
</tr>
<tr>
<td>store</td>
<td>${MONITORING_SIMULATOR_URL}/rootInstance/public/feeds</td>
<td>MONITORING_OPML_URL</td>
</tr>
<tr>
<td>store</td>
<td>test_promise_2</td>
<td>MONITORING_PROMISE_TITLE</td>
</tr>
<tr>
<td colspan="3"><b>Cleanup</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td colspan="3"><b>Initialize</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_monitoring/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td colspan="3"><b>TODO XXX: Remove or assert all monitoring configurations -- BEGIN</b></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Monitoring Configurations'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tr>
<td colspan="3"><b>TODO XXX: Remove or assert all monitoring configurations -- END</b></td>
</tr>
</tal:block>
<tal:block metal:define-macro="click_save">
<tr>
<td colspan="3"><b>Click on Save</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//button[@data-i18n='Save'][contains(@class, "ui-disabled")]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//button[@data-i18n='Save'][contains(@class, "ui-disabled")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//button[@data-i18n='Save']</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="save">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/click_save" />
<tr>
<td colspan="3"><b>Save</b></td>
</tr>
<!-- Save Button is disabled -->
<tr>
<td>verifyElementPresent</td>
<td>//button[@data-i18n="Save"][contains(@class, "ui-disabled")]</td>
<td></td>
</tr>
<!-- First loader while calling Base_edit -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForMonitoringUi/macros/wait_for_content_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Data updated.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@data-i18n="Save"][contains(@class, "ui-icon-check")]</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
<tal:block metal:define-macro="wait_for_content_loaded">
<tr>
<td colspan="3"><b>Wait for the content to be loaded</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//h1//*[contains(@class, "ui-icon-spinner")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_officejs_monitoring_header.html')]//h1//*[contains(@class, "ui-icon-spinner")]</td>
<td></td>
</tr>
<!-- XXX Sadly, spinner currently is dropped before all DOM modifications are done.
Until this is fixed, we use the ugly pause command -->
<tr>
<td>pause</td>
<td>100</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
</tal:block>
\ No newline at end of file
erp5_web_monitoring_ui_test
\ No newline at end of file
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