[Erp5-report] r8263 - in /erp5/trunk/products/ERP5: Tool/TestTool.py dtml/explainTestTool.dtml

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jun 30 17:08:36 CEST 2006


Author: yo
Date: Fri Jun 30 17:08:31 2006
New Revision: 8263

URL: http://svn.erp5.org?rev=8263&view=rev
Log:
TestTool utilizes Zelenium, if installed.

Modified:
    erp5/trunk/products/ERP5/Tool/TestTool.py
    erp5/trunk/products/ERP5/dtml/explainTestTool.dtml

Modified: erp5/trunk/products/ERP5/Tool/TestTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TestTool.py?rev=8263&r1=8262&r2=8263&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TestTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/TestTool.py Fri Jun 30 17:08:31 2006
@@ -40,19 +40,52 @@
 
 from zLOG import LOG
 
-class TestTool (BaseTool):
-  """
-    Container for fonctionnal tests.
-  """
-  id = 'portal_tests'
-  meta_type = 'ERP5 Test Tool'
-  portal_type = 'Test Tool'
-  allowed_types = ('Zuite', )
+try:
+  from Products.Zelenium.zuite import Zuite
 
-  # Declarative Security
-  security = ClassSecurityInfo()
+  class TestTool (Zuite, BaseTool):
+    """
+      Container for fonctionnal tests.
+    """
+    id = 'portal_tests'
+    meta_type = 'ERP5 Test Tool'
+    portal_type = 'Test Tool'
+    allowed_types = ('Zuite', )
 
-  security.declareProtected( Permissions.ManagePortal, 'manage_overview' )
-  manage_overview = DTMLFile( 'explainTestTool', _dtmldir )
+    # Declarative Security
+    security = ClassSecurityInfo()
+
+    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)

Modified: erp5/trunk/products/ERP5/dtml/explainTestTool.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/dtml/explainTestTool.dtml?rev=8263&r1=8262&r2=8263&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/dtml/explainTestTool.dtml (original)
+++ erp5/trunk/products/ERP5/dtml/explainTestTool.dtml Fri Jun 30 17:08:31 2006
@@ -8,4 +8,8 @@
 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>




More information about the Erp5-report mailing list