Exemple #1
0
/**
 * 
 *
 */
function buildTestExecResults(&$dbHandler, $cfg, $labels, $exec_info, $colspan, $show_exec_notes = false)
{
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    $testerName = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    $executionNotes = $show_exec_notes ? $exec_info[0]['notes'] : '';
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['last_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerName . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    $bug_interface = config_get('bugInterfaceOn');
    //BUGFIX for error logs.
    if ($bug_interface) {
        $bugs = get_bugs_for_exec($dbHandler, $bug_interface, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
/**
 * 
 * @internal revisions
 * @since 1.9.12
 *
 *
 */
function buildTestExecResults(&$dbHandler, &$its, $exec_info, $opt, $buildCF = null)
{
    static $testerNameCache;
    $out = '';
    $my['opt'] = array('show_notes' => true);
    $my['opt'] = array_merge($my['opt'], (array) $opt);
    $cfg =& $opt['cfg'];
    $labels =& $opt['lbl'];
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    if (!isset($testerNameCache[$exec_info[0]['tester_id']])) {
        $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    }
    $executionNotes = $my['opt']['show_notes'] ? $exec_info[0]['notes'] : '';
    switch ($exec_info[0]['execution_type']) {
        case TESTCASE_EXECUTION_TYPE_AUTO:
            $etk = 'execution_type_auto';
            break;
        case TESTCASE_EXECUTION_TYPE_MANUAL:
        default:
            $etk = 'execution_type_manual';
            break;
    }
    $td_colspan = '';
    if (!is_null($opt['colspan'])) {
        $td_colspan .= ' colspan="' . $opt['colspan'] . '" ';
    }
    //
    //$out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] .'</td>' .
    //        '<td '  .$td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n";
    // Check if CF exits for this BUILD
    if (!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']]) && $buildCF[$exec_info[0]['build_id']] != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top"></td>' . '<td ' . $td_colspan . '>' . $buildCF[$exec_info[0]['build_id']] . "</td></tr>\n";
    }
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerNameCache[$exec_info[0]['tester_id']] . "</b></td></tr>\n";
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['report_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_mode'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $labels[$etk] . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_duration'] . ':</span></td>';
    $out .= '<td ' . $td_colspan . '><b>' . (isset($exec_info[0]['execution_duration']) ? $exec_info[0]['execution_duration'] : "&nbsp;") . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    if (!is_null($its)) {
        $bugs = get_bugs_for_exec($dbHandler, $its, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
Exemple #3
0
/**
 * 
 *
 */
function buildTestExecResults(&$dbHandler, &$its, $cfg, $labels, $exec_info, $colspan, $show_exec_notes = false, $buildCF = null)
{
    static $testerNameCache;
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    if (!isset($testerNameCache[$exec_info[0]['tester_id']])) {
        $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    }
    $executionNotes = $show_exec_notes ? $exec_info[0]['notes'] : '';
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['last_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_duration'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $exec_info[0]['execution_duration'] . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n";
    // Check if CF exits for this BUILD
    if (!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']])) {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top"></td>' . '<td ' . $td_colspan . '>' . $buildCF[$exec_info[0]['build_id']] . "</td></tr>\n";
    }
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerNameCache[$exec_info[0]['tester_id']] . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    if (!is_null($its)) {
        $bugs = get_bugs_for_exec($dbHandler, $its, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
Exemple #4
0
/**
 * 
 *
 */
function buildTestExecResults(&$dbHandler, $cfg, $labels, $exec_info, $colspan)
{
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    $testerName = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    $executionNotes = $exec_info[0]['notes'];
    if ($exec_info[0]['has_attach'] == 1) {
        $has_attach = "Yes";
    } else {
        $has_attach = "No";
    }
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['last_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b> Attachments:" . $has_attach . "</td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerName . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    $bug_interface = config_get('bugInterface');
    if ($bug_interface != 'NO') {
        // amitkhullar-BUGID 2207 - Code to Display linked bugs to a TC in Test Report
        $bugs = get_bugs_for_exec($dbHandler, $bug_interface, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
Exemple #5
0
/**
 * 
 * @internal revisions
 * @since 1.9.12
 *
 *
 */
function buildTestExecResults(&$dbHandler, &$its, $cfg, $labels, $exec_info, $colspan, $show_exec_notes = false, $buildCF = null)
{
    static $testerNameCache;
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    if (!isset($testerNameCache[$exec_info[0]['tester_id']])) {
        $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    }
    $executionNotes = $show_exec_notes ? $exec_info[0]['notes'] : '';
    switch ($exec_info[0]['execution_type']) {
        case TESTCASE_EXECUTION_TYPE_AUTO:
            $etk = 'execution_type_auto';
            break;
        case TESTCASE_EXECUTION_TYPE_MANUAL:
        default:
            $etk = 'execution_type_manual';
            break;
    }
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr style="' . "font-weight: bold;background: #EEE;text-align: left;" . '">' . '<td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['execution_details'] . '</td>' . '<td ' . $td_colspan . '>' . "&nbsp;" . "</b></td></tr>\n";
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n";
    // Check if CF exits for this BUILD
    if (!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']])) {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top"></td>' . '<td ' . $td_colspan . '>' . $buildCF[$exec_info[0]['build_id']] . "</td></tr>\n";
    }
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerNameCache[$exec_info[0]['tester_id']] . "</b></td></tr>\n";
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['report_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_mode'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $labels[$etk] . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_duration'] . ':</span></td>';
    $out .= '<td ' . $td_colspan . '><b>' . (isset($exec_info[0]['execution_duration']) ? $exec_info[0]['execution_duration'] : "&nbsp;") . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    if (!is_null($its)) {
        $bugs = get_bugs_for_exec($dbHandler, $its, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}