Changes between Version 5 and Version 6 of TestManagerForTracPluginPythonApi


Ignore:
Timestamp:
Jun 12, 2015, 11:25:02 AM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, tagged with 'testing'

Legend:

Unmodified
Added
Removed
Modified
  • TestManagerForTracPluginPythonApi

    v5 v6  
    11''' [ [wiki:TestManagerForTracPlugin Home] | [wiki:TestManagerForTracPluginChangeHistory Latest changes] | [wiki:TestManagerForTracPluginGallery Image gallery] | [http://www.youtube.com/watch?v=BIi3QMT0rT4 Video tutorial on Youtube] | [wiki:TestManagerForTracPluginQuickSetup Quick setup guide] | [http://sourceforge.net/projects/testman4trac Download] | [http://sourceforge.net/projects/testman4trac/files Source] | [wiki:TestManagerForTracPluginBugsFeatures Bugs/Feature requests] ]'''
    22
    3 = Test Manager for Trac Plugin - The Python API =
     3= Test Manager for Trac Plugin - The Python API
    44
    55TODO: The main API is to be described. What follows is a subset of functions recently requested by Users.
    66
    7 == Test objects ==
     7== Test objects
    88
    99Test objects are represented by Python classes.
    1010
    11 [[BR]]
    1211'''!TestCatalog'''
    1312    A container for test cases and sub-catalogs.
    1413   
    15     Test catalogs are organized in a tree. Since wiki pages are instead
    16     on a flat plane, we use a naming convention to flatten the tree into
     14    Test catalogs are organized in a tree. Since wiki pages are instead on a flat plane, we use a naming convention to flatten the tree into
    1715    page names. These are examples of wiki page names for a tree:
    18         TC          --> root of the tree. This page is automatically
    19                         created at plugin installation time.
    20         TC_TT0      --> test catalog at the first level. Note that 0 is
    21                         the catalog ID, generated at creation time.
    22         TC_TT0_TT34 --> sample sub-catalog, with ID '34', of the catalog
    23                         with ID '0'
    24         TC_TT27     --> sample other test catalog at first level, with
    25                         ID '27'
     16
     17        TC          --> root of the tree. This page is automatically created at plugin installation time.
     18
     19        TC_TT0      --> test catalog at the first level. Note that 0 is the catalog ID, generated at creation time.
     20
     21        TC_TT0_TT34 --> sample sub-catalog, with ID '34', of the catalog with ID '0'.
     22
     23        TC_TT27     --> sample other test catalog at first level, with ID '27'.
    2624                       
    27         There is not limit to the depth of a test tree.
     25        There is no limit to the depth of a test tree.
    2826                       
    29         Test cases are contained in test catalogs, and are always
    30         leaves of the tree:
     27        Test cases are contained in test catalogs, and are always leaves of the tree:
    3128
    32         TC_TT0_TT34_TC65 --> sample test case, with ID '65', contained
    33                              in sub-catalog '34'.
    34                              Note that test case IDs are independent on
    35                              test catalog IDs.
     29        TC_TT0_TT34_TC65 --> sample test case, with ID '65', contained in sub-catalog '34'.
     30                             Note that test case IDs are independent on test catalog IDs.
    3631[[BR]]
    3732    '''Attributes:'''
     
    4944[[BR]]
    5045'''!TestCase'''
    51     A single test case definition, usually specifying the steps
    52     required to test a particular condition, and the expected result.
     46    A single test case definition, usually specifying the steps required to test a particular condition, and the expected result.
    5347[[BR]]
    5448    '''Attributes:'''
     
    6660[[BR]]
    6761'''!TestPlan'''
    68     A test plan represents a particular instance of test execution
    69     for a test catalog.
    70     You can create any number of test plans on any test catalog (or
    71     sub-catalog).
    72     A test plan is associated to a test catalog, and to every
    73     test case in it, with the initial state equivalent to
    74     "to be executed".
    75     The association with test cases is achieved through the
    76     !TestCaseInPlan objects.
     62    A test plan represents a particular instance of test execution for a test catalog.
     63    You can create any number of test plans on any test catalog (or sub-catalog).
     64    A test plan is associated to a test catalog, and to every test case in it, with the initial state equivalent to "to be executed".
     65    The association with test cases is achieved through the !TestCaseInPlan objects.
    7766   
    78     For optimization purposes, a !TestCaseInPlan is created in the
    79     database only as soon as its status is changed (i.e. from "to be
     67    For optimization purposes, a !TestCaseInPlan is created in the database only as soon as its status is changed (ie from "to be
    8068    executed" to something else).
    81     So you cannot always count on the fact that a !TestCaseInPlan
    82     actually exists for every test case in a catalog, when a particular
    83     test plan has been created for it.
     69    So you cannot always count on the fact that a !TestCaseInPlan actually exists for every test case in a catalog, when a particular test plan has been created for it.
    8470[[BR]]
    8571    '''Attributes:'''
     
    9985    It keeps the latest test execution status (aka verdict).
    10086   
    101     The status, as far as this class is concerned, can be just any
    102     string.
    103     The plugin logic, anyway, currently recognizes only three hardcoded
    104     statuses, but this can be evolved without need to modify also this
    105     class.
     87    The status, as far as this class is concerned, can be any string.
     88    The plugin logic currently recognizes three hardcoded statuses, but this can be evolved without a need to modify this class.
    10689   
    107     The history of test execution status changes is instead currently
    108     kept in another table, testcasehistory, which is not backed by any
    109     python class.
    110     This is a duplication, since the 'changes' table also keeps track
    111     of status changes, so the testcasehistory table may be removed in
    112     the future.
     90    The history of test execution status changes is instead currently kept in another table, testcasehistory, which is not backed by any
     91    Python class.
     92    This is a duplication, since the 'changes' table also keeps track of status changes, so the testcasehistory table may be removed in the future.
    11393[[BR]]
    11494    '''Attributes:'''
     
    121101    '''status''': The test case current status. The available default values for this field are "to_be_tested", "successful", "failed", but the USer can customize these in the trac.ini file. See [wiki:TestManagerForTracPlugin#CustomTestCaseOutcomesi.e.statesverdicts Custom Test Case Outcomes (i.e. states, verdicts)] for details.[[BR]]
    122102
    123 [[BR]]
    124 
    125 
    126 == Getting all the Tickets related to a Test Case ==
     103== Getting all the Tickets related to a Test Case
    127104
    128105'''Since: 1.4.1'''
     
    134111From a TestCaseInPlan object, you can list the tickets opened against the test case in the specific plan.
    135112
    136 {{{
     113{{{#!python
    137114from testmanager.model import TestCase, TestCaseInPlan
    138115
     
    148125This 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.
    149126
    150 == Registering listeners to Test objects lifecycle events ==
     127== Registering listeners to Test objects lifecycle events
    151128
    152129Being based on the [wiki:TestManagerForTracPluginGenericClass Generic Persistent Class plugin], every test object supports a listener interface for components interested in test lifecycle events.