havards的个人空间_首页_软件测试专业网站:51Testing软件测试网 - powered by X-Space

日历

« 2008-05-18  
    123
45678910
11121314151617
18192021222324
25262728293031

统计信息

  • 访问量: 175
  • 日志数: 4
  • 建立时间: 2007-07-25
  • 更新时间: 2008-03-27

RSS订阅

我的最新日志

  • 解决testlink中testsuite和testproject关联测试需求的方法

    2008-3-27

    首先,找到testlink\lib\req\reqTcAssign.php,下面是原代码

    // redirect if a user doesn't choose test case
    if ($edit == 'testproject' || $edit == 'testsuite')
    {
      redirect($_SESSION['basehref'] . "/lib/general/show_help.php?help=assignReqs&locale={$_SESSION['locale']}");
     exit();
    }
    else if($edit == 'testcase')
    {
     //get list of ReqSpec (not_empty)
     $get_not_empty=1;
     $arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);

      $SRS_qty=count($arrReqSpec);
     
      if( $SRS_qty > 0 )
      {
       $tc_mgr = new testcase($db);
       $arrTc = $tc_mgr->get_by_id($tc_id);
       if ($arrTc)
       {
        $tcTitle = $arrTc[0]['name'];
       
        //get first ReqSpec if not defined
        if (!$idReqSpec && $SRS_qty > 0)
        {
         reset($arrReqSpec);
         $idReqSpec = key($arrReqSpec);
         tLog('Set first SRS ID: ' . $idReqSpec);
        }
        
        if ($idReqSpec)
        {
         $arrAssignedReq = getRequirements($db,$idReqSpec, 'assigned', $tc_id);
         $arrAllReq = getRequirements($db,$idReqSpec);
         $arrUnassignedReq = array_diff_byId($arrAllReq, $arrAssignedReq);
        }
       }
      }  // if( $SRS_qty > 0 ) 
    }
    else
    {
     tlog("Wrong GET/POST arguments.", 'ERROR');
     exit();
    }

     

    将这段代码修改如下,即可使testsuite和testproject关联需求

    $tsuite_id = isset($_GET['id']) ? intval($_GET['id']) : null;
    #----testcase--------

    if($edit == 'testcase')
    {
     //get list of ReqSpec (not_empty)
     $get_not_empty=1;
     $arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);

      $SRS_qty=count($arrReqSpec);
     
      if( $SRS_qty > 0 )
      {
       $tc_mgr = new testcase($db);
       $arrTc = $tc_mgr->get_by_id($tc_id);
       if ($arrTc)
       {
        $tcTitle = $arrTc[0]['name'];
       
        //get first ReqSpec if not defined
        if (!$idReqSpec && $SRS_qty > 0)
        {
         reset($arrReqSpec);
         $idReqSpec = key($arrReqSpec);
         tLog('Set first SRS ID: ' . $idReqSpec);
        }
        
        if ($idReqSpec)
        {
         $arrAssignedReq = getRequirements($db,$idReqSpec, 'assigned', $tc_id);
         $arrAllReq = getRequirements($db,$idReqSpec);
         $arrUnassignedReq = array_diff_byId($arrAllReq, $arrAssignedReq);
        }
       }
      }  // if( $SRS_qty > 0 ) 
    }

    #-------testproject------------
    else if($edit == 'testproject' )
    {
     //get list of ReqSpec (not_empty)
     $get_not_empty=1;
     $arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);

      $SRS_qty=count($arrReqSpec);
     
      if( $SRS_qty > 0 )
      {
       $tproject_mgr = new testproject($db);
       $arrTproject = $tproject_mgr->get_by_id($tproject_id);
       if ($arrTproject)
       {
        $tprojectTitle = $arrTproject[0]['name'];
       
        //get first ReqSpec if not defined
        if (!$idReqSpec && $SRS_qty > 0)
        {
         reset($arrReqSpec);
         $idReqSpec = key($arrReqSpec);
         tLog('Set first SRS ID: ' . $idReqSpec);
        }
        
        if ($idReqSpec)
        {
         $arrAssignedReq = getRequirements($db,$idReqSpec, 'assigned', $tproject_id);
         $arrAllReq = getRequirements($db,$idReqSpec);
         $arrUnassignedReq = array_diff_byId($arrAllReq, $arrAssignedReq);
        }
       }
      }  // if( $SRS_qty > 0 ) 
    }
    #-----testsuite-------------------

    else if($edit == 'testsuite')
    {
     //get list of ReqSpec (not_empty)
     $get_not_empty=1;
     $arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);

      $SRS_qty=count($arrReqSpec);
     
      if( $SRS_qty > 0 )
      {
       $tsuite_mgr = new testsuite($db);
       $arrTsuite = $tsuite_mgr->get_by_id($tsuite_id);
       if ($arrTsuite)
       {
        $tsuiteTitle = $arrTsuite[0]['name'];
       
        //get first ReqSpec if not defined
        if (!$idReqSpec && $SRS_qty > 0)
        {
         reset($arrReqSpec);
         $idReqSpec = key($arrReqSpec);
         tLog('Set first SRS ID: ' . $idReqSpec);
        }
        
        if ($idReqSpec)
        {
         $arrAssignedReq = getRequirements($db,$idReqSpec, 'assigned', $tsuite_id);
         $arrAllReq = getRequirements($db,$idReqSpec);
         $arrUnassignedReq = array_diff_byId($arrAllReq, $arrAssignedReq);
        }
       }
      }  // if( $SRS_qty > 0 ) 
    }

    else
    {
     tlog("Wrong GET/POST arguments.", 'ERROR');
     exit();
    }

  • 如何在mantis的查看问题列表中自定义添加一项

    2008-3-06

    解决方法:

    进入mantis,依次选择 管理->配置管理->configuration_report

    到页面的最下方,帐号选择all users,项目名称选择你希望设置生效的项目,configuration option写view_issues_page_columns,类型默认就好,值设为array ( 'selection', 'edit', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment', 'category', 'severity', 'status', 'last_updated', 'summary' );这里的项可以自己添加,但是得保证和配置文件中的名字一致,要不内容不会自动添进去.

  • 如何让mantis的测试人员具有删除自己问题和附件的权限

    2008-3-06

    在config_defults_inc.php中
    # allow users to delete attachments uploaded by themselves even if their access
    # level is below delete_attachments_threshold.
    $g_allow_delete_own_attachments = ON;
       
    # --- reporter can close ----------
    # Allow reporters to close the bugs they reported, after they're marked resolved.
    $g_allow_reporter_close        = ON;

    这两项都改成ON之后,报告人员可以有删除自己问题的权限,并且有删除自己附件的权限.

  • 如何将mantis中报告问题的项改为必填项

    2008-3-06

    1.打开Apache>htdocs>mantis>core>bug_api.php
    # Additional info cannot be blank
           if ( is_blank( $c_additional_info ) ) {
               error_parameters( lang_get( 'additional info' ) );
               trigger_error( ERROR_EMPTY_FIELD, ERROR );
           }
    当然,得看变量名字是什么,就改成什么

    2.打开Apache>htdocs>mantis>bug_report_advanced_page.php
    找到addtional information部分
    在<td class="category">下面加上
    <span class="required">*</span>

    完成,第一步是改成必填项,第二步是加上"*"号.

Open Toolbar