Commit 3d14a4d0 authored by Yoshinori Okuji's avatar Yoshinori Okuji

TestTool utilizes Zelenium, if installed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8263 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a05920bf
......@@ -40,7 +40,10 @@ from Products.ERP5 import _dtmldir
from zLOG import LOG
class TestTool (BaseTool):
try:
from Products.Zelenium.zuite import Zuite
class TestTool (Zuite, BaseTool):
"""
Container for fonctionnal tests.
"""
......@@ -55,4 +58,34 @@ class TestTool (BaseTool):
security.declareProtected( Permissions.ManagePortal, 'manage_overview' )
manage_overview = DTMLFile( 'explainTestTool', _dtmldir )
# Override this method to force Zuite objects are recursed.
def _recurseListTestCases( self, result, prefix, ob ):
for tcid, test_case in ob.objectItems():
if isinstance( test_case, Zuite ):
result.extend( test_case.listTestCases(
prefix=prefix + ( tcid, ) ) )
# Override this method to produce ERP5-style reports.
security.declarePublic('postResults')
def postResults(self, REQUEST):
""" Record the results of a test run.
"""
return self.TestTool_reportResult(REQUEST)
except ImportError:
class TestTool (BaseTool):
"""
This is not functional. You must install Zelenium.
"""
id = 'portal_tests'
meta_type = 'ERP5 Test Tool'
portal_type = 'Test Tool'
allowed_types = ('Zuite', )
# Declarative Security
security = ClassSecurityInfo()
security.declareProtected( Permissions.ManagePortal, 'manage_overview' )
manage_overview = DTMLFile( 'explainTestTool', _dtmldir )
InitializeClass(TestTool)
......@@ -8,4 +8,8 @@ The purpose of this tool is to help running test suites automatically.
Typically, Zelenium is used, and Zuite objects are put inside this tool.
</p>
<p>
You need to install Zelenium and restart Zope to use this tool.
</p>
<dtml-var manage_page_footer>
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