打开FCKEditor/fckconfig.js,确定默认的php连接被选择。
搜索:
var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php
打开FCKeditor/editor/filemanager/browser/default/connectors/php/config.php
安全:你必须使能‘connector’,设为true。
$Config['Enabled'] = true ;
首先在testlink的目录下建立一个上传目录TestLink_upload,并确认该目的地址文件夹必须是可读写的而且能用网络访问的
1.修改\third_party\fckeditor\fckconfig.js文件,选择php模式
去掉// FCKConfig.ProtectedSource.Add( //g ) ; // PHP style. server side code的注释
将var _FileBrowserLanguage = ‘asp’ ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = ‘asp’ ; // asp | aspx | cfm | lasso | php
里面的asp都改为php
2.修改\third_party\fckeditor\editor\filemanager\browser\default\connectors\php\config.php
$Config['Enabled'] = false ;
改为$Config['Enabled'] = true ;
$Config['UserFilesPath'] = '/userfiles/' ;
改为$Config['UserFilesPath'] = 'TestLink_upload/' ;
$Config['UserFilesAbsolutePath'] = '' ;
改为$Config['UserFilesAbsolutePath'] = 'C:\\www\\testlink\\TestLink_upload\\' ;
3.修改\third_party\fckeditor\editor\filemanager\upload\php\config.php
$Config['Enabled'] = false ;
改为$Config['Enabled'] = true ;
$Config['UserFilesPath'] = '/userfiles/' ;
改为$Config['UserFilesPath'] = 'TestLink_upload/' ;
$Config['UserFilesAbsolutePath'] = '' ;
改为$Config['UserFilesAbsolutePath'] = 'C:\\www\\testlink\\TestLink_upload\\' ;
4. 重启电脑等待1-2小时后,修改就生效了(很奇怪,不是重启apache或者电脑后立马生效的,我配置2次都是如此),实际试验发现立刻可以的。
7.4、Javascript
$g_use_ext_js_library = ENABLED;
定义表格整理库,默认值’kryogenix.org’,空‘’使这个特性失效。
$g_sort_table_engine='kryogenix.org';
7.5、使用自定义模板引擎
如果你想要使用自定义模板,我们有这些配置数组,
$g_tpl
包括,
$g_tpl['tcView']
$g_tpl['tcSearchView']
$g_tpl['tcEdit']
$g_tpl['tcNew']
$g_tpl['execSetResults']
允许你创建与原testlink不同名称的模板文件,不用担心在下次升级过程中有覆盖源文件的危险。
注意:不是所有的testlink页面都可以进行这种类型的配置。
标准配置:
$g_tpl['tcView'] = "tcView.tpl";
$g_tpl['tcSearchView'] = "tcSearchView.tpl";
$g_tpl['tcEdit'] = "tcEdit.tpl";
$g_tpl['tcNew'] = "tcNew.tpl";
$g_tpl['execSetResults'] = "execSetResults.tpl";
8、测试执行设置
允许XML-RPC调用外部外部测试自动化服务器,特殊按钮将会被显示在执行页面。
ENABLED -> enable XML-RPC calls
DISABLED -> disable
$tlCfg->exec_cfg->enable_test_automation = DISABLED;
在执行页面的附件管理的不同设置,这些变量预定义在const.inc.php中:
$att_model_m1 -> shows upload button and title
$att_model_m2 -> hides upload button and title [DEFAULT VALUE]
$tlCfg->exec_cfg->att_model = $att_model_m2;
用户可以删除执行结果:
ENABLED -> User can delete an execution result
DISABLED -> User can not. [DEFAULT VALUE]
$tlCfg->exec_cfg->can_delete_execution = DISABLED;
8.1、执行历史
定义执行历史顺序:
ASC -> 上升上一次执行在最后,
DESC ->下降最后一次执行在顶部,默认值
$tlCfg->exec_cfg->history_order = ‘DESC’;
在执行窗口,定义是否所选build的全部执行历史是被显示:
TRUE -> the whole execution history for the build will be shown
FALSE -> just last execution will be shown [DEFAULT VALUE]
$tlCfg->exec_cfg->history_on = FALSE;
允许显示前个build的执行结果:
TRUE -> test case VERY LAST (i.e. in any build) execution status will be displayed
FALSE -> only last result on current build. [DEFAULT VALUE]
$tlCfg->exec_cfg->show_last_exec_any_build = FALSE;
允许显示所有build的执行结果历史:
TRUE -> History for all builds will be shown
FALSE -> Only history of the current build will be shown [DEFAULT VALUE]
$tlCfg->exec_cfg->show_history_all_builds = FALSE;
8.2. 测试执行导航
根据测试用例状态显示测试用例和测试用例计数的颜色:
ENABLED -> 有色的测试状态 [DEFAULT VALUE]
DISABLED -> disable
$tlCfg->exec_cfg->enable_tree_testcases_colouring = ENABLED;
$tlCfg->exec_cfg->enable_tree_counters_colouring = ENABLED;
控制当用户点击树形菜单上的test suite时发生在右边frame上的事,Disabling这种设置能帮助避免性能问题。
ENABLED -> 显示所有测试用例
DISABLED -> 什么都不发生,要点击一个测试用例你需要点击它,默认
$tlCfg->exec_cfg->show_testsuite_contents = DISABLED;
允许在旧的执行上编辑执行评论,注意,用户必须有测试用例的执行权力。
ENABLED -> user can edit execution notes, on old executions (Attention: user must have test case execution right)
DISABLED -> no edit allowed [DEFAULT VALUE]
$tlCfg->exec_cfg->edit_notes = DISABLED;
过滤测试用例,‘tester’角色的用户能根据测试执行分配查看。
'all' -> 所有测试用例.
'assigned_to_me' ->测试用例分配给数据用户 [DEFAULT VALUE]
'assigned_to_me_or_free' -> 分配给数据用户或未分配
$tlCfg->exec_cfg->view_mode->tester='assigned_to_me';
过滤测试用例,‘tester’角色的用户能根据测试执行分配执行。
'all' -> all test cases.
'assigned_to_me' -> test cases assigned to the current user. [DEFAULT VALUE]
'assigned_to_me_or_free' -> test cases assigned to logged user or not assigned
$tlCfg->exec_cfg->exec_mode->tester='assigned_to_me';
用户过滤,在测试执行导航:
'logged_user' -> 调到当前用户
'none' -> 默认无过滤应用[DEFAULT VALUE]
$tlCfg->exec_cfg->user_filter_default='none';
通过优先级过滤TC,优先级根据公式定义的权限值:
Priority = (urgency x importance)
LOW = 所有测试用例优先级
MEDIUM =所有测试用例优先级>= LOW_Threshold AND 优先级
$tlCfg->urgencyImportance_HIGH_Threshold = 6;
8.3、在执行页面添加一个新的结果类型
1.需要用到的配置文件有:
cfg/const.inc.php
custom_config.inc.php
locale/en_GB/custom_strings.txt results['status_code']
2. 拷贝下面这几行到 custom_config.inc.php文件:
$tlCfg->results['status_code'] = array (
"failed" => 'f',
"blocked" => 'b',
"passed" => 'p',
"not_run" => 'n',
"not_available" => 'x',
"unknown" => 'u',
"all" => 'all'
);
$tlCfg->results['status_label'] = array(
"all" => "test_status_all_status",
"not_run" => "test_status_not_run",
"passed" => "test_status_passed",
"failed" => "test_status_failed",
"blocked" => "test_status_blocked",
"not_available" => "test_status_not_available",
"unknown" => "test_status_unknown"
);
$tlCfg->results['status_label_for_exec_ui'] = array(
"passed" => "test_status_passed",
"failed" => "test_status_failed",
"blocked" => "test_status_blocked"
);
$tlCfg->results['default_status'] = "passed";
3. 加入新状态,并保存:
tcstatus_1 -> code q
tcstatus_2 -> code w
4. custom_config.inc.php 文件变为:
$tlCfg->results['status_code'] = array (
"failed" => 'f',
"blocked" => 'b',
"passed" => 'p',
"not_run" => 'n',
"not_available" => 'x',
"unknown" => 'u',
"all" => 'all',
"tcstatus_1" => 'q',
"tcstatus_2" => 'w'
);
$tlCfg->results['status_label'] = array(
"all" => "test_status_all_status",
"not_run" => "test_status_not_run",
"passed" => "test_status_passed",
"failed" => "test_status_failed",
"blocked" => "test_status_blocked",
"not_available" => "test_status_not_available",
"unknown" => "test_status_unknown",
"tcstatus_1" => "test_status_new_one",
"tcstatus_2" => "test_status_new_two"
);
$tlCfg->results['status_label_for_exec_ui'] = array(
"passed" => "test_status_passed",
"failed" => "test_status_failed",
"blocked" => "test_status_blocked",
"tcstatus_1" => "test_status_new_one",
"tcstatus_2" => "test_status_new_two"
);
$tlCfg->results['default_status'] = "blocked";
5. 修改 css 如果你想要新的颜色的话.
.tcstatus_1, div.tcstatus_1 {
color: black;
background: yellow;
}
.tcstatus_2, div.tcstatus_2 {
color: black;
background: orange;
}
div.tcstatus_1, div.tcstatus_2 {
margin: 8px;
padding: 6px;
text-align: center;
}
9、测试规约
步骤和预期结果文本域的设置:
'horizontal' - steps and expected results panes are side-by-side,水平
'vertical' - steps pane is above the expected results (default behaviour) 垂直
$g_spec_cfg->steps_results_layout = 'vertical';
在测试规约导航的测试集过滤有效性:
ENABLED -> User will see a test suite filter (default behaviour)
DISABLED -> no filter available
$g_spec_cfg->show_tsuite_filter = ENABLED;
测试规约导航的刷新:
ENABLED -> 每次用户做了编辑操作,刷新
DISABLED -> 树不会自动刷新,用户手工
$g_spec_cfg->automatic_tree_refresh = ENABLED;
允许编辑一个测试用例的执行版本。
ENABLED -> user can edit executed Test case versions
DISABLED -> editing of executed Test case versions is blocked. [DEFAULT VALUE]
$tlCfg->testcase_cfg->can_edit_executed = DISABLED;
用户可以从测试计划移除一个测试用例的已执行版本(至少有一个测试结果存在):
$tlCfg->testcase_cfg->can_remove_executed = ENABLED;
测试规约模板:
对于测试用例,用户初始需要定义的内容是:summary,steps,预期结果。每个对象的配置包含类型和值,类型:
'none' ->模板不被使用,默认是空的编辑域,[DEFAULT VALUE]
'string' -> 值成员的值被分配给 FCK object
'string_id' -> value member is used in a lang_get() call, and return value is assigned to FCK object. 配置 string_id 在文件 custom_strings.txt
'file' -> value member is used as file name. The file is read and it's contents assigned to a text area component as input
$g_testcase_template->summary->type = 'string';
$g_testcase_template->summary->value = '
Objective: TBD
Precondition:
N/A
';
$g_testcase_template->steps->type = 'none';
$g_testcase_template->steps->value = '';
$g_testcase_template->expected_results->type = 'none';
$g_testcase_template->expected_results->value = '';
User can define the initial content of a new Test Suite description similar way:
$g_testsuite_template->details->type='file';
$g_testsuite_template->details->value='D:\w3\tl\head_20080103\logs\tsuite.txt';
10、附件
$g_attachments->enabled = TRUE; (true or false)设置是否可以上传附件
储存类型可以是数据库也可以文件系统
TL_REPOSITORY_TYPE_DB => database
TL_REPOSITORY_TYPE_FS => filesystem
$g_repositoryType = TL_REPOSITORY_TYPE_FS;(文件系统)
$g_repositoryPath = TL_ABS_PATH . "upload_area" . DS;(文件系统的存储路径,推荐改变路径,增强安全性)
在存储系统中可以使用压缩,配置字段是:
TL_REPOSITORY_COMPRESSIONTYPE_NONE => no compression
TL_REPOSITORY_COMPRESSIONTYPE_GZIP => gzip compression
配置:
$g_repositoryCompressionType = TL_REPOSITORY_COMPRESSIONTYPE_NONE;
对每一个存储文件的默认最大size是1MB.
define("TL_REPOSITORY_MAXFILESIZE_MB", 1);
也可检查你的php设置 (通常默认为 2MBs)
用户需要为每一个附件加标题。
// TRUE -> 上传的文件可以没有标题,默认为true
$g_attachments->allow_empty_title = TRUE;
此时你可以要求系统完成:
// 'none' -> 写入db一个空标题
// 'use_filename' ->使用文件名作为标题
//$g_attachments->action_on_save_empty_title='use_filename';
$g_attachments->action_on_save_empty_title='none';
表示是用来作为下载时的链接描述的,如果标题为空,那么显示时系统需要完成的操作可以有:
'show_icon' ->字段$g_attachments->access_icon 被使用.
'show_label' -> $g_attachments->access_string 的值被使用 .
$g_attachments->action_on_display_empty_title='show_icon';
$g_attachments->access_icon='';
$g_attachments->access_string="[*]";
你可以设置上传文件的显示顺序:
$g_attachments->order_by=" ORDER BY date_added DESC ";
11、需求支持
需求功能对每一个测试产品水平可以是有效或无效的,作为管理员进入编辑测试产品页面,TL的一个特性就是需求管理。
需求的经典结构允许两种层次:SRS文档和需求列表。字段child_requirements_mgmt允许的需求的树形组织。
ENABLED: 允许N层树
DISABLED: 仅一层
$tlCfg->req_cfg->child_requirements_mgmt = DISABLED;
需求标识字符串(req_doc_id)必须是唯一的,
TRUE -> req_doc_id 在整个 DB (system_wide)中是唯一的
FALSE -> req_doc_id 在SRS中是唯一的
$g_req_cfg->reqdoc_id->is_system_wide = FALSE;
在创建了软件需求点后(srs),你可以选择为每个requirement创建test case(部件和分类也同时被创建)。
配置字段:$g_req_cfg
$g_req_cfg->use_req_spec_as_testsuite_name = TRUE;
(FALSE -> test cases被创建和分配给以$g_req_cfg->default_testsuite_name为名称的test suite,
TRUE -> REQuirement Specification 标题 被用来作为 testsuite 的名字)
$g_req_cfg->default_testsuite_name = "Test suite created by Requirement - Auto";