|
可以通过在“操作->验证”中编写脚本来解决,一般都是测试人员会附加附件,所以只要在测试人员提交BUG的操作下做限制就可以了
BASIC脚本如下:
Set session = GetSession()
currentId = GetFieldValue("id").GetValue()
set entity = session.GetEntity("defect", currentId)
set attachFields = entity.AttachmentFields
stop
numFields = attachFields.Count
For x = 0 to numFields - 1
set oneField = attachFields.Item(x)
set attachs = oneField.Attachments
For each attachment in attachs
fileName = attachment.FileName
fileSize = attachment.FileSize
If (filesize = 0) Then
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filename)
filesize = f.size
End if
if fileSize > 1048576 then
' MsgBox "为了控制数据库的大小、节约资源,附件大小不能超过1M!" + VbCrLf + VbCrLf + VldMsg, vbExclamation, "提示"
defect_Validation = "为了控制数据库的大小、节约资源,附件大小不能超过1M!"
end if
Next
Next |
评分
-
查看全部评分
|