Skip to content

Commit

Permalink
Merge pull request #3615 from Ginger-Automation/Beta/BugFix/D40088_D4…
Browse files Browse the repository at this point in the history
…0083_RQMPopuupFixed

D40088_D40083 RQM Pop up for run set Level Fixed also change error me…
  • Loading branch information
Maheshkale447 authored Apr 15, 2024
2 parents e48bd0a + 9aae1ac commit d46b3ef
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 13 deletions.
10 changes: 9 additions & 1 deletion Ginger/Ginger/ALM/Repository/RQMRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
80 changes: 71 additions & 9 deletions Ginger/GingerCore/ALM/RQM/ExportToRQM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -702,7 +734,19 @@ public bool ExportBusinessFlowToRQM(BusinessFlow businessFlow, ObservableList<Ex

if (businessFlow.ActivitiesGroups.Count == 0)
{
throw new Exception($"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}");
if(businessFlow.ALMTestSetLevel == "RunSet")
{
result = $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)} must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}";
Reporter.ToLog(eLogLevel.ERROR, $"{GingerDicser.GetTermResValue(eTermResKey.RunSet)} must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}");
return false;
}
else
{
result = $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}";
Reporter.ToLog(eLogLevel.ERROR, $"{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} must have at least one {GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup)}");
return false;
}

}

ResultInfo resultInfo;
Expand All @@ -728,8 +772,17 @@ public bool ExportBusinessFlowToRQM(BusinessFlow businessFlow, ObservableList<Ex
}
catch (Exception ex)
{
result = $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM {ex.Message}";
Reporter.ToLog(eLogLevel.ERROR, $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM", ex);
if(businessFlow.ALMTestSetLevel == "RunSet")
{
result = $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.RunSet)} to RQM/ALM {ex.Message}";
Reporter.ToLog(eLogLevel.ERROR, $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.RunSet)} to RQM/ALM", ex);
}
else
{
result = $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM {ex.Message}";
Reporter.ToLog(eLogLevel.ERROR, $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM", ex);
}

return false;
}

Expand Down Expand Up @@ -808,8 +861,17 @@ public bool ExportBusinessFlowToRQM(BusinessFlow businessFlow, ObservableList<Ex
}
else
{
result = $"Failed to export the{GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM, {resultInfo.ErrorDesc}";
Reporter.ToLog(eLogLevel.ERROR, $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM, {resultInfo.ErrorDesc}");
if(businessFlow.ALMTestSetLevel == "RunSet")
{
result = $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.RunSet)} to RQM/ALM, {resultInfo.ErrorDesc}";
Reporter.ToLog(eLogLevel.ERROR, $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.RunSet)} to RQM/ALM, {resultInfo.ErrorDesc}");
}
else
{
result = $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM, {resultInfo.ErrorDesc}";
Reporter.ToLog(eLogLevel.ERROR, $"Failed to export the {GingerDicser.GetTermResValue(eTermResKey.BusinessFlow)} to RQM/ALM, {resultInfo.ErrorDesc}");
}

return false;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion Ginger/GingerCoreCommon/ReporterLib/UserMsgsPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public static void LoadUserMsgsPool()
Reporter.UserMsgsPool.Add(eUserMsgKey.ActivitiesGroupAlreadyMappedToTC, new UserMsg(eUserMsgType.WARN, "Export " + GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup) + " to QC/ALM", "The " + GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup) + " '{0}' is already mapped to the QC/ALM '{1}' Test Case, do you want to update it?" + Environment.NewLine + Environment.NewLine + "Select 'Yes' to update or 'No' to create new Test Case.", eUserMsgOption.YesNoCancel, eUserMsgSelection.Cancel));
Reporter.UserMsgsPool.Add(eUserMsgKey.BusinessFlowAlreadyMappedToTC, new UserMsg(eUserMsgType.WARN, "Export " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + " to QC/ALM", "The " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + " '{0}' is already mapped to the QC/ALM '{1}' Test Set, do you want to update it?" + Environment.NewLine + Environment.NewLine + "Select 'Yes' to update or 'No' to create new Test Set.", eUserMsgOption.YesNoCancel, eUserMsgSelection.Cancel));
Reporter.UserMsgsPool.Add(eUserMsgKey.ExportQCNewTestSetSelectDiffFolder, new UserMsg(eUserMsgType.INFO, "Export QC Item - Creating new Test Set", "Please select QC folder to export to that the Test Set does not exist there.", eUserMsgOption.OK, eUserMsgSelection.None));
Reporter.UserMsgsPool.Add(eUserMsgKey.ExportItemToALMFailed, new UserMsg(eUserMsgType.ERROR, "Export to ALM Failed", "The {0} '{1}' failed to be exported to ALM." + Environment.NewLine + Environment.NewLine + "Error Details: {2}", eUserMsgOption.OK, eUserMsgSelection.None));
Reporter.UserMsgsPool.Add(eUserMsgKey.ExportItemToALMFailed, new UserMsg(eUserMsgType.ERROR, "Export to ALM Failed", "The {0} ' {1}' failed to be exported to ALM." + Environment.NewLine + Environment.NewLine + "Error Details: {2}", eUserMsgOption.OK, eUserMsgSelection.None));
Reporter.UserMsgsPool.Add(eUserMsgKey.AskIfToSaveBFAfterExport, new UserMsg(eUserMsgType.QUESTION, "Save Links to QC/ALM Items", "The " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + " '{0}' must be saved for keeping the links to QC/ALM items." + Environment.NewLine + "To perform the save now?", eUserMsgOption.YesNo, eUserMsgSelection.No));
Reporter.UserMsgsPool.Add(eUserMsgKey.AskIfToLoadExternalFields, new UserMsg(eUserMsgType.QUESTION, "Load/Refresh ALM External Fields", "The activity will run in the background for several hours." + Environment.NewLine + "Please do not close Ginger until operation is complete." + Environment.NewLine + "Would you like to continue?", eUserMsgOption.YesNo, eUserMsgSelection.No));

Expand Down
20 changes: 18 additions & 2 deletions Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,15 @@ public bool ExportBusinessFlowsResultToALM(ObservableList<BusinessFlow> 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;
}
Expand All @@ -269,7 +277,15 @@ public bool ExportBusinessFlowsResultToALM(ObservableList<BusinessFlow> 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");
}
}
Expand Down

0 comments on commit d46b3ef

Please sign in to comment.