testlink根据需求定制
发表于:2025-12-01 作者:千家信息网编辑
千家信息网最后更新 2025年12月01日,定制需求为:1.在测试用例中添加自定义字段2.测试用例模板自定义css样式3.在测试执行中增加测试结果字段解决方式1.测试用例自定义字段添加。在project页面中选定custom fields选项卡
千家信息网最后更新 2025年12月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安全错误
数据库的锁怎样保障安全
数据库细粒度访问控制
南宁手机棋牌软件开发公司
喷泉模型进行软件开发的特点
黄浦区项目数据库销售价格
税协 数据库
网络安全法 法律类别
新芽数据库
网络安全知识的认知
疫情期间确保网络安全
专业软件开发首选
网络安全青年争先海报简介
数据库千万数据查询
海门租房网络安全
网络安全主题宣传片文稿
手游用什么语言和软件开发
云南追梦互联网科技
网络安全工资表
计算机网络技术3年本科
异想天开网络技术
hituxcms数据库
蜗牛移动服务器维护需要多久
数据库表中的索引怎么写
网络安全手语
信息网络安全监察专业难吗
岳阳软件开发培训学校
基于大数据的网络安全与维护
每秒钟查询一次数据库
招商局互联网金融科技 运营
服务器 禁用网卡
服务器管理器功能有哪些