Progress bar bug fix for repeated tests.

This commit is contained in:
Milan Hanajik
2018-06-01 13:58:59 +02:00
parent acb5491225
commit 385825c9e8
+14 -11
View File
@@ -705,7 +705,7 @@ namespace TBF.BenchControl.Sequences
log.InfoFormat("Test {0}: Transition({1}, BeforeTest) returned {2}", test.Name, (transitionBefore == null ? "null" : transitionBefore.Name), rsltTransBefore);
}
bool lastTestFinished = true;
bool currentTestFinished = true;
if (rsltTransBefore == Event.Done)
{
do
@@ -718,28 +718,28 @@ namespace TBF.BenchControl.Sequences
deferredData.Add(new DeferredTestEvaluationData(test, repetNr, (testMethod as ITestMethodWith2ndPass).IntermediateData));
}
lastTestFinished = (rsltTransBefore == Event.Done && !e.Contains(Event.Error)
currentTestFinished = (rsltTransBefore == Event.Done && !e.Contains(Event.Error)
&& !e.Contains(Event.ConfigurationError)
&& !e.Contains(Event.OpArgumentError)
&& !e.Contains(Event.UiCmdStop));
if (e.Contains(Event.OuterLoopStart)) break; /// Do not repeat OuterLoopStart test in this loop
if (lastTestFinished && !isOuterLoopMode) repetNr++;
}
while (lastTestFinished && !isOuterLoopMode && repetNr <= test.Repeats);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, currentTestFinished ? Config.Entities.Progress.Completed
: Config.Entities.Progress.Aborted));
if (lastTestFinished && !isOuterLoopMode && repetNr > test.Repeats) repetNr = 1; /// Reset repetNr
if (e.Contains(Event.OuterLoopStart)) break; /// Do not repeat OuterLoopStart test in this loop
if (currentTestFinished && !isOuterLoopMode) repetNr++;
}
while (currentTestFinished && !isOuterLoopMode && repetNr <= test.Repeats);
if (currentTestFinished && !isOuterLoopMode && repetNr > test.Repeats) repetNr = 1; /// Reset repetNr
}
if (testMethod.DoTransitions())
{
TransitionContext endContext = lastTestFinished ? TransitionContext.AfterTest : TransitionContext.Stop;
TransitionContext endContext = currentTestFinished ? TransitionContext.AfterTest : TransitionContext.Stop;
rsltTransAfter = Transition(transitionAfter, endContext); /// Transition or SetRoute - end of test
log.InfoFormat("Test {0}: Transition({1}, {2}) returned {3}", test.Name, (transitionAfter == null ? "null" : transitionAfter.Name), endContext, rsltTransAfter);
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, lastTestFinished ? Config.Entities.Progress.Completed
: Config.Entities.Progress.Aborted));
}
if (rsltTransBefore == Event.Error || e.Contains(Event.Error))
@@ -911,6 +911,9 @@ namespace TBF.BenchControl.Sequences
bool testFinished = (rsltTransBefore == Event.Done && !e.Contains(Event.Error) && !e.Contains(Event.ConfigurationError)
&& !e.Contains(Event.OpArgumentError) && !e.Contains(Event.UiCmdStop));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, testFinished ? Config.Entities.Progress.Completed
: Config.Entities.Progress.Aborted));
if (testMethod.DoTransitions())
{
TransitionContext endContext = testFinished ? TransitionContext.AfterTest : TransitionContext.Stop;