简单明了的TestLink配置手册

    xiaoxiao2022-07-15  194

    安装完 TestLink的下一步就是配置了,Testlink的配置信息包含很多方面,从日志信息、与其它bug管理工具的连接、自定义产生的文档、Email信息配置、用户认证配置、GUI定制、 测试执行设置、测试规约、附件、需求支持、混合功能配置等等,在此一并列出。希望对你的TestLink的配置有所帮助,在此也声明一点,TestLink系统配置是很庞大的,部分信息是从网上搜集的。    1、配置文件概览   所有的配置字段都在文件config.inc.php和它所包含的文件中。对这个版本这些就是配置文件:   config.inc.php -主配置文件,它几乎被每一个页面include.   config_db.inc.php -包含访问 数据库的配置字段,它在安装或升级过程中创建,几乎不需要你手工修改它。   custom_config.inc.php – 用在config.inc.php 文件中的默认字段值的修改,它的好处是在升级过程中你的修改能很方便的被拷贝。   /cfg/.cfg.php –设置对bug跟踪工具的数据库的访问。   /cfg/const.inc.php – 定义那些不支持修改的常量和变量。   /gui/templates/input_dimensions.conf – 代替huml输入的硬编码属性,像maxlength和size,我们把它编进了这个文件中。(有一些历史原因造成的异常)   /cfg/tl_fckeditor_config.js – 设置fckeditor组件的配置    2、日志   LOG LEVEL   日志记录的缺省级别,所需设置字段$tlCfg->log_level=’ERROR’;   有效值包含NONE, ERROR, INFO, DEBUG, EXTENDED,默认为error。DEBUG级别只在开发或者与bug系统集成时使用   LOGGING OUTPUT   有两种输出方式:文件和数据库。两种方法都默认打开,设置下列字段为false,如果你想要进行设置。   $g_loggerCfg = null; // all loggers enabled (default)   $g_loggerCfg['db']['enabled'] = FALSE; // true/false   $g_loggerCfg['file']['enabled'] = FALSE; // true/false   LOGGING PATH   $tlCfg->log_path=TL_ABS_PATH . ‘logs’ . DS ;   日志文件的文件名和路径,配置。   Php的log level默认是error,我们希望php故障能够向用户显示。当然你也可以修改这个字段   error_reporting(E_ALL);   SMARTY DEBUG WINDOW   开发者应该使用这个字段来显示一个额外的包含所有字段和值的列表的窗口,这些值来自php脚本相关的模板组件。在产品安装时必须是false。   $tlCfg->smarty_debug = false;   如果有安全薄弱的点,在登录页和主页面会有警告。这个消息默认打开(true),false将引起文件config_check.txt,有着一个列表,创建日志目录,不会用户不会通过GUI被通知的。   $tlCfg->show_config_check_warning = TRUE;   Event viewer   所有早于这个值(天)的时间都将被从数据库移除。   $g_removeEventsOlderThan = 30;    3、关于与其他缺陷追踪工具的连接   在此以Mantis为例进行分析:   /** The DB host to use when connecting to the mantis db */   define('BUG_TRACK_DB_HOST', 'localhost');   /** The name of the database that contains the mantis tables */  //Mantis使用的数据库名   define('BUG_TRACK_DB_NAME', 'mantis');   /** The DB type being used by mantis   values: mysql,mssql,postgres   */   define('BUG_TRACK_DB_TYPE', '[CONFIGURE_BUG_TRACK_DB_TYPE]');   /** The DB password to use for connecting to the mantis db */   define('BUG_TRACK_DB_USER', 'mantis');                //Mantis登录数据库的用户名   define('BUG_TRACK_DB_PASS', 'mantis');                //Mantis登录数据库的密码   define('BUG_TRACK_HREF', "http://localhost/mantis/view.php id=");  //定义查看bug号的链接   /** link to the bugtracking system, for entering new bugs */   define('BUG_TRACK_ENTER_BUG_HREF',"http://localhost/mantis/");   //定义报bug的链接   OK,基本上就这样了,另外还要打开$g_interface_bugs = ‘NO’;设置为YES   4、产生的文档   下面的字符串被用来在打印文档的首页,左边空白就是无效。   $tlCfg->document_generator->company_name = 'Your Company';   $tlCfg->document_generator->company_copyright = '2008 (c) TestLink Community';   $tlCfg->document_generator->confidential_msg = 'GPL';   打印的文档有自己的设计模板,你可以修改CSS模板为你自己的,   $tlCfg->document_generator->css_template = $tlCfg->theme_dir .'css/tl_documents.css';   测试用例版本可以被包含在产生的文档中,带着测试用例标题。   $tlCfg->document_generator->tc_version_enabled = FALSE;    5、发送Email   Testlink已经整合了邮件系统,支持发送报告和通知,你必须设置下列值:   SMTP服务器发送产生的Email,值‘localhost’在大多数例子里都足够了。   $g_smtp_host = 'localhost';   管理员和发送者的Email地址也是强制性字段。   $g_tl_admin_email = 'your.name@your_company.com'; # for problem/error notification   $g_from_email = 'no_replay@testlink.test_team'; # email sender (showed to recipient)   $g_return_path_email = 'your.name@your_company.com';   你可以选择性的设置Email的优先级,5是默认的。   # Urgent = 1, Not Urgent = 5, Disable = 0   $g_mail_priority = 5;   你的SMTP服务器应该需要登录来relayemali。在多数case里值是空的。   $g_smtp_username = '';   $g_smtp_password = '';    6、用户认证   Testlink支持两种验证方式, ‘MD5′ – 使用存储在内部数据库中的加密口令。’LDAP’ – 使用来自目录服务器的口令。   $tlCfg->authentication['method']= 'MD5';(默认,也可设置为‘’,‘md5’,’ldap’)    使用ldap验证的相关字段:   $tlCfg->authentication['ldap_server'] = 'localhost';   $tlCfg->authentication['ldap_port'] = '389';   $tlCfg->authentication['ldap_version'] = '3';   $tlCfg->authentication['ldap_root_dn'] = 'dc=mycompany,dc=com';   $tlCfg->authentication['ldap_organization'] = ''; // e.g.   '(organizationname=*Traffic)'   $tlCfg->authentication['ldap_uid_field'] = 'uid';   $tlCfg->authentication['ldap_bind_dn'] = '';   $tlCfg->authentication['ldap_bind_passwd'] = '';    登录相关配置:   Testlink允许新用户创建默认角色的帐号,通过在登录页面的“New User”的链接。它加速了用户的管理步骤,管理员可以通过设置下列字段为false,来使这个特性为无效,以完全在系统中控制用户。   $tlCfg->user_self_signup = TRUE;   注意:如果你改变了这个字段,你肯想要更新$TLS_valid_user_name_format字符串,它在语言文件中,来解释你在页面上使用的规则。   $tlCfg->validation_cfg->user_login_valid_regex='/^[\w \-]+$/';   常规表达式也被用来在有效用户的email地址:   $tlCfg->validation_cfg->user_email_valid_regex = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/";   配置下列字段来显示配置检查的结果:   $tlCfg->show_config_check_warning = FALSE;   True:消息显示在登录和testlink桌面上   False:一个两行的消息显示,以文件的检查结果的形式指示。    7、GUI 定制   7.1、树形菜单   可能值有:’EXTJS’, ‘LAYERSMENU’,'DTREE’, ‘JTREE’,EXTJS是默认值,我们推荐它。这个组件有最好的性能,因为他使用的是异步通信。   $tlCfg->treemenu_type = 'EXTJS';   所有类型的节点(test case,test suite)被加入以排序号码“0”,当创建一个树节点时。它的最初显示顺序是根据节点ID来的。一个父test suite拥有下个默认值来分割子test suite 和test case。这些值必须是>=0.   $tlCfg->treemenu_default_testsuite_order = 1;   $tlCfg->treemenu_default_testcase_order = 100;   在树形菜单中显示或隐藏test case 的唯一ID:   $tlCfg->treemenu_show_testcase_id = TRUE;   允许在树形菜单上,根据状态计数test case。   $tlCfg->exec_cfg->enable_tree_testcase_counters = ENABLED;    7.2、GUI 布局   gui/themes/default/.——主题目录,包含css和图片文件。   你应该拷贝默认目录,修改内容和设置下列字段指向它。   $tlCfg->theme_dir = 'gui/themes/your_theme/';   你可以通过写你自己的CSS文件来改变testlink外观。   testlink.css (主风格定义)   tl_print.css (打印页面的风格设置)   tl_documents.css (用于产生的文档,像测试规约)   tl_treemenu.css (树形菜单的特殊设置)   这些文件名被作为常量定义在const.inc.php文件中,你可以根据需要修改。   如果你要设计你自己的logo,那么拷贝图片到gui/themes/default/images/目录,   $tlCfg->company_logo = ‘company_logo.png’;    注意:这个logo将被用在所有的GUI和产生的文档中。   登录页面可以显示信息文本,以html格式,这个值默认是空的。   $tlCfg->login_info = 'Please, contact administrator G. B. Shaw if you have any question.';   你可以修改弹头图标的文件名,默认包含arrow_org.gif and slide_gripper.gif。   $tlCfg->bullet_image = 'slide_gripper.gif';   指定test project背景颜色:   $tlCfg->gui->testproject_coloring = 'background';   打开页面,编辑test project到指定的特殊颜色,默认值是“none”(没有背景颜色的改变是允许的)。默认背景颜色是:   $tlCfg->gui->background_color = '#9BD';   设置显示姓名来代替只显示login,指定一种显示格式:   $tlCfg->username_format = '%login%';   Examples:   '%first% %last%' -> John Cook   '%last%, %first%' -> Cook, John   '%first% %last% %login%' -> John Cook [ux555]   配置默认导航框在窗口左边的宽。   $tlCfg->frame_workarea_default_width = "30%";   Test project复选框在顶部菜单的顺序是可以配置的了,值必须是SQL支持的。   $tlCfg->gui->tprojects_combo_order_by='ORDER BY nodes_hierarchy.id DESC';   Examples:   'ORDER BY name'   'ORDER_BY nodes_hierarchy.id DESC' -> similar effect to order last created first   管理者可以配置在主页导航主题的配置:   $tlCfg->gui->layoutMainPageLeft = array( 'testProject' => 1,   'userAdministration' => 2 , 'requirements' => 3, 'testSpecification' => 4);   $tlCfg->gui->layoutMainPageRight = array( 'testPlan' => 1, 'testExecution' => 2 ,'testPlanContents' => 3);   配置度量的仪表盘上的圆的百分比:   $tlCfg->dashboard_precision = 2;   控制一些GUI元素的有效性,你可以使他们无效来提高页面描述性能,   $tlCfg->gui->round_corners->exec_history = ENABLED;   $tlCfg->gui->round_corners->tc_title = ENABLED;   $tlCfg->gui->round_corners->tc_spec = ENABLED;   7.3、文本域编辑   文本数据编辑通过Javascript编辑器解决,它在文本域的工具栏,配置被下列数组定义   $tlCfg->gui->text_editor = array();   FCKeditor组件默认被使用,这是一个很有特色的组件,可以很容易的通过配置提高。   $tlCfg->gui->text_editor['all'] = array(   'type' => 'fckeditor',   'toolbar' => 'tl_default',   'configFile' => 'cfg/tl_fckeditor_config.js',   );   如果在这个结构中没有带搜索键的元素被发现,那么这个配置将被使用。每个元素与下列配置关键字对应:   字段’type’ = ‘fckeditor’, ‘tinymce’ 或是’none’ -> 使用文本域输入字段   下面这行修改用于所有地方的文本域:   $tlCfg->gui->text_editor['all'] = array( 'type' => 'none');   FCKeditor工具栏定义了在文本域菜单是否允许或是失效图标,我们推荐研究它。   默认的testlink工具栏定义是‘tl_default’。自定义工具栏的‘tl_default’定义在/cfg/tl_fckeditor_config.js文件中。你可以向对其他配置字段一样修改工具栏内容,(像templates, styles, spell checker等)。   字段‘configFile’只对type = ‘fckeditor’的应用有效,例如,下面的属性就是被这些字段定义的:   'height': FCKEditor的高   'width':  FCKEditor的宽   'cols':    tinymce and none的列数量   'rows':   tinymce and none的行数量   提示:在做了配置修改后,清你的浏览器cookies和缓存   // $tlCfg->gui->text_editor['execution'] = array( 'type' => 'none'); // BETTER   Performance with a lot of testcases   //   // This configuration is useful only if default type is set to 'fckeditor'   // $tlCfg->gui->text_editor['design'] = array('toolbar' => 'tl_mini');   //   // $tlCfg->gui->text_editor['testplan'] = array( 'type' => 'none');   // $tlCfg->gui->text_editor['build'] = array( 'type' => 'fckeditor','toolbar' =>   'tl_mini');   // $tlCfg->gui->text_editor['testproject'] = array( 'type' => 'tinymce');   // $tlCfg->gui->text_editor['role'] = array( 'type' => 'tinymce');   // $tlCfg->gui->text_editor['requirement'] = array( 'type' => 'none');   // $tlCfg->gui->text_editor['requirement_spec'] = array( 'type' => 'none');   性能警告:问题是fckeditor使用iframe,并且每个iframe需要下载fckeditor文件,所以可能会有一些页面有装在问题。   在fckeditor中打开图片装载   这个指导面向FCKEditor 2.3.2,但对别的版本也是有效的。   打开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( /<\ [\s\S]* \ >/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 = 所有测试用例优先级 < LOW_Threshold   HIGH =所有测试用例优先级>= HIGH_Threshold   MEDIUM =所有测试用例优先级>= LOW_Threshold AND 优先级 < HIGH_Threshold $tlCfg->urgencyImportance_LOW_Threshold = 3;   $tlCfg->urgencyImportance_HIGH_Threshold = 6;    8.3、在执行页面添加一个新的结果类型   1.需要用到的配置文件有:   cfg/const.inc.php   custom_config.inc.php <-- 创建它,如果它还不存在的话   locale/en_GB/custom_strings.txt <-- 创建它,最好不要编辑 strings.txt   gui/themes/theme_m2/css/testlink.css 配置过程: 1. 打开 cfg/const.inc.php ,找到字段: $tlCfg->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"; 最新内容请见作者的GitHub页:http://qaseven.github.io/ 相关资源:testlink使用手册
    最新回复(0)