diff --git a/Ginger/Ginger/ALM/Repository/RQMRepository.cs b/Ginger/Ginger/ALM/Repository/RQMRepository.cs index 9d15b451f4..3ffea80a10 100644 --- a/Ginger/Ginger/ALM/Repository/RQMRepository.cs +++ b/Ginger/Ginger/ALM/Repository/RQMRepository.cs @@ -267,7 +267,15 @@ public override bool ExportBusinessFlowToALM(BusinessFlow businessFlow, bool per } else { - Reporter.ToUser(eUserMsgKey.ExportItemToALMFailed, GingerDicser.GetTermResValue(eTermResKey.BusinessFlow), businessFlow.Name, res); + if (businessFlow.ALMTestSetLevel == "RunSet") + { + Reporter.ToLog(eLogLevel.ERROR, $"Export to ALM Failed The { GingerDicser.GetTermResValue(eTermResKey.RunSet) } ' {businessFlow.Name}' failed to be exported to ALM. { Environment.NewLine }{ Environment.NewLine } Error Details: {res}"); + } + else + { + Reporter.ToUser(eUserMsgKey.ExportItemToALMFailed, GingerDicser.GetTermResValue(eTermResKey.BusinessFlow), businessFlow.Name, res); + } + } Reporter.HideStatusMessage(); diff --git a/Ginger/GingerCore/ALM/RQM/ExportToRQM.cs b/Ginger/GingerCore/ALM/RQM/ExportToRQM.cs index 66ccb56791..860d497e04 100644 --- a/Ginger/GingerCore/ALM/RQM/ExportToRQM.cs +++ b/Ginger/GingerCore/ALM/RQM/ExportToRQM.cs @@ -111,12 +111,28 @@ public bool ExportExecutionDetailsToRQM(BusinessFlow businessFlow, ref string re string bfExportedID = GetExportedIDString(businessFlow.ExternalIdCalCulated, "RQMID"); if (string.IsNullOrEmpty(bfExportedID) || bfExportedID.Equals("0")) { - result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} is missing ExternalID, cannot export RQM TestPlan execution results without External ID"; + if(businessFlow.ALMTestSetLevel == "RunSet") + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)}: {businessFlow.Name} is missing ExternalID, cannot export RQM TestPlan execution results without External ID"; + } + else + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} is missing ExternalID, cannot export RQM TestPlan execution results without External ID"; + } + return false; } if (businessFlow.ActivitiesGroups.Count == 0) { - result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} Must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}"; + if(businessFlow.ALMTestSetLevel == "RunSet") + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)}: {businessFlow.Name} Must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}"; + } + else + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} Must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}"; + } + return false; } LoginDTO loginData = new LoginDTO() { User = ALMCore.DefaultAlmConfig.ALMUserName, Password = ALMCore.DefaultAlmConfig.ALMPassword, Server = ALMCore.DefaultAlmConfig.ALMServerURL }; @@ -321,12 +337,28 @@ public bool ExportExecutionDetailsToRQM(BusinessFlow businessFlow, ref string re if (resultInfo.ErrorCode == 0) { - result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} Execution results published to RQM successfully."; + if(businessFlow.ALMTestSetLevel == "RunSet") + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)}: {businessFlow.Name} Execution results published to RQM successfully."; + } + else + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} Execution results published to RQM successfully."; + } + return true; } else { - result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} Execution results failed to publist to RQM due to {resultInfo.ErrorDesc}"; + if (businessFlow.ALMTestSetLevel == "RunSet") + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)}: {businessFlow.Name} Execution results failed to publist to RQM due to {resultInfo.ErrorDesc}"; + } + else + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)}: {businessFlow.Name} Execution results failed to publist to RQM due to {resultInfo.ErrorDesc}"; + } + Reporter.ToLog(eLogLevel.ERROR, $"Failed to export execution details to RQM/ALM due to {resultInfo.ErrorDesc}"); return false; } @@ -702,7 +734,19 @@ public bool ExportBusinessFlowToRQM(BusinessFlow businessFlow, ObservableList Business { if ((result == null) || (result == string.Empty)) { - result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} - {BizFlow.Name} - Error when uploading to ALM.{Environment.NewLine}"; + if(BizFlow.ALMTestSetLevel == "RunSet") + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)} - {BizFlow.Name} - Error when uploading to ALM.{Environment.NewLine}"; + } + else + { + result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} - {BizFlow.Name} - Error when uploading to ALM.{Environment.NewLine}"; + } + } BizFlow.PublishStatus = BusinessFlow.ePublishStatus.PublishFailed; } @@ -269,7 +277,15 @@ public bool ExportBusinessFlowsResultToALM(ObservableList Business else { BizFlow.PublishStatus = BusinessFlow.ePublishStatus.NotPublished; - result = $"{result}{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} - {BizFlow.Name} - doesn't have ExternalID, cannot execute publish to ALM RunSet Action {Environment.NewLine}"; + if(BizFlow.ALMTestSetLevel == "RunSet") + { + result = $"{result}{GingerDicser.GetTermResValue(eTermResKey.RunSet)} - {BizFlow.Name} - doesn't have ExternalID, cannot execute publish to ALM RunSet Action {Environment.NewLine}"; + } + else + { + result = $"{result}{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} - {BizFlow.Name} - doesn't have ExternalID, cannot execute publish to ALM RunSet Action {Environment.NewLine}"; + } + Reporter.ToLog(eLogLevel.INFO, $"{BizFlow.Name} - doesn't have ExternalID, cannot execute publish to ALM RunSet Action"); } }