diff --git a/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature b/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature index 8e70c88e..0a7bcdf7 100644 --- a/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature +++ b/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature @@ -502,8 +502,8 @@ OUTPUT: "StatusReturn" with results "Okay" or "Failed", | 1.71 | R1.3.0B | R1.3.0B | FW Version is identical | And Input initializations for the test matrix and presets to pass the preceding tests - | Actual Lifetime [days] | Actual Drained [%] | Max Drained [%] | Comment | - | 90 | 2.0 | 2.0 | Normal threshold okay | + | Max Drained [%] | Comment | + | 2.0 | Normal threshold okay | And Input initializations for the test matrix and presets to pass the preceding tests | Actual Lifetime [days] | Required Lifetime [years] | Actual Drained [%] | Comment | @@ -544,7 +544,6 @@ OUTPUT: "StatusReturn" with results "Okay" or "Failed", | 13 | - | - | - | - | - | - | - | - | - | - | - | X | - | - | Failed | Detected kill preadjustment check | | 14 | - | - | - | - | - | - | - | - | - | - | - | - | X | - | Failed | Detected kill flow test check | | 15 | - | - | - | - | - | - | - | - | - | - | - | - | - | X | Failed | Detected kill calibrations check | - When Execute the generic tests Then Check the generic test results diff --git a/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature.cs b/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature.cs index acad4866..545dfe72 100644 --- a/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature.cs +++ b/Common/Production/ProductionUiCordonel.UnitTests/Features/ProductionProcessCheckProductionState.feature.cs @@ -1841,13 +1841,9 @@ this.ScenarioInitialize(scenarioInfo); "", ((string)(null)), table23, "And "); #line hidden TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { - "Actual Lifetime [days]", - "Actual Drained [%]", "Max Drained [%]", "Comment"}); table24.AddRow(new string[] { - "90", - "2.0", "2.0", "Normal threshold okay"}); #line 504 @@ -2215,10 +2211,10 @@ this.ScenarioInitialize(scenarioInfo); #line 529 testRunner.And("Input matrix defining the test cases and results", ((string)(null)), table30, "And "); #line hidden -#line 548 +#line 547 testRunner.When("Execute the generic tests", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 549 +#line 548 testRunner.Then("Check the generic test results", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden } diff --git a/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj b/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj index d83541b9..2cd29499 100644 --- a/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj +++ b/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj @@ -56,6 +56,7 @@ SpecFlowSingleFileGenerator + ProductionProcessCheckProductionState.feature.cs diff --git a/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs b/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs index 6edb24f2..424c4045 100644 --- a/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs +++ b/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using System.Threading; using FluentAssertions; using LaaPackages.Features.Cordonel.Models; using Logic.ProductionToProductMapper.Files.Fw; @@ -1225,6 +1224,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps parsedTableRow.CordonelDeviceStatus.DrainedBatteryLoad_uAs = (UInt64)(floatValue * parsedTableRow.CordonelDeviceStatus.InitialBatteryLoad_mAh * parsedTableRow.CordonelDeviceStatus.BatteryQuantity * 1000 * 3600 / 100); + + parsedTableRow.RequiredEOLProgress.ProductionStatusDrainedBatteryLoad = floatValue; + //GenesisStatusHandler.CalculateLifeTime(parsedTableRow.CordonelDeviceStatus); + //parsedTableRow.RequiredEOLProgress.ProductionStatusRemainingLifeTime = + // parsedTableRow.CordonelDeviceStatus.RemainingLifeTimeYears; } if (ParseFloat(tableRow, "Max Drained [%]", out strValue, @@ -1406,7 +1410,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps parsedTableRow.RequiredEOLProgress.SpecialRequirementVersion = null; parsedTableRow.RequiredEOLProgress.RequirementRequestChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { singleSelectionLock = true; parsedTableRow.ProductionRequirements.IsStandardActive = false; @@ -1424,7 +1429,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps { parsedTableRow.RequiredEOLProgress.RequirementOrderChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X") && !singleSelectionLock) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X") && !singleSelectionLock) { singleSelectionLock = true; parsedTableRow.Meter.OrderNumber = 0; @@ -1438,7 +1444,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps { parsedTableRow.RequiredEOLProgress.RequirementPcbIdChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { singleSelectionLock = true; parsedTableRow.ProductionRequirements.PcbId = 0; @@ -1452,7 +1459,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps { parsedTableRow.RequiredEOLProgress.RequirementRegionChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { singleSelectionLock = true; parsedTableRow.Meter.Region = "?"; @@ -1466,7 +1474,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps { parsedTableRow.RequiredEOLProgress.ProductionStatusLutCrc = ""; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { singleSelectionLock = true; parsedTableRow.Meter.LutCrc = "?"; @@ -1509,9 +1518,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps { parsedTableRow.RequiredEOLProgress.ProductionStatusBatteryLoadChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { - singleSelectionLock = true; parsedTableRow.ProductionRequirements.MaxDrainedBatteryLoadPercentShipping = 0; parsedTableRow.RequiredEOLProgress.ProductionStatusBatteryLoadChecked = EOLStatus.FAIL; } @@ -1523,10 +1532,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps { parsedTableRow.RequiredEOLProgress.ProductionStatusRemainingLifeTimeChecked = EOLStatus.NULL; } - + else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { - singleSelectionLock = true; parsedTableRow.ProductionRequirements.RequiredLifeTimeYearsShipping = 1000; parsedTableRow.RequiredEOLProgress.ProductionStatusRemainingLifeTimeChecked = EOLStatus.FAIL; } @@ -1539,9 +1547,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps parsedTableRow.RequiredEOLProgress.MaxStorageMonths = null; parsedTableRow.RequiredEOLProgress.MaxStorageMonthsChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { - singleSelectionLock = true; parsedTableRow.ProductionRequirements.MaxStorageMonths = 0; parsedTableRow.RequiredEOLProgress.MaxStorageMonths = 0; parsedTableRow.RequiredEOLProgress.MaxStorageMonthsChecked = EOLStatus.FAIL; @@ -1553,14 +1561,12 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps if (singleSelectionLock) { parsedTableRow.RequiredEOLProgress.ProductionStatusZeroFlowChecked = EOLStatus.NULL; - parsedTableRow.RequiredEOLProgress.ProductionStatusCalibrationChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { - singleSelectionLock = true; parsedTableRow.TestBenchState[4] = ""; parsedTableRow.RequiredEOLProgress.ProductionStatusZeroFlowChecked = EOLStatus.FAIL; - parsedTableRow.RequiredEOLProgress.ProductionStatusCalibrationChecked = EOLStatus.NULL; } } @@ -1571,9 +1577,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps parsedTableRow.RequiredEOLProgress.ProductionStatusCalibrationChecked = EOLStatus.NULL; } - else if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) + else + if (!string.IsNullOrEmpty(strValue) && strValue.Equals("X")) { - singleSelectionLock = true; parsedTableRow.TestBenchState[5] = ""; parsedTableRow.RequiredEOLProgress.ProductionStatusCalibrationChecked = EOLStatus.FAIL; } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs index d7979e17..a5607356 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckProductionState.cs @@ -310,6 +310,10 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// /// - Changed from "StatusReturn" to "EOLStatus". /// + /// + /// - Collect all requirement statuses before signalizing failed to summarize results starting with battery + /// load. + /// public override StatusReturn ExecuteProcess() { #region ----------------------------------- Check EOL Progress -------------------------------------------- @@ -413,10 +417,13 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr #region ----------------------------------- Check Remaining Battery Load ---------------------------------- + var erroneousSequenceStep = false; if (EOLStatus.FAIL == CheckRemainingBatteryLoad(out feedbackMsg)) { ErrorMsgDispatcher(feedbackMsg); - return StatusReturn.Failed; + //return StatusReturn.Failed; + // Do not return immediately to avoid multiple special-requirements on multiple errors + erroneousSequenceStep = true; } SuccessMsgDispatcher(feedbackMsg); @@ -428,7 +435,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (EOLStatus.FAIL == CheckRemainingLifetime(out feedbackMsg)) { ErrorMsgDispatcher(feedbackMsg); - return StatusReturn.Failed; + //return StatusReturn.Failed; + // Do not return immediately to avoid multiple special-requirements on multiple errors + erroneousSequenceStep = true; } SuccessMsgDispatcher(feedbackMsg); @@ -440,7 +449,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (EOLStatus.FAIL == CheckStorageMonths(out feedbackMsg)) { ErrorMsgDispatcher(feedbackMsg); - return StatusReturn.Failed; + //return StatusReturn.Failed; + // Do not return immediately to avoid multiple special-requirements on multiple errors + erroneousSequenceStep = true; } SuccessMsgDispatcher(feedbackMsg); @@ -449,15 +460,19 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr #region ----------------------------------- Check Preadjusment -------------------------------------------- + var warningSequenceStep = false; eolStatus = CheckPreadjustment(out feedbackMsg); if (EOLStatus.FAIL == eolStatus) { ErrorMsgDispatcher(feedbackMsg); - return StatusReturn.Failed; + //return StatusReturn.Failed; + // Do not return immediately to avoid multiple special-requirements on multiple errors + erroneousSequenceStep = true; } if (EOLStatus.NA == eolStatus) { WarningMsgDispatcher(feedbackMsg); + warningSequenceStep = true; } SuccessMsgDispatcher(feedbackMsg); @@ -470,11 +485,14 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (EOLStatus.FAIL == eolStatus) { ErrorMsgDispatcher(feedbackMsg); - return StatusReturn.Failed; + //return StatusReturn.Failed; + // Do not return immediately to avoid multiple special-requirements on multiple errors + erroneousSequenceStep = true; } if (EOLStatus.NA == eolStatus) { WarningMsgDispatcher(feedbackMsg); + warningSequenceStep = true; } SuccessMsgDispatcher(feedbackMsg); @@ -491,27 +509,43 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (StatusReturn.Skipped == statusReturn) { WarningMsgDispatcher(feedbackMsg); - return StatusReturn.Skipped; + warningSequenceStep = true; + //return StatusReturn.Skipped; } if (StatusReturn.Failed == statusReturn) { ErrorMsgDispatcher(feedbackMsg); - return StatusReturn.Failed; + //return StatusReturn.Failed; + // Do not return immediately to avoid multiple special-requirements on multiple errors + erroneousSequenceStep = true; } if (StatusReturn.Warning == statusReturn) { WarningMsgDispatcher(feedbackMsg); - return StatusReturn.Failed;//TODO THW return warning? + //return StatusReturn.Failed;//TODO THW return warning? + erroneousSequenceStep = true; } + #endregion -------------------------------- Check Calibration Values -------------------------------------- + + #region ----------------------------------- Summarize Check Results --------------------------------------- + + // One or more checks failed + if (erroneousSequenceStep) + return StatusReturn.Failed; + + // One or more checks generated a warning + if (warningSequenceStep) + return StatusReturn.Skipped; + + // Here everything went fine SuccessMsgDispatcher(feedbackMsg); ActualProcessProgress++; - #endregion // All test successfully passed reaching this line return StatusReturn.Okay; + #endregion -------------------------------- Summarize Check Results --------------------------------------- } - /// /// Common routine to exit with error and user window with error message ///