Changes between Initial Version and Version 1 of TestManagerForTracPluginApi


Ignore:
Timestamp:
Aug 18, 2010, 2:28:04 PM (14 years ago)
Author:
Roberto Longobardi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestManagerForTracPluginApi

    v1 v1  
     1= Test Manager for Trac Plugin - Public API =
     2
     3The TestManagerForTracPlugin plugin can be used programmatically to create, edit Test Catalogs, Test Cases and Test Plans, and to set the test execution verdicts of Test Cases in a plan.
     4
     5In the following, because of the spam filter not allowing more than a few URLs in a page, I have replaced:
     6{{{
     7http://yourserver/yourproject
     8}}}
     9
     10with:
     11{{{
     12<yourserver/yourproject>
     13}}}
     14
     15[[BR]][[BR]]
     16== Working with Test Catalogs and Test Cases ==
     17
     18You can create test catalogs and cases programmatically by means of the following http requests.
     19
     20[[BR]]
     21=== Create a root test catalog ===
     22Get the following URL:
     23
     24{{{
     25<yourserver/yourproject>/testcreate?type=catalog&path=TC&title=My%20new%20catalog
     26}}}
     27
     28this will assign a unique ID (the number 0 in the URL below) to the new catalog and redirect to a Wiki edit page:
     29
     30{{{
     31<yourserver/yourproject>/wiki/TC_TT0?action=edit&text=%3D%3D+My+new+catalog+%3D%3D
     32}}}
     33
     34that you can simply post the form to submit the page and thus create the catalog.
     35
     36Having to POST Wiki pages to submit them is annoying anyway, so I was planning to add an additional parameter to the /testcreate API to directly save the Wiki pages, with no need to edit them eventually.
     37Maybe an additional "force" parameter would allow for resolving conflicts.
     38
     39[[BR]]
     40=== Create a sub-catalog ===
     41Get the wollowing URL, where "path" is the name of the parent catalog.
     42
     43{{{
     44<yourserver/yourproject>/testcreate?type=catalog&path=TC_TT0&title=My%20sub%20catalog
     45}}}
     46
     47this will assign a unique ID (the number 1 in the URL below) to the new catalog and redirect to a Wiki edit page:
     48
     49{{{
     50<yourserver/yourproject>/wiki/TC_TT0_TT1?action=edit&text=%3D%3D+My+sub+catalog+%3D%3D
     51}}}
     52
     53that you can simply post the form to submit the page and thus create the sub-catalog.
     54
     55[[BR]]
     56=== Create a Test Case ===
     57Get the wollowing URL, where "path" is the name of the parent (sub-)catalog.
     58
     59{{{
     60<yourserver/yourproject>/testcreate?type=testcase&path=TC_TT0_TT1&title=My%20new%20Test%20Case
     61}}}
     62
     63this will assign a unique ID (the number 0 in the URL below) to the new test case and redirect to a Wiki edit page:
     64{{{
     65<yourserver/yourproject>/wiki/TC_TT0_TT1_TC0?action=edit&text=%3D%3D+My+new+Test+Case+%3D%3D
     66}}}
     67
     68that you can simply post the form to submit the page and thus create the test case.
     69
     70[[BR]][[BR]]
     71== Working with Test Plans and setting the status of a Test Case ==
     72
     73You can also create a new Test Plan (e.g. for each nightly build) programmatically as follows.
     74
     75[[BR]]
     76=== Create a Test Plan from a specific catalog ===
     77
     78Get the wollowing URL, where "path" is the name of the (sub-)catalog to create the test plan against.
     79{{{
     80<yourserver/yourproject>/testcreate?type=testplan&path=TC_TT0&title=Test%20Plan%20for%2020100818
     81}}}
     82
     83this will assign a unique ID (the number 1 in the URL below) to the new test plan and redirect to displaying the Test Plan:
     84{{{
     85<yourserver/yourproject>/wiki/TC_TT0?planid=1
     86}}}
     87
     88The Test Plan will contain all of the test cases in the specified catalog, with a verdict of "Untested".
     89
     90[[BR]][[BR]]
     91=== Set a Test Case execution verdict, in the context of a Test Plan ===
     92
     93Then, you can set the verdict for any test case in the plan, by means of the following.
     94
     95Get the following URL, where "id" is the Test Case ID and planid is the Test Plan ID:
     96{{{
     97<yourserver/yourproject>/teststatusupdate?id=5&planid=1&status=SUCCESSFUL
     98}}}
     99
     100The supported statuses are currently:
     101 - TO_BE_TESTED
     102 - SUCCESSFUL
     103 - FAILED
     104
     105
     106[[BR]][[BR]]
     107== Traceability between Test Cases and Tickets ==
     108
     109You can open a Ticket and have a traceback to the (e.g. failed) Test Case as follows.
     110
     111[[BR]]
     112=== Open a Ticket on a Test Case ===
     113
     114Whether you deploy TracTicketTemplatePlugin or not, you can get the following URL, where testCaseNumber is the Test Case complete path, planid is the Test Plan ID and planName is its name:
     115
     116{{{
     117<yourserver/yourproject>/newticket?testCaseNumber=TC_TT0_TC0&planId=1&planName=Test%20Plan%20for%2020100818&description=Test%20Case:%20[wiki:TC_TT0_TC0],%20Test%20Plan:%20Test%20Plan%20for%2020100818%20(1)
     118}}}
     119
     120this will redirect to a Ticket edit page, with the Test Case in Test Plan hyperlink in the description (as Wiki page references).
     121You can simply post the form to create the Ticket.