Adding execution duration to ResultByStatus Report
Posted: Sat Mar 22, 2014 4:25 am
Hi
since TestLink 1.9.9 it is possible to record the execuction duation with the test result so I tried to change the ResultByStatus.php classe as I can get it shown on failed test cases report but I was'nt able to get it value.
here is the code I added :
in the function buildMatrix of ResultByStatus.php classe I added the line $columns[] = array('title_key' => 'th_execution_duration', 'width' => 35);
after the lines:
$columns[] = array('title_key' => 'th_build', 'width' => 35);
$columns[] = array('title_key' => 'th_run_by', 'width' => 60);
$columns[] = array('title_key' => 'th_date', 'width' => 60);
in the template ResultByStatus.tpl I added "th_execution_duration":
{lang_get var='labels'
s='th_test_suite,test_case,version,th_build,th_run_by,th_bugs_not_linked,
th_date,th_execution_duration,title_execution_notes,th_bugs,summary,generated_by_TestLink_on,
th_assigned_to,th_platform,platform,info_failed_tc_report,
info_blocked_tc_report,info_notrun_tc_report,export_as_spreadsheet'}
in the variable $sql of the classe tlTestPlanMetrics.class.php I added "E.execution_duration AS duration"
$sql = "/* {$debugMsg} executions with status WRITTEN on DB => not run is not present */" .
" SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," .
" TPTCV.tcversion_id,TPTCV.platform_id," .
" E.tcversion_number, E.build_id,E.id AS executions_id, E.status AS status, " .
" E.execution_duration AS duration,E.notes AS execution_notes, E.tester_id,E.execution_ts," .
" TCV.version,TCV.tc_external_id AS external_id, " .
" $fullEID AS full_external_id," .
" (TPTCV.urgency * TCV.importance) AS urg_imp " .
" FROM {$this->tables['testplan_tcversions']} TPTCV " .
in custom_string,txt I added $TLS_th_execution_duration = "Duration";
So I am able to get the title duration but its column contains the execution_note value (all the clumns after duration are shifted to the left).
I know that I'm missing some thing but I can't figure out where. So any help will be really appreciate!
Thanks.
since TestLink 1.9.9 it is possible to record the execuction duation with the test result so I tried to change the ResultByStatus.php classe as I can get it shown on failed test cases report but I was'nt able to get it value.
here is the code I added :
in the function buildMatrix of ResultByStatus.php classe I added the line $columns[] = array('title_key' => 'th_execution_duration', 'width' => 35);
after the lines:
$columns[] = array('title_key' => 'th_build', 'width' => 35);
$columns[] = array('title_key' => 'th_run_by', 'width' => 60);
$columns[] = array('title_key' => 'th_date', 'width' => 60);
in the template ResultByStatus.tpl I added "th_execution_duration":
{lang_get var='labels'
s='th_test_suite,test_case,version,th_build,th_run_by,th_bugs_not_linked,
th_date,th_execution_duration,title_execution_notes,th_bugs,summary,generated_by_TestLink_on,
th_assigned_to,th_platform,platform,info_failed_tc_report,
info_blocked_tc_report,info_notrun_tc_report,export_as_spreadsheet'}
in the variable $sql of the classe tlTestPlanMetrics.class.php I added "E.execution_duration AS duration"
$sql = "/* {$debugMsg} executions with status WRITTEN on DB => not run is not present */" .
" SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," .
" TPTCV.tcversion_id,TPTCV.platform_id," .
" E.tcversion_number, E.build_id,E.id AS executions_id, E.status AS status, " .
" E.execution_duration AS duration,E.notes AS execution_notes, E.tester_id,E.execution_ts," .
" TCV.version,TCV.tc_external_id AS external_id, " .
" $fullEID AS full_external_id," .
" (TPTCV.urgency * TCV.importance) AS urg_imp " .
" FROM {$this->tables['testplan_tcversions']} TPTCV " .
in custom_string,txt I added $TLS_th_execution_duration = "Duration";
So I am able to get the title duration but its column contains the execution_note value (all the clumns after duration are shifted to the left).
I know that I'm missing some thing but I can't figure out where. So any help will be really appreciate!
Thanks.