Commit d0a4c42e authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel_ui_test: execute all alarms at the end of the test to detect unexpected side effects

parent 80fd41e2
...@@ -4,6 +4,22 @@ from AccessControl.SecurityManagement import setSecurityManager ...@@ -4,6 +4,22 @@ from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
def ERP5Site_activateAlarmSlapOSPanelTest(self):
portal = self.getPortalObject()
sm = getSecurityManager()
try:
newSecurityManager(None, portal.acl_users.getUser(SUPER_USER))
for alarm in portal.portal_alarms.contentValues():
if alarm.isEnabled():
alarm.activeSense()
finally:
setSecurityManager(sm)
return "Alarms activated."
def ERP5Site_bootstrapSlapOSPanelTest(self, scenario, customer_login, def ERP5Site_bootstrapSlapOSPanelTest(self, scenario, customer_login,
manager_login, passwd): manager_login, passwd):
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>ERP5Site_activateAlarmSlapOSPanelTest</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>SlapOSPanelUiTest</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_activateAlarmSlapOSPanelTest</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -100,7 +100,43 @@ ...@@ -100,7 +100,43 @@
</tal:block> </tal:block>
<tal:block metal:define-macro="activate_alarm">
<tr>
<td colspan="3"><b>Activate alarms</b></td>
</tr>
<tr>
<td>open</td>
<td tal:content="python: '${base_url}/ERP5Site_activateAlarmSlapOSPanelTest'">.../ERP5Site_activateAlarmSlapOSPanelTest</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Alarms activated.</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="check_consistency"> <tal:block metal:define-macro="check_consistency">
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<!-- run alarms multiple times, to detect unexpected side effects -->
<tal:block tal:repeat="step python: range(0, 5)">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/activate_alarm" />
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
</tal:block>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" /> <tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}"> <tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" /> <tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
......
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