TA的每日心情 | 奋斗 2018-8-27 15:56 |
---|
签到天数: 322 天 连续签到: 1 天 [LV.8]测试军长
|
4#
楼主 |
发表于 2011-8-16 11:56:41
|
只看该作者
Public Sub Report (sStatus, sStepName,sExpected,sActual, sDetails)
Dim TestcaseName
Dim Row, TCRow, NewTC
TestcaseName = Environment("ActionName") & " > Iteration (Test-Action) = " & Environment("TestIteration") & "-" & Environment("ActionIteration")
'Open the Result file
' Set objWorkBook = oEngine.Workbooks.Open (oSettings("File"))
'Select the Summery Sheet
Set objSheet = oEngine.Sheets("Test_Summary")
oEngine.Sheets("Test_Summary").Select
With objSheet
'Note the Row No. on which to Report the result
Row = .Range("C8").Value + 2*.Range("C7").Value + 2
TCRow = .Range("C7").Value + 11
NewTC = False
.Range("F" & TCRow).Font.ColorIndex = 3
.Range("E" & TCRow).Font.ColorIndex = 50
.Range("G" & TCRow).Font.ColorIndex = 46
'Check if it is a new Tetstcase
If objSheet.Cells(TCRow - 1, 2).Value <> TestcaseName Then
.Cells(TCRow, 2).Value = TestcaseName
oEngine.ActiveSheet.Hyperlinks.Add objSheet.Cells(TCRow, 2), "", "Test_Result!A" & Row+1, TestcaseName
.Cells(TCRow, 3).Value = sStatus
.Range("F" & TCRow).Value = "0"
.Range("E" & TCRow).Value = "0"
.Range("G" & TCRow).Value = "0"
Select Case sStatus
Case "Fail"
.Range("C" & TCRow).Font.ColorIndex = 3
.Range("F" & TCRow).Value = "1"
Case "Pass"
.Range("C" & TCRow).Font.ColorIndex = 50
.Range("E" & TCRow).Value = "1"
Case "Warning"
.Range("C" & TCRow).Font.ColorIndex = 46
.Range("G" & TCRow).Value = "1"
End Select
'The first step.
.Cells(TCRow, 4).Value = 1 '(D,11)
NewTC = True
'it is a new Testcase
.Range("C7").Value = .Range("C7").Value + 1 'count the cases.
'Set the Borders for the Result Header
.Range("B" & TCRow & ":G" & TCRow).Borders(1).LineStyle = 1
.Range("B" & TCRow & ":G" & TCRow).Borders(2).LineStyle = 1
.Range("B" & TCRow & ":G" & TCRow).Borders(3).LineStyle = 1
.Range("B" & TCRow & ":G" & TCRow).Borders(4).LineStyle = 1
'Set color and Fonts for the Header
.Range("B" & TCRow & ":G" & TCRow).Interior.ColorIndex = 2
.Range("B" & TCRow).Font.ColorIndex = 23
.Range("B" & TCRow & ":G" & TCRow).Font.Bold = True
'====NOT A NEW CASE================================================================
Else
.Range("D" & TCRow-1).Value = .Range("D" & TCRow-1).Value + 1
Select Case sStatus
Case "Fail"
.Range("F" & TCRow-1).Value = .Range("F" & TCRow-1).Value +1
Case "Pass"
.Range("E" & TCRow-1).Value = .Range("E" & TCRow-1).Value +1
Case "Warning"
.Range("G" & TCRow-1).Value = .Range("G" & TCRow-1).Value +1
End Select
End If
If (Not NewTC) And (sStatus = "Fail") Then
.Cells(TCRow-1, 3).Value = "Fail"
.Range("C" & TCRow-1).Font.ColorIndex = 3
End If
If (Not NewTC) And (sStatus = "Warning") Then
If .Cells(TCRow-1, 3).Value = "Pass" Then
.Cells(TCRow-1, 3).Value = "Warning"
.Range("C" & TCRow-1).Font.ColorIndex = 46
End If
End If |
|