by aostad » Thu Apr 23, 2009 4:29 pm
I'm not sure what kind of error you get, but here is what I've done for adding a new test-status called "Conditional Pass" to execution, report, metrics, and charts. You can get the idea and use for adding your desired test-status.
NOTE: when you make any change in the code you have to maintain the code and merge it after updating to a new release of testlink. I will explain it at the end.
So, here is the procedure:
Assumption:
-testlink is installed in "testlink" directory.
-The new test status is called "Conditional Pass".
-Current version of testlink is 1.8.1
1. First make a backup of files that you are going to change. Be careful! Do not change the type of file when you make a backup of them. In Windows, I do copy/paste the file in the same directory. So Windows will rename it to "filename - Copy" by default.
Locate following files and make a backup of them:
custom_config.inc.php,
strings, //The file that is for your language
const.inc.php,
reports.cfg.php,
resultsByStatus.php,
testlink.php,
2. Apply following changes in "custom_config.inc" file:
find " $tlCfg->results['status_code'] = array " and insert the new status like this:
$tlCfg->results['status_code'] = array (
"failed" => 'f',
"conditional_pass" => 'q',
"blocked" => 'b',
"passed" => 'p',
"not_run" => 'n',
// "not_available" => 'x',
// "unknown" => 'u',
// "all" => 'a'
);
Locate " $tlCfg->results['status_label'] = array " and insert the new status to the code:
$tlCfg->results['status_label'] = array(
"passed" => "test_status_passed",
"conditional_pass" => "test_status_conditional_pass",
"failed" => "test_status_failed",
"blocked" => "test_status_blocked",
"not_run" => "test_status_not_run",
//"not_available" => "test_status_not_available",
//"all" => "test_status_all_status",
//"unknown" => "test_status_unknown"
);
Locate " $tlCfg->results['status_label_for_exec_ui'] = array " and apply following change again:
$tlCfg->results['status_label_for_exec_ui'] = array(
"passed" => "test_status_passed",
"conditional_pass" => "test_status_conditional_pass",
"failed" => "test_status_failed",
"blocked" => "test_status_blocked",
"not_run" => "test_status_not_run",
// "not_available" => "test_status_not_available"
);
3. Add following lines to "Strings" file. If you're using English version you need to modify \testlink\locale\en_GB\Strings file:
$TLS_test_status_conditional_pass = "Cond. Pass";
$TLS_trep_conditional_pass = $TLS_test_status_conditional_pass;
$TLS_last_status_conditional_pass = $TLS_test_status_conditional_pass;
$TLS_th_total_conditional_pass = "#" . $TLS_test_status_conditional_pass;
$TLS_req_title_conditional_pass = "Conditionall_Pass Requirements";
$TLS_number_conditional_pass = "# " . $TLS_test_status_conditional_pass;
$TLS_link_report_conditional_pass_tcs = "Conditional Pass Test Cases";
4. Open \testlink\cfg\const.inc.php file and look for this line:
$tlCfg->results['status_code'] = array (
then add following line in the body of function:
"conditional_pass" => 'q',
locate this line:
$tlCfg->results['status_label'] = array(
then add following line to the body of function:
"conditional_pass" => "test_status_conditional_pass",
locate this line:
$tlCfg->results['status_label_for_exec_ui'] = array(
then add following line to the function:
"conditional_pass" => "test_status_conditional_pass"
Locate this line:
$tlCfg->results['charts']['status_colour']=array(
then add following line to the function:
"conditional_pass" => "808000",
5. Open \testlink\cfg\reports.cfg.php file and add following to it:
$tlCfg->reports_list['list_tc_conditional_pass'] = array(
'title' => 'link_report_conditional_pass_tcs',
'url' => 'lib/results/resultsByStatus.php?type=' . $tlCfg->results['status_code']['conditional_pass'],
'enabled' => 'all',
'format' => 'format_html,format_ods,format_xls,format_mail_html'
);
6. Open \testlink\lib\result\resultsByStatus.php file in an editor and look for following line:
foreach( array('failed','blocked','not_run') as $verbose_status )
Then change it to this:
foreach( array('conditional_pass','failed','blocked','not_run') as $verbose_status )
7. Open \testlink\gui\themes\default\css\testlink.php file in an editor and apply following changes:
In " Execution & Results " section add following:
div.conditional_pass {
background: #808000; /* hanah */
}
In " execution tree coloring " section look for:
span.light_passed, span.light_failed, span.light_blocked,
span.light_not_run, span.light_not_available, span.light_unknown
{
and change it to:
span.light_passed, span.light_failed, span.light_blocked, span.light_not_run, span.light_not_available, span.light_unknown, span.light_conditional_pass{
After above change add following block below it:
span.light_conditional_pass {
background: #FFEECC;
}
In " render test result status " section add following lines:
.conditional_pass {
color: white;
background: #808000; /* hanah */
}
By now, if you have not missed any characters (, ; .) during cut/paste, you should have your new added test-status in execution, reports, metrics, and charts.
How to maintain the changes in the future releases?
You need a tool that can compare two file and merge them. You can download and install "winmerge", which is free.
Using the tool compare the files that you have changed with the same files in the new release of test link and apply/merge changes one by one. Do not forget to make a backup of all original file before proceeding.
Cheers,
Ali
Last edited by
TurboPT on Sat Jan 19, 2013 3:43 pm, edited 1 time in total.
Reason: Corrected bold and italic styling tags.