修复测试记录表格重试导致数据填充错乱问题。
This commit is contained in:
@@ -237,6 +237,11 @@ Namespace UTSModule.Station
|
||||
''' <returns></returns>
|
||||
Public Property CanChangeLever() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 当前节点是否处于重试状态
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsRetry As Boolean
|
||||
|
||||
Private Sub AuthByType(type As RowTypeEnum)
|
||||
Select Case type
|
||||
|
||||
@@ -22,6 +22,7 @@ Namespace UTSModule.Test.Command.SystemCommand
|
||||
Public Overrides Function Execute() As TestCommandReturn
|
||||
Dim tester As UtsTester = UtsTester.CreateTester()
|
||||
Dim rowNode As RowNode = tester.GetModule(_moduleName)
|
||||
rowNode.IsRetry = IsRetry
|
||||
|
||||
If rownode Is Nothing Then
|
||||
CommandReturn.ExecuteResult = False
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
Protected Property CommandReturn() As TestCommandReturn
|
||||
|
||||
Public Property IsRetry As Boolean
|
||||
|
||||
Sub New(command As TestCommand)
|
||||
TestCommand = command
|
||||
|
||||
28
UTS_Core/UTSModule/Test/FrmStationTest.Designer.vb
generated
28
UTS_Core/UTSModule/Test/FrmStationTest.Designer.vb
generated
@@ -418,65 +418,67 @@ Namespace UTSModule.Test
|
||||
'
|
||||
Me.CmsRecordGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsmiShowAllRows, Me.TsmiShowRecordRows, Me.TsmiBriefMode, Me.详细模式ToolStripMenuItem, Me.ToolStripSeparator1, Me.TsmiTestSetupNode, Me.TsmiTestCleanupNode, Me.ToolStripSeparator2, Me.TsmiTestNode, Me.TsmiStartTestWithNode})
|
||||
Me.CmsRecordGrid.Name = "ContextMenuStrip1"
|
||||
Me.CmsRecordGrid.Size = New System.Drawing.Size(172, 192)
|
||||
Me.CmsRecordGrid.Size = New System.Drawing.Size(181, 214)
|
||||
'
|
||||
'TsmiShowAllRows
|
||||
'
|
||||
Me.TsmiShowAllRows.Name = "TsmiShowAllRows"
|
||||
Me.TsmiShowAllRows.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiShowAllRows.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiShowAllRows.Text = "显示所有行"
|
||||
'
|
||||
'TsmiShowRecordRows
|
||||
'
|
||||
Me.TsmiShowRecordRows.Name = "TsmiShowRecordRows"
|
||||
Me.TsmiShowRecordRows.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiShowRecordRows.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiShowRecordRows.Text = "显示记录行"
|
||||
'
|
||||
'TsmiBriefMode
|
||||
'
|
||||
Me.TsmiBriefMode.Name = "TsmiBriefMode"
|
||||
Me.TsmiBriefMode.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiBriefMode.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiBriefMode.Text = "简略模式"
|
||||
'
|
||||
'详细模式ToolStripMenuItem
|
||||
'
|
||||
Me.详细模式ToolStripMenuItem.Name = "详细模式ToolStripMenuItem"
|
||||
Me.详细模式ToolStripMenuItem.Size = New System.Drawing.Size(171, 22)
|
||||
Me.详细模式ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.详细模式ToolStripMenuItem.Text = "详细模式"
|
||||
'
|
||||
'ToolStripSeparator1
|
||||
'
|
||||
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
|
||||
Me.ToolStripSeparator1.Size = New System.Drawing.Size(168, 6)
|
||||
Me.ToolStripSeparator1.Size = New System.Drawing.Size(177, 6)
|
||||
'
|
||||
'TsmiTestSetupNode
|
||||
'
|
||||
Me.TsmiTestSetupNode.Name = "TsmiTestSetupNode"
|
||||
Me.TsmiTestSetupNode.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiTestSetupNode.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiTestSetupNode.Text = "执行Setup模块"
|
||||
'
|
||||
'TsmiTestCleanupNode
|
||||
'
|
||||
Me.TsmiTestCleanupNode.Name = "TsmiTestCleanupNode"
|
||||
Me.TsmiTestCleanupNode.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiTestCleanupNode.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiTestCleanupNode.Text = "执行Cleanup模块"
|
||||
'
|
||||
'ToolStripSeparator2
|
||||
'
|
||||
Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
|
||||
Me.ToolStripSeparator2.Size = New System.Drawing.Size(168, 6)
|
||||
Me.ToolStripSeparator2.Size = New System.Drawing.Size(177, 6)
|
||||
'
|
||||
'TsmiTestNode
|
||||
'
|
||||
Me.TsmiTestNode.Name = "TsmiTestNode"
|
||||
Me.TsmiTestNode.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiTestNode.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiTestNode.Text = "选择项测试"
|
||||
Me.TsmiTestNode.Visible = False
|
||||
'
|
||||
'TsmiStartTestWithNode
|
||||
'
|
||||
Me.TsmiStartTestWithNode.Name = "TsmiStartTestWithNode"
|
||||
Me.TsmiStartTestWithNode.Size = New System.Drawing.Size(171, 22)
|
||||
Me.TsmiStartTestWithNode.Size = New System.Drawing.Size(180, 22)
|
||||
Me.TsmiStartTestWithNode.Text = "选择项开始测试"
|
||||
Me.TsmiStartTestWithNode.Visible = False
|
||||
'
|
||||
'SpcMain
|
||||
'
|
||||
@@ -1006,9 +1008,9 @@ Namespace UTSModule.Test
|
||||
Me.SplitContainer1.Panel2.ResumeLayout(False)
|
||||
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainer1.ResumeLayout(False)
|
||||
Me.ResumeLayout(false)
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
Friend WithEvents StuState As System.Windows.Forms.StatusStrip
|
||||
Friend WithEvents TssLblTestTime As System.Windows.Forms.ToolStripStatusLabel
|
||||
Friend WithEvents GrdStepTestRecord As FlexCell.Grid
|
||||
|
||||
@@ -371,6 +371,8 @@ Namespace UTSModule.Test
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private _lastNode As RowNode
|
||||
|
||||
''' <summary>
|
||||
''' 获取当前节点所在的记录行,0代表未找到对应节点
|
||||
''' </summary>
|
||||
@@ -382,13 +384,17 @@ Namespace UTSModule.Test
|
||||
row = _nodeList(node)
|
||||
ElseIf _callNodeList.ContainsKey(node) Then
|
||||
If _callNodeUpdateCount.ContainsKey(node) Then
|
||||
If _lastNode IsNot Nothing AndAlso _lastNode.RowListIndex <> node.RowListIndex AndAlso node.IsRetry = False Then
|
||||
_callNodeUpdateCount(node) += 1
|
||||
End If
|
||||
Else
|
||||
_callNodeUpdateCount.Add(node, 0)
|
||||
End If
|
||||
|
||||
row = _callNodeList(node)(_callNodeUpdateCount(node))
|
||||
End If
|
||||
|
||||
_lastNode = node
|
||||
Return row
|
||||
End Function
|
||||
|
||||
@@ -476,6 +482,7 @@ Namespace UTSModule.Test
|
||||
Public Sub ClearRecode()
|
||||
If _grd Is Nothing Then Return
|
||||
|
||||
_lastNode = Nothing
|
||||
_callNodeUpdateCount.Clear()
|
||||
For row As Integer = 1 To _grd.Rows - 1
|
||||
_grd.Cell(row, ColNames.Elapsed).Text = ""
|
||||
|
||||
@@ -438,7 +438,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 +581,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 +591,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 +739,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
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user