コード例 #1
0
print "<td align=center>" . NEWLINE;
switch ($s_tab) {
    # TEST STEPS
    case '1':
        if (IMPORT_EXPORT_TO_EXCEL) {
            print "[ <a href='test_step_import_csv_page.php'>" . lang_get('import_teststeps_excel') . "</a> ]" . NEWLINE;
            print "[ <a href='csv_export.php?table=test_steps'>" . lang_get('export_teststeps_excel') . "</a> ]" . NEWLINE;
        } else {
            print "[ <a href='test_step_import_csv_page.php'>" . lang_get('import_teststeps_csv') . "</a> ]" . NEWLINE;
            print "[ <a href='csv_export.php?table=test_steps'>" . lang_get('export_teststeps_csv') . "</a> ]" . NEWLINE;
        }
        print "<form method=post name='test_steps' action='{$redirect_url}' id='form_order'>" . NEWLINE;
        print "<table class=hide100>" . NEWLINE;
        print "<tr>" . NEWLINE;
        print "<td>" . NEWLINE;
        $rows_test_steps = test_get_test_steps($test_id, $s_page_number, $csv_name = null, $order_by, $order_dir);
        print "</td>" . NEWLINE;
        print "</tr>" . NEWLINE;
        print "</table>" . NEWLINE;
        print "</form>" . NEWLINE;
        # Find out if there are existing test steps
        #$row = test_get_test_steps( $test_id );
        $num_test_steps = sizeof($rows_test_steps);
        if ($num_test_steps != '0') {
            # Display test steps if they exist
            print "<table class='width100' rules='cols'>" . NEWLINE;
            print "<tr class='tbl_header'>" . NEWLINE;
            #html_tbl_print_header( lang_get('step_no') );
            #html_tbl_print_header( lang_get('step_action') );
            #html_tbl_print_header( lang_get('test_inputs') );
            #html_tbl_print_header( lang_get('step_expected') );
}
# ------------------------------------------------
# TEST SUITE RESULTS
# ------------------------------------------------
results_create_testsuite_result($test_run_id, $testset_id, $test_id, $test_name, $test_status, $username, $time_started, $time_finished, $comments, $root_cause, $environment, $os);
# PREPARE TO WRITE TO VERIFY_RESULTS TABLE
$vr_tbl = VERIFY_RESULTS_TBL;
$f_run_id = VERIFY_RESULTS_TS_UNIQUE_RUN_ID;
$f_timestamp = VERIFY_RESULTS_LOG_TIME_STAMP;
$f_stepno = VERIFY_RESULTS_VAL_ID;
$f_action = VERIFY_RESULTS_ACTION;
$f_expected = VERIFY_RESULTS_EXPECTED_RESULT;
$f_actual = VERIFY_RESULTS_ACTUAL_RESULT;
$f_status = VERIFY_RESULTS_TEST_STATUS;
# WRITE EACH RECORD TO VERIFY_RESULTS
foreach (test_get_test_steps($test_id) as $row_test_step) {
    $row_test_step_id = $row_test_step[TEST_STEP_ID];
    $stepno = $row_test_step[TEST_STEP_NO];
    $step_action = $row_test_step[TEST_STEP_ACTION];
    $step_expected = $row_test_step[TEST_STEP_EXPECTED];
    $actual_result = session_validate_form_get_field("actual_result_{$row_test_step_id}");
    $step_status = session_validate_form_get_field("step_status_{$row_test_step_id}");
    $q = "INSERT INTO {$vr_tbl}\n\t\t  ({$f_run_id}, {$f_timestamp}, {$f_stepno}, {$f_action}, {$f_expected}, {$f_actual}, {$f_status} )\n\t\t  VALUES (\t'{$test_run_id}',\n\t\t\t\t\t'{$time_finished}',\n\t\t\t\t\t'{$stepno}',\n\t\t\t\t\t'{$step_action}',\n\t\t\t\t\t'{$step_expected}',\n\t\t\t\t\t'{$actual_result}',\n\t\t\t\t\t'{$step_status}'  )";
    #print"$q <BR>";
    db_query($db, $q);
}
# ------------------------------------------------
# UPDATE TEST RUN STATUS
# ------------------------------------------------
if ($test_status == "Passed") {
    $finished = '1';