183 | | See the README.txt file for how to recreate this example. |
184 | | The following screenshot shows a custom "platform" field added to the Test Case object, and how it is presented to the User for editing. |
| 183 | |
| 184 | The syntax is the same used for custom Ticket properties, only the name of the ini file sections are specific: you must use the test artifact type name followed by "-tm_custom". |
| 185 | |
| 186 | The test artifacts type names are the following: |
| 187 | * testcatalog |
| 188 | * testcase |
| 189 | * testplan |
| 190 | * testcaseinplan |
| 191 | |
| 192 | For example, the following sections in the trac.ini file define one custom property for each of the above artifacts. |
| 193 | |
| 194 | {{{ |
| 195 | [testcatalog-tm_custom] |
| 196 | prop1 = text |
| 197 | prop1.value = Default value |
| 198 | |
| 199 | [testcaseinplan-tm_custom] |
| 200 | prop_strange = text |
| 201 | prop_strange.value = windows |
| 202 | |
| 203 | [testcase-tm_custom] |
| 204 | nice_prop = text |
| 205 | nice_prop.value = My friend |
| 206 | |
| 207 | [testplan-tm_custom] |
| 208 | good_prop = text |
| 209 | good_prop.value = linux |
| 210 | }}} |
| 211 | |
| 212 | '''Note: Only text property types are currently supported.''' |
| 213 | |
| 214 | Once defined in the trac.ini file as above, custom fields will be available to the User for browse and for editing in the Web page, as shown next. |
| 215 | |
| 216 | '''Note: Editing custom properties requires the TEST_MODIFY permission.''' |
| 217 | |
| 218 | The following screenshot shows a custom "platform" field added to the Test Case artifact, and how it is presented to the User for editing. |
| 219 | |
| 220 | The value is initially displayed read-only, as a label. Clicking on the pencil icon turns the label into an edit box, allowing the User to edit the value and also displays a "Save" button. Clicking the button immediately saves the new value into the database. |