欢迎大家来到测试人生,在你休息的时候你可以畅所欲言,空间里也许有些资料可以帮助到你,来吧,朋友,测试人生欢迎你!!!!

转个td或qc工作流的使用

上一篇 / 下一篇  2008-12-03 12:29:01 / 个人分类:TD

流程需要和工具结合,只有好的工具才能有力推动我们的流程实施起来。我们在实际工作中当bug状态修改的时候让我们的开发人员添加研发的评论在里面,针对这个功能我们来进行实现?针对该功能进行实现,打开qc9.2,登陆项目进行自定义,选择Workflow,打开scrīpt editor,编写代码51Testing软件测试网MQl R Ni O+? | j
  Dim PreviousStatus
'N.n{c1MRX(F0  Dim StatusChanged51Testing软件测试网CCQDx2^r
  Dim RDCommentChanged
z8b7K$FzLA"\ mZG0  Sub Bug_New51Testing软件测试网^4s:FS%Ipo
  End Sub51Testing软件测试网*n8zCv;|*\&w.U
  Sub Bug_MoveTo51Testing软件测试网F vZ.llg;K o8E
  'Enter code to be executed after another bug receives focus51Testing软件测试网*i x kMsMUh
  ' save the status into PreviousStatus
,|v!MJmX[#]0  PreviousStatus = Fields("BG_STATUS").Value
m1ZN]&b O0  StatusChanged = False
[b9H_f-Q0  RDCommentChanged = False51Testing软件测试网%y5yc^(}3] Q fz6f
  End Sub51Testing软件测试网[K$_`.S!E[1j+a
  Sub Bug_FieldChange (FieldName)
CNx Ii1]yoYl0  'Enter code to be executed after a bug field is changed51Testing软件测试网T8q-{!M y4h
  'if Status changed, then StatusChanged is TRUE51Testing软件测试网(e%C.^;q8~ E*IHf
  If FieldName = "BG_STATUS" Then51Testing软件测试网i!G:wC5p*k@h(OC |
  StatusChanged = True51Testing软件测试网F9hBD&@m!k
  'if R&D Comment is changed, then RDCommendChanged is TRUE51Testing软件测试网/uF3a#I ~Dz?\ _
  ElseIf FieldName = "BG_DEV_COMMENTS" Then
sYV f_~8i,l0  RDCommentChanged = True
sE7d4t)sW@0  End If51Testing软件测试网A+G-E&EDq @h.MU4B
  'if Status is changed from Open/Researching to Rejected and no R&D Comment is entered, then prompt user to enter R&D Comment
[ D2S8c2X`+dX0If StatusChanged And (PreviousStatus = "Open" Or PreviousStatus = "Researching") And (Fields("BG_STATUS").Value = "Rejected") And (Not RDCommentChanged) Then
XihI9\ @+NV0  MsgBox "lease enter reasons in"51Testing软件测试网.Mh5r/Zg&jAA8\
  'if Status is changed from MGR Action to Reschedule and no R&D Comment is entered, then prompt user to enter R&D Comment
Pb;SR#B0  ElseIf StatusChanged And (PreviousStatus = "MGR Action") And (Fields("BG_STATUS").Value="Reschedule") And (Not RDCommentChanged) Then51Testing软件测试网? eckix't o
  MsgBox "lease enter scheduled release version in"
To s'j#S4A6u0  End If51Testing软件测试网 _Ce.n%VIQ(}

8{f8}-E G"^0o)x0附件是一个详细的说明文档,vb代码,有兴趣的可以参考。
o9N4N0D8fR(r;E)D0
B#rhLp0W(f)Sg$`0附件: 
-L&J1f(q` Zx3F!U^{0
51Testing软件测试网-KB)_g3k)o/{7qN

:Qp{7\D!m9Gn0
d$l)dU%E-Z6s7e0
(S ~FZ5T0td的工作流很强大,值得学习研究。但是别太深,毕竟只是个管理工具,能满足自己的需求的就行。以下是我的代码,供参考
P UN*bp2R;{0Dim Fields51Testing软件测试网.v(U;v2B/im0c"TsT
Fields = Bug_Fields
},XVP sQ"x$m-DW0
%}+Xty/d0Sub Defects_Bug_New 'edit by redforce
@ RUaZwl0AddDefect_SetDefaultValues51Testing软件测试网Rz"te{
' Set default values for the fields51Testing软件测试网Aa%^1Og7ma
End Sub
6V4P"y!m U+H(W$a bW#o:B051Testing软件测试网Y6UE3DVE:r
Sub AddDefect_SetDefaultValues 'edit by redforce51Testing软件测试网!I"t N]0Ue)A%iR
Fields("BG_STATUS").Value = "open"
QHqfc0'set default bug status to open
1zg:L(o"E6AJmv0End Sub51Testing软件测试网 x4NFqhYKF
——设置新添加bug的状态为open
N#C.lZ2P"X!G!w0
o~Y+w3Fe)Pp0Sub Defects_Bug_FieldChange(FieldName)51Testing软件测试网H.?`h.fT No
if FieldName="BG_STATUS" then51Testing软件测试网$xZ~F7rW kN
if Fields("BG_STATUS").Value = "fixed" then51Testing软件测试网#~g&r~3F-h
Fields("BG_USER_02").Value=now()
1|Wuy!h?s0end if
uK0fFD-v#E0end if
&?7y,ci N:E0End Sub51Testing软件测试网hd)dmQ,XW'v
——自定义字段BG_USER_02,用来记录bug状态变为fixed的时间。date类型记录年月日;string类型记录年月日时分秒

TAG: TD

引用 删除 ivy0936   /   2010-03-18 17:21:39
 

评分:0

我来说两句

Open Toolbar