Option explicit
private function Hreport(expectedValue, ActualValue, testStatus, nodename)
Dim oEventDesc, newEventContext
Set oEventDesc = CreateObject("scripting.Dictionary")
oEventDesc("Status") = micFail
oEventDesc("EnableFilter") = False
oEventDesc("NodeName") = nodename
oEventDesc("StepHtmlInfo") = "<table border='1'>" &"<tr><td>Expected Value</td><td>"+expectedValue+"</td></tr>" & _
"<tr><td>Actual Value</td><td>"+ActualValue+"</td></tr>"&"<tr><td>Checkpoint Status</td><td style='background-color:red'><b>Failed</b></td></tr></table>"
If testStatus Then
oEventDesc("Status") = micPass
oEventDesc("StepHtmlInfo") = Replace(oEventDesc("StepHtmlInfo"), "<td style='background-color:red'><b>Failed</b></td>", "<td style='background-color:green'><b>Passed</b></td>")
End If
newEventContext = Reporter.LogEvent ("Replay", oEventDesc, Reporter.GetContext)
Set oEventDesc = nothing
end function
Function VaildateProperty(object, PropertyName, ExpectedValue)
If object.GetROProperty(PropertyName) = ExpectedValue Then
Hreport ExpectedValue, object.GetROProperty(PropertyName), true, "检查 "+object.GetTOProperty("testObjName")+"<"+propertyName+"> 属性"
VaildateProperty = true
Exit function
else
Hreport ExpectedValue, object.GetROProperty(PropertyName), false, "检查 "+object.GetTOProperty("testObjName")+"<"+propertyName+"> 属性"
VaildateProperty = false
Exit function
End If
End Function
private function Hreport(expectedValue, ActualValue, testStatus, nodename)
Dim oEventDesc, newEventContext
Set oEventDesc = CreateObject("scripting.Dictionary")
oEventDesc("Status") = micFail
oEventDesc("EnableFilter") = False
oEventDesc("NodeName") = nodename
oEventDesc("StepHtmlInfo") = "<table border='1'>" &"<tr><td>Expected Value</td><td>"+expectedValue+"</td></tr>" & _
"<tr><td>Actual Value</td><td>"+ActualValue+"</td></tr>"&"<tr><td>Checkpoint Status</td><td style='background-color:red'><b>Failed</b></td></tr></table>"
If testStatus Then
oEventDesc("Status") = micPass
oEventDesc("StepHtmlInfo") = Replace(oEventDesc("StepHtmlInfo"), "<td style='background-color:red'><b>Failed</b></td>", "<td style='background-color:green'><b>Passed</b></td>")
End If
newEventContext = Reporter.LogEvent ("Replay", oEventDesc, Reporter.GetContext)
Set oEventDesc = nothing
end function
Function VaildateProperty(object, PropertyName, ExpectedValue)
If object.GetROProperty(PropertyName) = ExpectedValue Then
Hreport ExpectedValue, object.GetROProperty(PropertyName), true, "检查 "+object.GetTOProperty("testObjName")+"<"+propertyName+"> 属性"
VaildateProperty = true
Exit function
else
Hreport ExpectedValue, object.GetROProperty(PropertyName), false, "检查 "+object.GetTOProperty("testObjName")+"<"+propertyName+"> 属性"
VaildateProperty = false
Exit function
End If
End Function