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

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="<?php echo $_GET\["exec_id"\]; ?>" />

如下:

<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);
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我先测了

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值