修复测试模式与调试模式间跳转异常的问题
This commit is contained in:
@@ -329,17 +329,18 @@ Namespace UTSModule.Test
|
||||
''' 开始测试,此函数为正式测试调用
|
||||
''' </summary>
|
||||
Public Sub StartTest()
|
||||
RaiseEvent TestStart(Me, New EventArgs())
|
||||
|
||||
_userVar.Clear() '清空全局变量
|
||||
_testResult.ResetTestResult() '重置测试结果
|
||||
|
||||
'重置测试进度
|
||||
RaiseEvent TestProgressChanged(Me, New TestProgressChangedEventArgs(0))
|
||||
|
||||
DebugMode = False
|
||||
_exitTest = False
|
||||
|
||||
RaiseEvent TestStart(Me, New EventArgs())
|
||||
|
||||
'重置测试进度
|
||||
RaiseEvent TestProgressChanged(Me, New TestProgressChangedEventArgs(0))
|
||||
|
||||
'测试主代码
|
||||
TestFunction()
|
||||
|
||||
@@ -354,16 +355,18 @@ Namespace UTSModule.Test
|
||||
''' 开始调试测试,此函数为正式测试调用
|
||||
''' </summary>
|
||||
Public Sub StartDebugTest()
|
||||
RaiseEvent TestStart(Me, New EventArgs())
|
||||
DebugMode = True
|
||||
_exitTest = False
|
||||
|
||||
_userVar.Clear() '清空全局变量
|
||||
_testResult.ResetTestResult() '重置测试结果
|
||||
|
||||
RaiseEvent TestStart(Me, New EventArgs())
|
||||
|
||||
'重置测试进度
|
||||
RaiseEvent TestProgressChanged(Me, New TestProgressChangedEventArgs(0))
|
||||
|
||||
DebugMode = True
|
||||
_exitTest = False
|
||||
|
||||
|
||||
'测试主代码
|
||||
TestFunction()
|
||||
@@ -438,7 +441,9 @@ Namespace UTSModule.Test
|
||||
Public Function ExecuteFixedModule(moduleName As FixedModuleEnum) As TestCommandReturn
|
||||
Dim result As TestCommandReturn
|
||||
If _testModules.ContainsKey(moduleName.ToString()) Then
|
||||
result = ExecutePlan(_testModules(moduleName.ToString()), Nothing)
|
||||
Dim node As RowNode = _testModules(moduleName.ToString())
|
||||
node.IsRetry = False '顶级节点最初重试状态为false
|
||||
result = ExecutePlan(node, Nothing)
|
||||
Else
|
||||
result = New TestCommandReturn()
|
||||
result.ExecuteResult = False
|
||||
@@ -579,6 +584,9 @@ Namespace UTSModule.Test
|
||||
Dim p As Double = CDbl(IIf(retry = 0, 100, (node.Retry - retry) / node.Retry * 100))
|
||||
RaiseEvent RetryProgressChanged(Me, New TestProgressChangedEventArgs(p))
|
||||
|
||||
'判断节点是否为重试状态
|
||||
If retry > 0 Then node.IsRetry = True
|
||||
|
||||
'重置模块测试结果
|
||||
result.ExecuteResult = True
|
||||
|
||||
@@ -586,6 +594,7 @@ Namespace UTSModule.Test
|
||||
For Each rowNode As RowNode In node.RowNodes
|
||||
If _exitTest Then Return GetExitTestReturn() '退出执行检测
|
||||
|
||||
rowNode.IsRetry = node.IsRetry '将父节点的重试状态赋予子节点
|
||||
If ExecutePlan(rowNode, localVariable).ExecuteResult = False Then result.ExecuteResult = False '节点测试失败则认为模块失败
|
||||
If result.ExecuteResult Then Continue For '执行成功则执行下一流程
|
||||
If TestFailMode = TestFailModeEnum.StepFail Then Exit For '单步失败模式下退出测试,不再执行
|
||||
@@ -733,6 +742,10 @@ Namespace UTSModule.Test
|
||||
Dim p As Double = CDbl(IIf(retry = 0, 100, (node.Retry - retry) / node.Retry * 100))
|
||||
RaiseEvent RetryProgressChanged(Me, New TestProgressChangedEventArgs(p))
|
||||
|
||||
'更新命令是否处于重试状态
|
||||
If retry > 0 Then node.IsRetry = True
|
||||
executor.IsRetry = node.IsRetry
|
||||
|
||||
'执行成功一次则判定成功,退出执行
|
||||
result = executor.Execute()
|
||||
If result.ExecuteResult Then Exit For
|
||||
|
||||
Reference in New Issue
Block a user