TD模板制作示例(转)

上一篇 / 下一篇  2009-03-04 13:47:58 / 个人分类:测试流程管理QC

原文忘记从哪里引用的了,如果作者看到,可以与我联系,谢谢

设置步骤:
1.用管理员身份进入到要应用模板的项目中。
2.点击Set Up WolkFlow设置工作流。
3.以下的模板设置都在脚本设计器中进行设计。
'****以下三个方法写在Test Plan module scrīpt模块中*********
'******新增测试用例(Test Plan)模板********
Sub TestPlan_Test_New
  On Error Resume Next
  Test_Fields("TS_DEscrīptION").Value="[测试目标]"+chr(13)+chr(13)
  Test_Fields("TS_DEscrīptION").Value=Test_Fields("TS_DEscrīptION").Value+"[前置条件]"+chr(13)+chr(13)
  Test_Fields("TS_DEscrīptION").Value=Test_Fields("TS_DEscrīptION").Value+"[数据准备]"+chr(13)
  Test_Fields("TS_DEscrīptION").Value=Test_Fields("TS_DEscrīptION").Value+chr(32)
 
  On Error GoTo 0
End Sub

'*****新增测试步骤(Test Step)模板**************
'*******以下New方法是用户自定义方法*********
Sub TestPlan_DesignStep_New
  On Error Resume Next
 DesignStep_Fields("DS_DEscrīptION").Value="[操作描述]"
 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value +chr(10)+chr(13)
 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value+"[输入数据]"
 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value +chr(10)
 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value +chr(32)
 DesignStep_Fields("DS_EXPECTED").Value="[预期结果]"
 DesignStep_Fields("DS_EXPECTED").Value=  DesignStep_Fields("DS_EXPECTED").Value+chr(10)
 DesignStep_Fields("DS_EXPECTED").Value=  DesignStep_Fields("DS_EXPECTED").Value+chr(32)
  On Error GoTo 0
End Sub
'********系统调用的是MoveTo方法***********
Sub TestPlan_DesignStep_MoveTo
  On Error Resume Next
   dim Temp
   Temp=DesignStep_Fields("DS_DEscrīptION").Value
   if Trim(Temp)="" then
    TestPlan_DesignStep_New
   end if
  On Error GoTo 0
End Sub
'说明:TD系统在新增Step步骤时是调用TestPlan_DesignStep_MoveTo 方法,所以不能把模板事情写在该方法中。
'而应该先判断DesignSteps("DS_DEscrīptION").Value是否为空,
'如果非空的话,说明该步骤已经是存在的,不应该应用该模板,当然如果为空的话,则说明该步骤可以应用新模板,则调用用户自定义的New方法。

'********以下方法写在Defects module scrīpt模块中**********
'********新增Bug模板************
Sub Defects_Bug_New
  On Error Resume Next
 Bug_Fields("BG_DEscrīptION").Value="[模块路径] >> >>" +chr(13)+chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[问题描述]" +chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"1." +chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"2." +chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[实际结果]" +chr(13)+chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[预期结果/解决方法]" +chr(13)+chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[备注]" +chr(13)
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+chr(32)
  On Error GoTo 0
End Sub
'备注说明:脚本中有用到一些字符的 chr(10) 换行≈chr(13) 回车 chr(32) 空格


TAG:

 

评分:0

我来说两句

Open Toolbar