private void UpdateRepoBtn_Click(object sender, RoutedEventArgs e) { if (mItem != null) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, mItem)); } SetRepoLinkStatus(); }
private void AddAction() { if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null) { if (((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).AddActionWizardPage != null) { _pageGenericWin.Close(); string classname = ((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).AddActionWizardPage; Type t = Assembly.GetExecutingAssembly().GetType(classname); if (t == null) { throw new Exception("Action edit page not found - " + classname); } WizardBase wizard = (GingerWPF.WizardLib.WizardBase)Activator.CreateInstance(t); WizardWindow.ShowWizard(wizard); } else { Act aNew = null; if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null) { aNew = (Act)(((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).CreateCopy()); } else { Reporter.ToUser(eUserMsgKeys.NoItemWasSelected); return; } aNew.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper(); //adding the new act after the selected action in the grid //TODO: Add should be after the last, Insert should be in the middle... int selectedActIndex = -1; if (mActionsList.CurrentItem != null) { selectedActIndex = mActionsList.IndexOf((Act)mActionsList.CurrentItem); } mActionsList.Add(aNew); if (selectedActIndex >= 0) { mActionsList.Move(mActionsList.Count - 1, selectedActIndex + 1); } _pageGenericWin.Close(); //allowing to edit the action ActionEditPage actedit = new ActionEditPage(aNew); actedit.ShowAsWindow(); } } }
public bool ImportFeatureFile() { BusinessFlowsFolderTreeItem bfsFolder = new BusinessFlowsFolderTreeItem(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <BusinessFlow>(), eBusinessFlowsTreeViewMode.ReadOnly); if (WorkSpace.Instance.BetaFeatures.ImportGherkinFeatureWizrd) { WizardWindow.ShowWizard(new ImportGherkinFeatureWizard(bfsFolder, ImportGherkinFeatureFilePage.eImportGherkinFileContext.BusinessFlowFolder)); } return(true); }
private void ActionsConversionHandler(object sender, System.Windows.RoutedEventArgs e) { ObservableList <BusinessFlow> lst = new ObservableList <BusinessFlow>(); if (((ITreeViewItem)this).NodeObject().GetType().Equals(typeof(GingerCore.BusinessFlow))) { lst.Add((GingerCore.BusinessFlow)((ITreeViewItem)this).NodeObject()); } WizardWindow.ShowWizard(new ActionsConversionWizard(ActionsConversionWizard.eActionConversionType.MultipleBusinessFlow, new Context(), lst), 900, 700, true); }
public static void AddItemsToRepository(List <RepositoryItemBase> listSelectedRepoItems) { if (listSelectedRepoItems != null && listSelectedRepoItems.Count > 0) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(listSelectedRepoItems), 1200); } else { Reporter.ToUser(eUserMsgKeys.NoItemWasSelected); } }
public void AddItemsToRepository(Context context, List <RepositoryItemBase> listSelectedRepoItems) { if (listSelectedRepoItems != null && listSelectedRepoItems.Count > 0) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(context, listSelectedRepoItems)); } else { Reporter.ToUser(eUserMsgKey.NoItemWasSelected); } }
private void AddSelectedToSRHandler(object sender, RoutedEventArgs e) { List <RepositoryItemBase> list = new List <RepositoryItemBase>(); List <object> SelectedItemsList = ListView.List.SelectedItems.Cast <object>().ToList(); foreach (VariableBase var in SelectedItemsList) { list.Add(var); } WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, list)); }
private void ActionsConversionHandler(object sender, System.Windows.RoutedEventArgs e) { ObservableList <BusinessFlow> lst = new ObservableList <BusinessFlow>(); var items = ((Amdocs.Ginger.Repository.RepositoryFolder <GingerCore.BusinessFlow>)((ITreeViewItem)this).NodeObject()).GetFolderItemsRecursive(); foreach (var bf in items) { lst.Add(bf); } WizardWindow.ShowWizard(new ActionsConversionWizard(ActionsConversionWizard.eActionConversionType.MultipleBusinessFlow, new Context(), lst), 900, 700, true); }
public void AddAPIModelFromDocument(object sender, RoutedEventArgs e) { if (WorkSpace.Instance.Solution.ApplicationPlatforms.Where(p => p.Platform == ePlatformType.WebServices).Count() > 0) { mTreeView.Tree.ExpandTreeItem((ITreeViewItem)this); WizardWindow.ShowWizard(new AddAPIModelWizard(mAPIModelFolder), 1000); } else { Reporter.ToUser(eUserMsgKey.MissingTargetApplication, "Please Add at-least one Web Service platform based Target Application to continue adding API Models"); } }
/// <summary> /// This method is used to add the new table from excel file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddNewTableFromExcel(object sender, System.Windows.RoutedEventArgs e) { try { WizardWindow.ShowWizard(new ImportDataSourceFromExcelWizard(DSDetails)); mTreeView.Tree.RefresTreeNodeChildrens(this); // RefreshTreeItems(); } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, ex.StackTrace); } }
private void AddToRepository(object sender, RoutedEventArgs e) { List <RepositoryItemBase> list = grdVariables.Grid.SelectedItems.Cast <RepositoryItemBase>().ToList(); if (list != null && list.Count > 0) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, list)); } else { Reporter.ToUser(eUserMsgKey.NoItemWasSelected); } }
//Gherkin BDD functions private void ImportGherkinFeatureFile(object sender, RoutedEventArgs e) { ImportGherkinFeatureWizard mWizard = new ImportGherkinFeatureWizard(this, ImportGherkinFeatureFilePage.eImportGherkinFileContext.DocumentsFolder); mWizard.mFolder = this.Path; WizardWindow.ShowWizard(mWizard); if (!String.IsNullOrEmpty(mWizard.FetaureFileName)) { mTreeView.Tree.RefreshSelectedTreeNodeChildrens(); mTreeView.Tree.GetChildItembyNameandSelect(System.IO.Path.GetFileName(mWizard.FetaureFileName), mTreeView.Tree.CurrentSelectedTreeViewItem); } }
private void ImportGherkinFeature(object sender, RoutedEventArgs e) { ImportGherkinFeatureWizard mWizard = new ImportGherkinFeatureWizard(this, ImportGherkinFeatureFilePage.eImportGherkinFileContext.BusinessFlowFolder); WizardWindow.ShowWizard(mWizard); if (mWizard.BizFlow != null) { //Select Business Folder mTreeView.Tree.SelectItem(this); mTreeView.Tree.RefreshSelectedTreeNodeChildrens(); mTreeView.Tree.GetChildItembyNameandSelect(mWizard.BizFlow.Name, this); } }
private void AddToSRHandler(object sender, RoutedEventArgs e) { SetItem(sender); //get target application for the action if (mAction is ActWithoutDriver) { mAction.Platform = ePlatformType.NA; } else { mAction.Platform = (from x in WorkSpace.Instance.Solution.ApplicationPlatforms where x.AppName == mContext.Activity.TargetApplication select x.Platform).FirstOrDefault(); } WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, mAction)); }
internal void AddPOM(object sender, RoutedEventArgs e) { List <ApplicationPlatform> TargetApplications = WorkSpace.Instance.Solution.GetListOfPomSupportedPlatform(); if (TargetApplications.Count != 0) { mTreeView.Tree.ExpandTreeItem((ITreeViewItem)this); WizardWindow.ShowWizard(new AddPOMWizard(mPOMModelFolder), 1000, 700, DoNotShowAsDialog: true); } else { Reporter.ToUser(eUserMsgKey.MissingTargetApplication, "Please Add at-least one Target Application that supports POM to continue adding Page Object Models"); } }
public bool ImportFeatureFile() { ImportGherkinFeatureFilePage IFP = null; string Folder = App.UserProfile.Solution.Folder + @"\BusinessFlows"; if (WorkSpace.Instance.BetaFeatures.ImportGherkinFeatureWizrd) { WizardWindow.ShowWizard(new ImportGherkinFeatureWizard(Folder)); } else { IFP = new ImportGherkinFeatureFilePage(Folder, ImportGherkinFeatureFilePage.eImportGherkinFileContext.BusinessFlowFolder); IFP.ShowAsWindow(); } return(IFP.Imported); }
private void ReLearnClicked(object sender, RoutedEventArgs e) { if (mWinExplorer == null) { Reporter.ToUser(eUserMsgKey.POMAgentIsNotRunning); return; } if (((AgentOperations)mAgent.AgentOperations).Driver.IsDriverBusy) { Reporter.ToUser(eUserMsgKey.POMDriverIsBusy); return; } WizardWindow.ShowWizard(new PomDeltaWizard(mPOM, mAgent), 1600, 800, true); }
private void AddSelectedToSRHandler(object sender, RoutedEventArgs e) { List <RepositoryItemBase> list = new List <RepositoryItemBase>(); List <object> SelectedItemsList = ListView.List.SelectedItems.Cast <object>().ToList(); foreach (Act act in SelectedItemsList) { list.Add(act); //get target application for the action if (mAction is ActWithoutDriver) { mAction.Platform = ePlatformType.NA; } else { mAction.Platform = (from x in WorkSpace.Instance.Solution.ApplicationPlatforms where x.AppName == mContext.Activity.TargetApplication select x.Platform).FirstOrDefault(); } } WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, list)); }
private void grdVariables_ItemDropped(object sender, EventArgs e) { VariableBase dragedItem = (VariableBase)((DragInfo)sender).Data; if (dragedItem != null) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, dragedItem)); //refresh and select the item try { VariableBase dragedItemInGrid = ((IEnumerable <VariableBase>)xVariablesGrid.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault(); if (dragedItemInGrid != null) { xVariablesGrid.Grid.SelectedItem = dragedItemInGrid; } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}", ex); } } }
private void grdActivitiesRepository_ItemDropped(object sender, EventArgs e) { Activity dragedItem = (Activity)((DragInfo)sender).Data; if (dragedItem != null) { ////check if the Activity is part of a group which not exist in Activity repository WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, dragedItem)); //refresh and select the item try { Activity dragedItemInGrid = ((IEnumerable <Activity>)xActivitiesRepositoryListView.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault(); if (dragedItemInGrid != null) { xActivitiesRepositoryListView.List.SelectedItem = dragedItemInGrid; } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}", ex); } } }
WizardPOM ShowMyWizard(string folder, double width = 0) { Task.Factory.StartNew(() => { mGingerAutomator.MainWindowPOM.Execute(() => { MyWizard wiz = new MyWizard(folder); if (width == 0) { WizardWindow.ShowWizard(wiz); } else { WizardWindow.ShowWizard(wiz, width); } }); }); WizardPOM wizardPOM = WizardPOM.CurrentWizard; return(wizardPOM); }
private void grdActions_ItemDropped(object sender, EventArgs e) { Act dragedItem = (Act)((DragInfo)sender).Data; if (dragedItem != null) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, dragedItem)); //refresh and select the item try { xActionListView.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Act>(); Act dragedItemInGrid = ((IEnumerable <Act>)xActionListView.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault(); if (dragedItemInGrid != null) { xActionListView.List.SelectedItem = dragedItemInGrid; } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}", ex); } } }
private void ImportGherkinFeature(object sender, RoutedEventArgs e) { BusinessFlow BF = null; if (WorkSpace.Instance.BetaFeatures.ImportGherkinFeatureWizrd) { WizardWindow.ShowWizard(new ImportGherkinFeatureWizard(mBusFlowsFolder.FolderFullPath)); } else { // TODO: check test me string FeatureFolder = mBusFlowsFolder.FolderFullPath; if (!mBusFlowsFolder.FolderFullPath.EndsWith("BusinessFlows")) { FeatureFolder = mBusFlowsFolder.FolderFullPath.Substring(mBusFlowsFolder.FolderFullPath.IndexOf("BusinessFlows\\") + 14); } ImportGherkinFeatureFilePage IFP = new ImportGherkinFeatureFilePage(FeatureFolder, ImportGherkinFeatureFilePage.eImportGherkinFileContext.BusinessFlowFolder); IFP.ShowAsWindow(); BF = IFP.BizFlow; if (BF != null) { //Refresh and select Faetures Folder DocumentsFolderTreeItem DFTI = (DocumentsFolderTreeItem)mTreeView.Tree.GetChildItembyNameandSelect("Documents"); DFTI = (DocumentsFolderTreeItem)mTreeView.Tree.GetChildItembyNameandSelect("Features", DFTI); if (mBusFlowsFolder.FolderFullPath != "Business Flows") { mTreeView.Tree.GetChildItembyNameandSelect(mBusFlowsFolder.FolderFullPath, DFTI); } mTreeView.Tree.RefreshSelectedTreeNodeChildrens(); //Select Business Folder mTreeView.Tree.SelectItem(this); mTreeView.Tree.RefreshSelectedTreeNodeChildrens(); BusinessFlowTreeItem BFTI = new BusinessFlowTreeItem(BF); mTreeView.Tree.GetChildItembyNameandSelect(BF.Name, this); } } }
private void grdActivitiesGroupsRepository_ItemDropped(object sender, EventArgs e) { try { ActivitiesGroup dragedItem = null; if (((DragInfo)sender).Data is ActivitiesGroup) { dragedItem = (ActivitiesGroup)((DragInfo)sender).Data; } else if (((DragInfo)sender).Data is CollectionViewGroup) { dragedItem = mContext.BusinessFlow.ActivitiesGroups.Where(x => x.Name == ((DragInfo)sender).Header).FirstOrDefault(); } if (dragedItem != null) { //add the Group and it Activities to repository List <RepositoryItemBase> list = new List <RepositoryItemBase>(); list.Add(dragedItem); foreach (ActivityIdentifiers activityIdnt in dragedItem.ActivitiesIdentifiers) { list.Add(activityIdnt.IdentifiedActivity); } WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, list)); //refresh and select the item ActivitiesGroup dragedItemInGrid = ((IEnumerable <ActivitiesGroup>)xActivitiesGroupsRepositoryListView.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault(); if (dragedItemInGrid != null) { xActivitiesGroupsRepositoryListView.List.SelectedItem = dragedItemInGrid; } } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Failed to drop " + GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroups) + " into Shared Repository", ex); } }
private void ReLearnClicked(object sender, RoutedEventArgs e) { if (WorkSpace.Instance.Solution.GetTargetApplicationPlatform(mPOM.TargetApplicationKey) == GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Java) { Reporter.ToUser(eUserMsgKey.MissingImplementationForPlatform, "Java"); return; } if (mWinExplorer == null) { Reporter.ToUser(eUserMsgKey.POMAgentIsNotRunning); return; } if (mAgent.Driver.IsDriverBusy) { Reporter.ToUser(eUserMsgKey.POMDriverIsBusy); return; } WizardWindow.ShowWizard(new PomDeltaWizard(mPOM, mAgent), 1600, 800, true); }
internal async Task <bool> MapBusinessFlowToALM(BusinessFlow businessFlow, bool performSaveAfterExport = false) { Reporter.ToLog(eLogLevel.INFO, "Mapping " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + ": " + businessFlow.Name + " to ALM"); //Passing Solution Folder path to GingerCore ALMCore.SolutionFolder = WorkSpace.Instance.Solution.Folder.ToUpper(); bool isMapSucc = false; try { Reporter.ToStatus(eStatusMsgKey.ALMTestSetMap); bool isConnected = false; await Task.Run(() => { isConnected = AutoALMProjectConnect(eALMConnectType.Auto); }); if (isConnected) { if (GetALMType().Equals(eALMType.ZephyrEnterprise)) { WizardWindow.ShowWizard(new MapToALMWizard.AddMapToALMWizard(businessFlow), 1200); isMapSucc = true; DisconnectALMServer(); } else { Reporter.ToUser(eUserMsgKey.StaticWarnMessage, $"'Map To ALM' - not Supporting {GetALMType()}."); } } } finally { Reporter.HideStatusMessage(); } return(isMapSucc); }
private void LinkStatusImageBtn_Click(object sender, RoutedEventArgs e) { if (mLinkedRepoItem != null) { if (mLinkIsByParentID || mLinkIsByExternalID) { if (Reporter.ToUser(eUserMsgKey.AskIfSureWantToDeLink) == Amdocs.Ginger.Common.eUserMsgSelection.Yes) { mItem.ParentGuid = Guid.Empty; mItem.ExternalID = string.Empty; mItem.IsSharedRepositoryInstance = false; SetRepoLinkStatus(); } } } else { if (mItem != null) { WizardWindow.ShowWizard(new UploadItemToRepositoryWizard(mContext, mItem)); } SetRepoLinkStatus(); } }
private void ImportOptionalValuesForGlobalParameters(object sender, RoutedEventArgs e) { WizardWindow.ShowWizard(new AddModelOptionalValuesWizard(mModelsGlobalParamsList)); xModelsGlobalParamsGrid.DataSourceList = mModelsGlobalParamsList; }
private void AddDBModel(object sender, RoutedEventArgs e) { WizardWindow.ShowWizard(new AddDBModelWizard(this.Path)); }
/// <summary> /// Generates relevant Action and adds to the current/selected Activity /// </summary> /// <param name="mItem"> of type object and would successfully add an action with Act/ElementInfo/ApplicationModels type object is provided</param> /// <param name="mContext"> required to identify the currently selected Activity, Action is to be added to </param> public static int AddActionsHandler(object mItem, Context mContext, int targetIndex = -1) { Act instance = null; if (mContext.Activity != null) { mContext.BusinessFlow.CurrentActivity = mContext.Activity;//so new Actions will be added to correct Activity } if (mItem is Act) { Act selectedAction = mItem as Act; instance = GenerateSelectedAction(selectedAction, mContext); } else if (mItem is ElementInfo) { ElementInfo elementInfo = mItem as ElementInfo; instance = GeneratePOMElementRelatedAction(elementInfo, mContext); } else if (mItem is ApplicationPOMModel) { ApplicationPOMModel currentPOM = mItem as ApplicationPOMModel; //required to show all the actions added as selected int updatedTargetIndex = targetIndex; foreach (ElementInfo elemInfo in currentPOM.MappedUIElements) { instance = GeneratePOMElementRelatedAction(elemInfo, mContext); if (instance != null) { instance.Active = true; if (updatedTargetIndex > -1) { mContext.Activity.Acts.Insert(updatedTargetIndex, instance); updatedTargetIndex++; } else { mContext.BusinessFlow.AddAct(instance, true); } } } mContext.Activity.Acts.CurrentItem = instance; instance = null; targetIndex = updatedTargetIndex; } else if (mItem is ApplicationAPIModel || mItem is RepositoryFolder <ApplicationAPIModel> ) { ObservableList <ApplicationAPIModel> apiModelsList = new ObservableList <ApplicationAPIModel>(); if (mItem is RepositoryFolder <ApplicationAPIModel> ) { apiModelsList = (mItem as RepositoryFolder <ApplicationAPIModel>).GetFolderItems(); apiModelsList = new ObservableList <ApplicationAPIModel>(apiModelsList.Where(a => a.TargetApplicationKey != null && Convert.ToString(a.TargetApplicationKey.ItemName) == mContext.Target.ItemName)); } else { apiModelsList.Add(mItem as ApplicationAPIModel); } AddApiModelActionWizardPage APIModelWizPage = new AddApiModelActionWizardPage(mContext, apiModelsList); WizardWindow.ShowWizard(APIModelWizPage); } if (instance != null) { instance.Active = true; if (targetIndex > -1) { mContext.Activity.Acts.Insert(targetIndex, instance); } else { mContext.BusinessFlow.AddAct(instance, true); } mContext.Activity.Acts.CurrentItem = instance; } return(targetIndex); }