win7 x64配置TestLink执行用例提交BUG配置[连接mantisbt]

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,高可用系列 2核4GB
简介: 这篇文章介绍了如何在Windows 7 x64系统上配置TestLink以执行测试用例并提交BUG到MantisBT,包括修改TestLink和Mantis的配置文件以实现两者之间的BUG关联,以及在Mantis中删除BUG时自动删除TestLink中的关联。

1. Testlink提交BUGmantisbt****方式简化

1.1. Testlink提交BUG****链接修改

1.1.1. 执行用例时,提交BUG的窗口链接修改为链接到mantis提交问题的页面

**修改testlink\gui\templates\execute\**inc_exec_show_tc_exec.tpl

# 如下:
 {if $tc_old_exec.build_is_open}
     <a href="javascript.:open_bug_add_window({$gui->tproject_id},{$tc_old_exec.id},{$tc_old_exec.execution_id},'link')">
# 换成=》
  {if $tc_old_exec.build_is_open}
         {\* 2016-09-12 xup 增加BUG时,进行testlink关联 \*}
    {\* <a href="javascript.:open_bug_add_window({$gui->tproject_id},{$tc_old_exec.id},{$tc_old_exec.execution_id},'link')"> \*}
        <a href="http://localhost:80/mantisbt/bug_report_page.php?exec_id={$tc_old_exec.execution_id}" target='_blank'>
           {\* \*\*\*\*\*\*\*\*\*\*\*localhost需要换成公众都能访问的IP地址\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*}

1.1.2. mantis 提交bug的时候判断是否有exec_id参数传入

修改mantis**\**bug_report_page.php

后增加一行:

<input type=“hidden” name=“exec_id” value="" />

如下:

<tr>
<td class="form-title" colspan="2">
<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
<?php echo lang_get( 'enter_report_details_title' ) ?>
</td>
</tr>
换成=》
<tr>
<td class="form-title" colspan="2">
<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
<!--2016-09-12 xup 增加BUG时,进行testlink关联\-->
<input type="hidden" name="exec_id" value="<?php echo $_GET\["exec_id"\]; ?>" />
<?php echo lang_get( 'enter_report_details_title' ) ?>
</td>
</tr>

1.1.3. 在mantis目录下面新增bug_add_testlink.php页面,进行testlinkmantisBUG关联的处理

**新增:**mantis\bug_add_testlink.php

<?php
//2016-09-12 xup 增加BUG时,进行testlink关联
function write_execution_bug($exec_id, $bug_id,$just_delete=false)
{
$conn = mysql_connect("localhost","root","");
$execution_bugs = 'testlink.ttexecution_bugs';
// Instead of Check if record exists before inserting, do delete + insert
$sql = "DELETE FROM {$execution_bugs} " .
"WHERE execution_id={$exec_id} " .
"AND bug_id='" . $bug_id ."'";
$result = mysql_query($sql,$conn);
if(!$just_delete)
{
$sql = "INSERT INTO {$execution_bugs} " .
"(execution_id,bug_id) " .
"VALUES({$exec_id},'" . $bug_id . "')";
$result = mysql_query($sql,$conn);
}
return $result ? 1 : 0;
}
?>

1.1.4. 修改bug_report.php**,如果存在exec_id,则进行testlinkmantisBUG关联**

修改****mantis\bug_report.php

(1)在一开始增加一句:

//2016-09-12 xup 增加BUG时,进行testlink关联
require_once( 'bug_add_testlink.php' );

(2)修改如下内容:

$t_bug_id = $t_bug_data->create();
换成=》
//2016-09-12 xup 增加BUG时,进行testlink关联
//$t_bug_id = $t_bug_data->create();
$testlink_exec_id = $_POST\["exec_id"\];
if ($testlink_exec_id!= "")
{
$t_bug_id = $t_bug_data->create();
write_execution_bug($testlink_exec_id,$t_bug_id);
}
else
{
$t_bug_id = $t_bug_data->create();
}

(3)修改如下内容:

<form method="post" action="<?php echo string_get_bug_report_url() ?>">
换成=》
<!--2012-09-12 xup 增加BUG时,进行testlink关联\-->
<!--<form method="post" action="<?php echo string_get_bug_report_url() ?>">-->
<form method="post" action="<?php echo string_get_bug_report_url() ?>?exec_id=<?php echo $_POST\['exec_id'\]; ?>">

1.2. Mantis删除BUG时,自动删除testlink****关联

1.2.1. 修改****bug_add_testlink.php 增加删除bug时,自动删除testlink关联的函数

修改****mantis\bug_add_testlink.php

//2016-09-12 xup 删除BUG时,删除对应的testlink关联 Mysql
function delete_testlink_bug($bug_id)
{
$conn = mysql_connect("localhost","root","root");
$execution_bugs = 'testlink.ttexecution_bugs';
$sql = "DELETE FROM $execution_bugs WHERE bug_id = $bug_id ";
$result = mysql_query($sql,$conn);
return $result ? 1 : 0;
}

1.2.2. 修改bug_actiongroup.php,调用删除testlink关联的函数

修改****mantis\bug_actiongroup.php

在开始增加:

//2019-09-12 xup 删除BUG时,删除对应的testlink关联
require_once( 'bug_add_testlink.php' );

修改如下内容:

bug_delete( $t_bug_id );
换成=》
bug_delete( $t_bug_id );
//2016-09-12  xup 删除BUG时,删除对应的testlink关联
delete_testlink_bug($t_bug_id);
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
4月前
|
数据可视化
在使用SVN的过程中,通过哪些执行查看某个文件的修改信息
在使用SVN的过程中,通过哪些执行查看某个文件的修改信息
1002 0
常见的bug---4、在DataGrip上跑本地模式报return 2异常
常见的bug---4、在DataGrip上跑本地模式报return 2异常
jira项目笔记5-commitlint代码提交语句检查
jira项目笔记5-commitlint代码提交语句检查
126 0
|
Java
【JAVA】【SpringBoot】当重新启动项目的时候,需要把用户一些状态回退,但是回退失败了,项目却没有停止,可以用System.exit(1);
【JAVA】【SpringBoot】当重新启动项目的时候,需要把用户一些状态回退,但是回退失败了,项目却没有停止,可以用System.exit(1);
352 0
【JAVA】【SpringBoot】当重新启动项目的时候,需要把用户一些状态回退,但是回退失败了,项目却没有停止,可以用System.exit(1);
|
测试技术 数据安全/隐私保护