Skip to content

Commit

Permalink
Merge branch 'master' into Feature/OtomaBackup
Browse files Browse the repository at this point in the history
  • Loading branch information
Maheshkale447 committed Sep 5, 2023
2 parents cf8129a + 60c7f19 commit ff43e27
Show file tree
Hide file tree
Showing 70 changed files with 1,870 additions and 1,166 deletions.
12 changes: 10 additions & 2 deletions Ginger/Ginger/ALM/MapToALMWizard/AddMapToALMWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,17 @@ private async Task SetSelectedALMTestSetData(dynamic SelectedTestSetData)
}
AlmTestSetData = await Task.Run(() =>
{
return ALMIntegration.Instance.GetALMTestCases(AlmTestSetData);
try
{
return ALMIntegration.Instance.GetALMTestCases(AlmTestSetData);
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, $"Failed Get ALM Test cases ", ex);
return null;
}
});
foreach (ALMTSTest testCase in AlmTestSetData.Tests)
foreach (ALMTSTest testCase in AlmTestSetData?.Tests)
{
testCasesUnMappedList.Add(testCase);
}
Expand Down
13 changes: 12 additions & 1 deletion Ginger/Ginger/ALM/MapToALMWizard/TestSetMappingPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,17 @@ private async Task LoadInitialMappedTestSetData()
if (!String.IsNullOrEmpty(mWizard.mapBusinessFlow.ExternalID) && String.IsNullOrEmpty(mWizard.AlmTestSetData.TestSetID))
{
mWizard.AddActivitiesGroupsInitialMapping();
await Task.Run(() => mWizard.SetMappedALMTestSetData()).ConfigureAwait(true);
await Task.Run(() =>
{
try
{
mWizard.SetMappedALMTestSetData();
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, $"Failed Set Mapped ALM Test Set data",ex);
}
}).ConfigureAwait(true);
ChangeTestSetPageVisibility();
mWizard.UpdateMappedTestCasesCollections();
mWizard.RemapTestCasesLists();
Expand Down Expand Up @@ -174,6 +184,7 @@ private Page GetALMTree()
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, $"Failed get ALM Tree, {System.Reflection.MethodBase.GetCurrentMethod().Name}: {ex.Message}");
Reporter.ToLog(eLogLevel.DEBUG, $"Failed get ALM Tree, {System.Reflection.MethodBase.GetCurrentMethod().Name}: {ex}");
}
return win;
}
Expand Down
4 changes: 2 additions & 2 deletions Ginger/Ginger/ALM/MapToALMWizard/TestStepMappingPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void UnmapAllRows(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.DEBUG, ex.Message);
Reporter.ToLog(eLogLevel.DEBUG,ex.Message, ex);
}
}

Expand Down Expand Up @@ -328,7 +328,7 @@ private void UnMapSelectedElementRowsHandler(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.DEBUG, ex.Message);
Reporter.ToLog(eLogLevel.DEBUG, ex.Message, ex);
}
}
#endregion
Expand Down
2 changes: 1 addition & 1 deletion Ginger/Ginger/ALM/Repository/RQMRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public override bool ImportSelectedTests(string importDestinationPath, IEnumerab
}
catch (Exception ex)
{
Reporter.ToUser(eUserMsgKey.ErrorInTestsetImport, testPlan.Name, ex.Message);
Reporter.ToUser(eUserMsgKey.ErrorInTestsetImport, testPlan.Name, ex);
}

