testlink根据需求定制
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,定制需求为:1.在测试用例中添加自定义字段2.测试用例模板自定义css样式3.在测试执行中增加测试结果字段解决方式1.测试用例自定义字段添加。在project页面中选定custom fields选项卡
千家信息网最后更新 2026年11月01日testlink根据需求定制
定制需求为:
1.在测试用例中添加自定义字段
2.测试用例模板自定义css样式
3.在测试执行中增加测试结果字段
解决方式
1.测试用例自定义字段添加。
在project页面中选定custom fields选项卡;增加自定义字段;指派自定义字段。

结果图如下所示:
2.测试执行结果定制:
先看看效果图
操作步骤如下:
首先,修改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。这样会变得稍微能看一点。
测试
字段
模板
结果
方法
样式
需求
再次
拷贝
效果
效果图
方式
板块
步骤
目录
路径
页面
顺序
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网与科技
湖北九亚互联网络科技有限公司
广州淘业互联网络科技
新华互联网科技学校
互联网科技官网
盈实互联网科技
互联网为科技
互联网络科技有限公司
科技互联网公司logo
郑州华宇互联网科技
互联网金融和金融科技
顺网科技2021年互联网排名
互联网时代科技改变生活
重庆互联网医院沙龙医盟信息科技
厦门千工互联网科技有限公司
互联网媒体平台算高科技产业
迪庆互联网科技招生
高科技互联网发展前景如何
工业互联网等科技实现智能化赋能
科技互联网公司两年变化
金诺互联网科技
互联网女皇 腾讯科技
互联网时代科技改变生活
互联网科技研发水平
广西互联网科技孵化中心
互联网数据科技专业
锡山区互联网智能科技产品供应
互联网科技年终奖
新氧科技和美国互联网有关系吗
杭州科技互联网公司有哪些