Changes between Version 2 and Version 3 of TestManagerForTracPluginRestfulApi


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

Cosmetic changes, tagged with 'testing'

Legend:

Unmodified
Added
Removed
Modified
  • TestManagerForTracPluginRestfulApi

    v2 v3  
    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 HTTP RESTful API =
     3= Test Manager for Trac Plugin - The HTTP RESTful API
    44
    5 [[BR]]
    65The [wiki:TestManagerForTracPlugin TestManager plugin] can be used programmatically to create and manage Test Catalogs, Test Cases and Test Plans, and to set the test execution verdicts of Test Cases in a plan.
    76
    87This page describes the '''HTTP RESTful API''', but there are alternatives:
    98
    10  * An '''XML-RPC''' API, allowing you to remotely control your test artifacts using a standard protocol
     9 * An '''XML-RPC''' API, allowing you to remotely control your test artifacts using a standard protocol.
    1110 * A '''Python''' API, allowing for a fine-grained control over any artifact, managing their life-cycle, listening to events, reacting to status changes and workflow transitions.
    12  
    13 [[BR]]
    14 In the following, because of the spam filter not allowing more than a few URLs in a page, I have replaced:
    1511
    16 {{{
    17 http://yourserver/yourproject
    18 }}}
    19 
    20 with:
    21 
    22 {{{
    23 <yourserver/yourproject>
    24 }}}
    25 
    26 == Working with Test Catalogs and Test Cases ==
     12== Working with Test Catalogs and Test Cases
    2713
    2814You can create test catalogs and cases programmatically by means of the following http requests.
    2915
    30 
    31 === Create a root test catalog ===
     16=== Create a root test catalog
    3217
    3318Get the following URL:
     
    3520<yourserver/yourproject>/testcreate?type=catalog&path=TC&title=My%20new%20catalog
    3621}}}
    37 this will assign a unique ID (the number 0 in the URL below) to the new catalog, create the corresponding Wiki page and redirect to it. You may discard the response if you don't need to know the catalog ID (last number in the URL):
     22
     23This will assign a unique ID (the number 0 in the URL below) to the new catalog, create the corresponding Wiki page and redirect to it. You may discard the response if you don't need to know the catalog ID (last number in the URL):
    3824
    3925{{{
     
    4127}}}
    4228
    43 === Create a sub-catalog ===
     29=== Create a sub-catalog
    4430
    45 Get the wollowing URL, where "path" is the name of the parent catalog.
     31Get the following URL, where "path" is the name of the parent catalog.
    4632
     33{{{
    4734<yourserver/yourproject>/testcreate?type=catalog&path=TC_TT0&title=My%20sub%20catalog
    48 this will assign a unique ID (the number 1 in the URL below) to the new catalog, create the corresponding Wiki page and redirect to it. You may discard the response if you don't need to know the catalog ID (last number in the URL):
     35}}}
     36
     37This will assign a unique ID (the number 1 in the URL below) to the new catalog, create the corresponding Wiki page and redirect to it. You may discard the response if you don't need to know the catalog ID (last number in the URL):
    4938
    5039{{{
     
    5241}}}
    5342
    54 === Create a Test Case ===
     43=== Create a Test Case
    5544
    56 Get the following URL, where "path" is the name of the parent (sub-)catalog.
     45Get the following URL, where "path" is the name of the parent (sub-)catalog:
    5746
    5847{{{
     
    6049}}}
    6150
    62 this will assign a unique ID (the number 0 in the URL below) to the new test case, create the corresponding Wiki page and redirect to it. You may discard the response if you don't need to know the test case ID (last number in the URL):
     51This will assign a unique ID (the number 0 in the URL below) to the new test case, create the corresponding Wiki page and redirect to it. You may discard the response if you don't need to know the test case ID (last number in the URL):
    6352
    6453{{{
     
    6655}}}
    6756
    68 
    69 == Working with Test Plans and setting the status of a Test Case ==
     57== Working with Test Plans and setting the status of a Test Case
    7058
    7159You can also create a new Test Plan (e.g. for each nightly build) programmatically as follows.
    7260
    73 
    74 === Create a Test Plan from a specific catalog ===
     61=== Create a Test Plan from a specific catalog
    7562
    7663Get the following URL, where "path" is the name of the (sub-)catalog to create the test plan against.
     
    8067}}}
    8168
    82 this will assign a unique ID (the number 1 in the URL below) to the new test plan and redirect to displaying the Test Plan: You may discard the response if you don't need to know the plan ID (planid parameter in the URL):
     69This will assign a unique ID (the number 1 in the URL below) to the new test plan and redirect to displaying the Test Plan: You may discard the response if you don't need to know the plan ID (planid parameter in the URL):
    8370
    8471{{{
     
    8875The Test Plan will contain all of the test cases in the specified catalog, with a status of "Untested".
    8976
    90 Note: As you can notice, you can always pass from a test catalog to one of its test plans by adding the "planid=<plan id>" parameter to the test catalog URL. The same also stands for test cases. You can pass to a test case in a particular plan by adding the planid parameter to its URL.
     77'''Note''': You can always pass from a test catalog to one of its test plans by adding the "planid=<plan id>" parameter to the test catalog URL. The same also stands for test cases. You can pass to a test case in a particular plan by adding the planid parameter to its URL.
    9178
     79=== Set a Test Case execution verdict, in the context of a Test Plan
    9280
    93 
    94 === Set a Test Case execution verdict, in the context of a Test Plan ===
    95 
    96 Then, you can set the verdict for any test case in the plan, by means of the following.
    97 
    98 Get the following URL, where "id" is the Test Case ID and planid is the Test Plan ID:
     81Then, you can set the verdict for any test case in the plan, by means of the following. Get the following URL, where "id" is the Test Case ID and planid is the Test Plan ID:
    9982
    10083{{{
     
    10891 * FAILED
    10992
    110 
    111 == Change a [custom] property of any test object ==
     93== Change a [custom] property of any test object
    11294
    11395Any property, either standard or custom, of any test object can be set programmatically through the RESTful API.
    11496
    115 A test object is identified by its realm (i.e. type) and its key (i.e. in most cases the ID, for test cases in the context of a plan, also the plan ID is required).
     97A test object is identified by its realm (ie type) and its key, ie in most cases the ID, for test cases in the context of a plan, also the plan ID is required.
    11698
    11799The realms that identify the test objects are the following:
     
    133115The key properties are provided to the property update service through the "key" parameter, in the form of a dictionary.
    134116
    135 The next things to pass to the service are the name of the property to modify and the new value. Guess what... you use the "name" and "value" parameters, respectively.
    136 
    137 For example, to change a Test Case - with ID 5 - custom property "platform" (which has been previously added to the test case type in the trac.ini file) to the new value "Windows", this is the URL to GET:
     117The next things to pass to the service are the name of the property to modify and the new value. Use the "name" and "value" parameters, respectively. For example, to change a Test Case - with ID 5 - custom property "platform" (which has previously been added to the test case type in the `trac.ini` file) to the new value "Windows", this is the URL to GET:
    138118
    139119{{{
     
    141121}}}
    142122
    143 == Traceability between Test Cases and Tickets ==
     123== Traceability between Test Cases and Tickets
    144124
    145 You can open a Ticket and have a traceback to the (e.g. failed) Test Case as follows.
     125You can open a Ticket and have a traceback to the (eg failed) Test Case as follows.
    146126
    147 
    148 === Open a Ticket on a Test Case ===
     127=== Open a Ticket on a Test Case
    149128
    150129Whether 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:
     
    154133}}}
    155134
    156 this will redirect to a Ticket edit page, with the Test Case in Test Plan hyperlink in the description (as Wiki page references). You can simply post the form to create the Ticket.
    157 
     135This will redirect to a Ticket edit page, with the Test Case in Test Plan hyperlink in the description as Wiki page references. You can simply post the form to create the Ticket.