testlink根據(jù)需求定制

定制需求為:

創(chuàng)新互聯(lián)建站主要從事成都網(wǎng)站設計、成都做網(wǎng)站、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務石林,十多年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:13518219792

1.在測試用例中添加自定義字段

2.測試用例模板自定義css樣式

3.在測試執(zhí)行中增加測試結果字段

解決方式

1.測試用例自定義字段添加。

在project頁面中選定custom fields選項卡;增加自定義字段;指派自定義字段。

testlink根據(jù)需求定制

testlink根據(jù)需求定制

testlink根據(jù)需求定制

結果圖如下所示:

testlink根據(jù)需求定制

2.測試執(zhí)行結果定制:

先看看效果圖

testlink根據(jù)需求定制

操作步驟如下:

首先,修改cfg/const.inc.php

$tlCfg->results['status_code'] = array (
    'failed'        => 'f',
    'blocked'       => 'b',
    'passed'        => 'p',
    'not_run'       => 'n',
    'not_available' => 'x',
    'unknown'       => 'u',
    'all'           => 'a',
    'auto_passed'   => 'y',
    'auto_failed'   => 'z'
);
$tlCfg->results['status_label'] = array(
    'not_run'          => 'test_status_not_run',
    'passed'           => 'test_status_passed',
    'failed'           => 'test_status_failed',
    'blocked'          => 'test_status_blocked',
//    'all'              => 'test_status_all_status',
//    'not_available' => 'test_status_not_available',
//    'unknown'       => 'test_status_unknown'
    'auto_passed'      => 'test_status_auto_passed',
    'auto_failed'      => 'test_status_auto_failed'
);
$tlCfg->results['status_label_for_exec_ui'] = array(
    'not_run'          => 'test_status_not_run',
    'passed'          => 'test_status_passed',
    'failed'          => 'test_status_failed',
    'blocked'         => 'test_status_blocked',
    'auto_passed'      => 'test_status_auto_passed',
    'auto_failed'      => 'test_status_auto_failed'
);
$tlCfg->results['charts']['status_colour'] = array(
     'not_run'          => '000000',
    'passed'           => '006400',
    'failed'           => 'B22222',
    'blocked'          => '00008B',
    'auto_passed'   => '006400',
    'auto_failed'   => 'B22222'
);

其次,在custom_config.inc.php中添加

$tlCfg->results['status_code'] = array (
         "failed"        => 'f',
         "blocked"       => 'b',
         "passed"        => 'p',
         "not_run"       => 'n',
         "not_available" => 'x',
         "unknown"       => 'u',
         "all"           => 'a',
         "auto_passed"   => 'y',
         "auto_failed"   => 'z'
 );
 $tlCfg->results['status_label'] = array(
         "passed"                => "test_status_passed",
         "failed"                => "test_status_failed",
         "blocked"               => "test_status_blocked",
         "not_run"               => "test_status_not_run",
      //   "all"                   => "test_status_all_status",
      //   "not_available"    => "test_status_not_available",
       //  "unknown"          => "test_status_unknown",
         "auto_passed"      => "test_status_auto_passed",
         "auto_failed"      => "test_status_auto_failed"
 );
 $tlCfg->results['status_label_for_exec_ui'] = array(
         "passed"  => "test_status_passed",
         "failed"  => "test_status_failed",
         "blocked" => "test_status_blocked",
         "not_run" => "test_status_not_run",
     //    "not_available" => "test_status_not_available",
         "auto_passed"      => "test_status_auto_passed",
         "auto_failed"      => "test_status_auto_failed"
 );
 $tlCfg->results['default_status'] = "not_run";

再次,修改\locale\en_GB\strings.txt

// Status (used wide)
$TLS_test_status_all = "All";
$TLS_test_status_any = "Any";
$TLS_test_status_not_run = "Not Run";
$TLS_test_status_blocked = "Blocked";
$TLS_test_status_failed = "Failed";
$TLS_test_status_passed = "Passed";
$TLS_test_status_not_available = "Not Available";
$TLS_test_status_unknown = "Unknown";
$TLS_test_status_auto_failed = "Auto_Failed";
$TLS_test_status_auto_passed = "Auto_Passed";

最后,編寫自己的testlink.css

1.1 拷貝default中所有目錄到myTheme

1.2修改config.inc.php中的theme路徑

/* [GUI LAYOUT] */
/** GUI themes (base for CSS and p_w_picpaths)- modify if you create own one */
$tlCfg->theme_dir = 'gui/themes/myTheme/';

1.3修改testlink.css

/* ***** Execution & Results ********************************************************* */
div.passed, div.failed, div.blocked, div.not_run, div.auto_passed, div.auto_failed {
    color:             white;
    margin:         8px;
    padding:         6px;
    text-align:     center;
}
div.passed {
    background:        #006400; /* darkgreen */
}
div.failed {
    background:        #B22222; /* firebrick (red) */
}
div.blocked {
    background:        #00008B; /* darkblue */
}
div.not_run {
    background:        black;
}
.auto_passed, div.auto_passed {
    color:             white;
    background:        #006400; /* darkgreen */
}
.auto_failed, div.auto_failed {
    color:             white;
    background:        #B22222; /* firebrick (red) */
}

3.如何修改自定義的測試用例模板的樣式

暫時沒有找到修改固有模板和自定義字段順序的方法,以及刪除固有板塊如summary,keywords的方法

目前只能通過修改testlink.css中的.custom_fieldxx去掉bold,將padding改為0px。這樣會變得稍微能看一點。

網(wǎng)站標題:testlink根據(jù)需求定制
網(wǎng)站網(wǎng)址:http://muchs.cn/article38/gjsosp.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設計服務器托管、做網(wǎng)站、用戶體驗定制網(wǎng)站、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設公司