Reporter.ToUser(eUserMsgKey.TestSetsImportedSuccessfully);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ public async Task BusinessFlowsActionsConversion(ObservableList<BusinessFlowToCo
mConversionUtils.ActUIElementClassName = nameof(ActUIElement);
mConversionUtils.ListOfBusinessFlowsToConvert = lst;

await Task.Run(() => mConversionUtils.ConvertActionsOfMultipleBusinessFlows(ActionToBeConverted, NewActivityChecked, ConvertableTargetApplications, ConvertToPOMAction, SelectedPOMs)).ConfigureAwait(true);
await Task.Run(() =>
mConversionUtils.ConvertActionsOfMultipleBusinessFlows(ActionToBeConverted, NewActivityChecked, ConvertableTargetApplications, ConvertToPOMAction, SelectedPOMs)

).ConfigureAwait(true);

if (ConversionType == eActionConversionType.MultipleBusinessFlow)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,29 +224,36 @@ private async void SaveButtonClicked(object sender, RoutedEventArgs e)

await Task.Run(() =>
{
foreach (BusinessFlowToConvert bf in xBusinessFlowGrid.DataSourceList)
try
{
try
foreach (BusinessFlowToConvert bf in xBusinessFlowGrid.DataSourceList)
{
if (bf.IsSelected && bf.SaveStatus != eConversionSaveStatus.NA)
try
{
if (bf.ConvertedActionsCount > 0)
{
bf.SaveStatus = eConversionSaveStatus.Saving;
WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(bf.BusinessFlow);
bf.SaveStatus = eConversionSaveStatus.Saved;
}
else
if (bf.IsSelected && bf.SaveStatus != eConversionSaveStatus.NA)
{
bf.SaveStatus = eConversionSaveStatus.NA;
if (bf.ConvertedActionsCount > 0)
{
bf.SaveStatus = eConversionSaveStatus.Saving;
WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(bf.BusinessFlow);
bf.SaveStatus = eConversionSaveStatus.Saved;
}
else
{
bf.SaveStatus = eConversionSaveStatus.NA;
}
}
}
catch (Exception ex)
{
bf.SaveStatus = eConversionSaveStatus.Failed;
Reporter.ToLog(eLogLevel.ERROR, "Error occurred while trying to Save - ", ex);
}
}
catch (Exception ex)
{
bf.SaveStatus = eConversionSaveStatus.Failed;
Reporter.ToLog(eLogLevel.ERROR, "Error occurred while trying to Save - ", ex);
}
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, "Error occurred while Conversion ", ex);
}
});

Expand Down
37 changes: 23 additions & 14 deletions Ginger/Ginger/Actions/ActionEditPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void Init(Act act, General.eRIPageViewMode editMode = General.eRIPageView

public void Clear()
{
if(mAction != null)
if (mAction != null)
{
string allProperties = string.Empty;
PropertyChangedEventManager.RemoveHandler(source: mAction, handler: ActionPropertyChanged, propertyName: allProperties);
Expand Down Expand Up @@ -250,7 +250,7 @@ public void Clear()
mColNames = null!;
xOutputValuesGrid.DataSourceList = new ObservableList<ActReturnValue>();
mStoreToVarsList.Clear();

mActParentBusinessFlow = null!;
mActParentActivity = null!;
mSimulateRunBtn = new Button();
Expand Down Expand Up @@ -471,7 +471,7 @@ private void InitOutputValuesTabView()
{
xDataSourceConfigGrid.Visibility = Visibility.Collapsed;
}

mDSList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<DataSourceBase>();
if (mDSList.Count == 0)
{
Expand Down Expand Up @@ -764,6 +764,11 @@ private void SwitchingInputValueBoxAndGrid(Act a)
xValueVE.ValueTextBox.Text = a.InputValues.FirstOrDefault().Value;
xValueLbl.Content = a.InputValues.FirstOrDefault().Param;
}
else
{
xInputValuesGrid.Visibility = Visibility.Collapsed;
xValueBoxPnl.Visibility = Visibility.Collapsed;
}
}
else if (a.GetType() == typeof(ActConsoleCommand))//TODO: Fix Action implementation to not base on the Action edit page Input values controls- to have it own controls
{
Expand All @@ -786,7 +791,7 @@ private void SwitchingInputValueBoxAndGrid(Act a)
xValueBoxPnl.Visibility = Visibility.Collapsed;
}
}
else if(a.GetType() == typeof(ActCompareImgs))
else if (a.GetType() == typeof(ActCompareImgs))
{
xInputValuesGrid.Visibility = Visibility.Collapsed;
xValueBoxPnl.Visibility = Visibility.Collapsed;
Expand All @@ -798,18 +803,17 @@ private void SwitchingInputValueBoxAndGrid(Act a)
{
xInputValuesGrid.Visibility = Visibility.Collapsed;
xValueBoxPnl.Visibility = Visibility.Visible;
if (!a.InputValues.Any(x => x.Param == "Value"))
{
a.AddOrUpdateInputParamValue("Value", "");
}
ActInputValue inputValue = a.InputValues.FirstOrDefault(x => x.Param == "Value");
xValueVE.Init(mContext, inputValue, nameof(ActInputValue.Value));
if (inputValue != null)
{
xValueVE.ValueTextBox.Text = inputValue.Value;
xValueLbl.Content = inputValue.Param;
}
else
{
a.AddOrUpdateInputParamValue("Value", "");
}
xValueVE.Init(mContext, inputValue, nameof(ActInputValue.Value));

}
}

Expand Down Expand Up @@ -931,7 +935,7 @@ private void SetActReturnValuesGrid()
xOutputValuesGrid.btnRefresh.AddHandler(Button.ClickEvent, new RoutedEventHandler(RefreshOutputValuesGridElements));
xOutputValuesGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddReturnValue));

