Changes between Initial Version and Version 1 of TestManagerForTracPluginPythonApi


Ignore:
Timestamp:
Jan 20, 2011, 4:48:47 PM (13 years ago)
Author:
Roberto Longobardi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestManagerForTracPluginPythonApi

    v1 v1  
     1= The Python API =
     2
     3TODO: The main API is to be described. What follows is a subset of functions recently requested by Users.
     4
     5== Getting all the Tickets related to a Test Case ==
     6
     7'''Since: 1.4.1'''
     8
     9You now have the ability to programmatically get all of the tickets that have been (explicitly) opened against a test case.
     10
     11From a TestCase object, you can list the tickets opened against it in any test plan.
     12
     13From a TestCaseInPlan object, you can list the tickets opened against the test case in the specific plan.
     14
     15{{{
     16from testmanager.model import TestCase, TestCaseInPlan
     17
     18tc = TestCase(self.env, id, path)
     19for t in tc.get_related_tickets():
     20    # t is the ticket ID
     21
     22tc = TestCaseInPlan(self.env, id, planid, path)
     23for t in tc.get_related_tickets():
     24    # t is the ticket ID
     25}}}
     26
     27This is achieved by adding two custom fields to the ticket object, named 'testcaseid' for the test case ID, and 'planid' for the test plan ID.
     28
     29== Registering listeners to Test objects lifecycle events ==
     30
     31Being based on the [wiki:TestManagerForTracPluginGenericClass Generic Persistent Class plugin], every test object supports a listener interface for components interested in test lifecycle events.
     32
     33Note: The same stands for any workflow you may have attached to our test objects, by means of the [wiki:TestManagerForTracPluginWorkflow Generic Workflow Engine]. Anyway, in this case a [wiki:TestManagerForTracPluginWorkflow#IWorkflowTransitionListener specific listener interface] has been provided.
     34
     35To register a listener inside the Generic Persistent Class framework, follow [wiki:TestManagerForTracPluginGenericClass#IGenericObjectChangeListener-Registeringlistenerstoobjectslifecycleevents this guide].