if(!outputValuesGridToolbarItemsAdded)
if (!outputValuesGridToolbarItemsAdded)
{
outputValuesGridToolbarItemsAdded = true;
xOutputValuesGrid.AddSeparator();
Expand Down Expand Up @@ -1587,7 +1591,7 @@ public class ActReturnValueStatusConverter : IValueConverter
public object Convert(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
string status = value == null ? "": value.ToString();
string status = value == null ? "" : value.ToString();
if (status.Equals(ActReturnValue.eStatus.Passed.ToString()))
{
return System.Windows.Media.Brushes.Green;//System.Drawing.Brushes.Green;
Expand Down Expand Up @@ -1976,13 +1980,16 @@ private void EnableActionLogConfigCheckBox_Checked(object sender, RoutedEventArg

private void EnableActionLogConfigCheckBox_UnChecked(object sender, RoutedEventArgs e)
{
mAction.EnableActionLogConfig = false;
if (mAction != null)
{
mAction.EnableActionLogConfig = false;
}
ResetActionLog();
}

private void ResetActionLog()
{
if (mAction.EnableActionLogConfig)
if (mAction != null && mAction.EnableActionLogConfig)
{
ShowActionLogConfig();
}
Expand Down Expand Up @@ -2025,6 +2032,8 @@ public void ClearPageBindings()
BindingOperations.ClearAllBindings(xdsOutputParamMapType);
BindingOperations.ClearAllBindings(xEnableActionLogConfigCheckBox);
BindingOperations.ClearAllBindings(xLocateValueVE);
xValueVE.ClearControlsBindings();
BindingOperations.ClearAllBindings(xValueVE);

BindingOperations.ClearAllBindings(xRawResponseValuesBtn);
xTagsViewer.ClearBinding();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void ScriptNameComboBox_SelectionChanged(object sender, SelectionChanged
parseScriptHeader(script);
}

if (actScript.InputValues.Count == 0)
if (actScript.InputValues.Count == 0 && ScriptInterpreterComboBox.SelectedValue.ToString() != ActScript.eScriptInterpreterType.VBS.ToString())
{
actScript.AddInputValueParam("Value");
}
Expand Down
26 changes: 24 additions & 2 deletions Ginger/Ginger/Actions/ActionEditPages/ValidationDBPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public ValidationDBPage(ActDBValidation act)
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(TablesComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.Table);
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(KeySpaceComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.Keyspace);
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ColumnComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.Column);
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtWhere, TextBox.TextProperty, act, ActDBValidation.Fields.Where);

GingerCore.GeneralLib.BindingHandler.ActInputValueBinding(CommitDB, CheckBox.IsCheckedProperty, mAct.GetOrCreateInputParam(ActDBValidation.Fields.CommitDB));

txtInsertJson.ValueTextBox.Text = string.Empty;
Expand All @@ -116,6 +116,7 @@ public ValidationDBPage(ActDBValidation act)
ComboAutoSelectIfOneItemOnly(ColumnComboBox);
SetVisibleControlsForAction();
SetQueryParamsGrid();
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtWhere, TextBox.TextProperty, act, ActDBValidation.Fields.Where);
}

private async void ValueTextBox_TextChanged(object sender, TextChangedEventArgs e)
Expand Down Expand Up @@ -376,6 +377,14 @@ private async void TablesComboBox_DropDownOpened(object sender, EventArgs e)
Reporter.ToStatus(eStatusMsgKey.StaticStatusProcess, null, "Loading Tables...");
TablesComboBox.Items.Clear();
string DBName = DBNameComboBox.Text;
if (EA == null)
{
EA = pe.Applications.FirstOrDefault(a => string.Equals(a.Name, AppNameComboBox.Text));
}
if (EA == null)
{
return;
}
db = (Database)EA.Dbs.FirstOrDefault(db => string.Equals(db.Name, DBName));
if (db == null)
{
Expand Down Expand Up @@ -423,6 +432,14 @@ private void ColumnComboBox_DropDownOpened(object sender, EventArgs e)
{
ColumnComboBox.Items.Clear();
string DBName = DBNameComboBox.Text;
if (EA == null)
{
EA = pe.Applications.FirstOrDefault(a => string.Equals(a.Name, AppNameComboBox.Text));
}
if (EA == null)
{
return;
}
db = (Database)(from d in EA.Dbs where d.Name == DBName select d).FirstOrDefault();
if (db == null)
{
Expand All @@ -438,7 +455,7 @@ private void ColumnComboBox_DropDownOpened(object sender, EventArgs e)
{
table = TablesComboBox.Text;
}
if(table != "")
if (table != "")
{
List<string> Columns = db.DatabaseOperations.GetTablesColumns(table);
if (Columns == null)
Expand Down Expand Up @@ -474,6 +491,7 @@ private void SetVisibleControlsForAction()
DoCommit.Visibility = Visibility.Collapsed;
Keyspace.Visibility = Visibility.Collapsed;
TableColWhereStackPanel.Visibility = Visibility.Collapsed;
txtWhere.Clear();
return;
}
if (pe != null)
Expand Down Expand Up @@ -508,6 +526,7 @@ private void SetVisibleControlsForAction()
RadioButtonsSection.Visibility = System.Windows.Visibility.Visible;
checkQueryType();
TableColWhereStackPanel.Visibility = System.Windows.Visibility.Collapsed;
txtWhere.Clear();
FreeSQLLabel.Content = "Update DB SQL:";
DoCommit.Visibility = Visibility.Visible;
Keyspace.Visibility = Visibility.Collapsed;
Expand Down Expand Up @@ -577,6 +596,7 @@ private void SetVisibleControlsForAction()
TableColWhereStackPanel.Visibility = System.Windows.Visibility.Collapsed;
FreeSQLLabel.Content = "Free SQL:";
Keyspace.Visibility = System.Windows.Visibility.Collapsed;
txtWhere.Clear();
break;
case ActDBValidation.eDBValidationType.SimpleSQLOneValue:
checkQueryType();
Expand Down Expand Up @@ -638,6 +658,7 @@ private void SetVisibleControlsForAction()
DoUpdate.Visibility = Visibility.Collapsed;
SqlFile.Visibility = System.Windows.Visibility.Collapsed;
FreeSQLLabel.Content = @"Record count";
txtWhere.Clear();
break;
case eDBValidationType.Insert:
DoUpdate.Visibility = Visibility.Visible;
Expand All @@ -654,6 +675,7 @@ private void SetVisibleControlsForAction()
TableColWhereStackPanel.Height = 40;
txtWhere.Visibility = Visibility.Collapsed;
lblWhere.Visibility = Visibility.Hidden;
txtWhere.Clear();
DoCommit.Visibility = Visibility.Collapsed;
FreeSQLStackPanel.Visibility = Visibility.Collapsed;
RadioButtonsSection.Visibility = Visibility.Collapsed;
Expand Down
12 changes: 11 additions & 1 deletion Ginger/Ginger/Activities/ActivitiesListViewPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,17 @@ private async void SetListViewData()
xActivitiesListView.AddGrouping(nameof(Activity.ActivitiesGroupID));

//shared repo indicator
await Task.Run(() => this.SetSharedRepositoryMark());
await Task.Run(() =>
{
try
{
this.SetSharedRepositoryMark();
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, "Error occurred during SetSharedRepositoryMark", ex);
}
});
}
else
{
Expand Down
1 change: 1 addition & 0 deletions Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public void ClearBindings()
BindingOperations.ClearAllBindings(xPublishcheckbox);
BindingOperations.ClearAllBindings(xHandlerTypeCombo);
BindingOperations.ClearAllBindings(xErrorHandlerMappingCmb);
BindingOperations.ClearAllBindings(xHandlerPostExecutionCombo);
}

private void BindControls()
Expand Down
Loading

0 comments on commit ff43e27

Please sign in to comment.