private ApplicationPOMModel CreatePOMOnWizard(string POMName, string POMDescription, string targetApp, Agent agent, string URL, List <eElementType> elementTypeCheckBoxToClickList, List <ElementLocator> prioritizedLocatorsList) { WizardPOM wizard = WizardPOM.CurrentWizard; wizard.NextButton.Click(); ucAgentControl ucAgentControl = (ucAgentControl)wizard.CurrentPage["ucAgentControl AID"].dependencyObject; ucAgentControlPOM ucAgentControlPOM = new ucAgentControlPOM(ucAgentControl); ucAgentControlPOM.SelectValueUCAgentControl(agent); ucAgentControlPOM.UCAgentControlStatusButtonClick(); SleepWithDoEvents(10000); //Process AutoMap Element Locators Grid ucGrid ucElementLocatorsGrid = (ucGrid)wizard.CurrentPage["AutoMapElementLocatorsGrid AID"].dependencyObject; ucGridPOM ucElementLocatorsGridPOM = new ucGridPOM(ucElementLocatorsGrid); int locatorIndex = 0; foreach (ElementLocator elemLocator in prioritizedLocatorsList) { if (!elemLocator.Active) { ucElementLocatorsGridPOM.ClickOnCheckBox(nameof(ElementLocator.Active), nameof(ElementLocator.LocateBy), elemLocator.LocateBy.ToString()); } ucElementLocatorsGridPOM.ReOrderGridRows(nameof(ElementLocator.LocateBy), elemLocator.LocateBy.ToString(), locatorIndex); locatorIndex++; } //Process AutoMap Element Types Grid ucGrid ucElementTypesGrid = (ucGrid)wizard.CurrentPage["AutoMapElementTypesGrid AID"].dependencyObject; ucGridPOM ucElementTypesGridPOM = new ucGridPOM(ucElementTypesGrid); foreach (eElementType elementType in elementTypeCheckBoxToClickList) { ucElementTypesGridPOM.ClickOnCheckBox(nameof(UIElementFilter.Selected), nameof(UIElementFilter.ElementType), elementType.ToString()); } string html = TestResources.GetTestResourcesFile(URL); agent.Driver.RunAction(new ActBrowserElement() { ControlAction = ActBrowserElement.eControlAction.GotoURL, ValueForDriver = html }); SleepWithDoEvents(2000); wizard.NextButton.Click(); while (agent.Driver.IsDriverBusy) { SleepWithDoEvents(20000); } wizard.NextButton.Click(); SleepWithDoEvents(2000); wizard.CurrentPage["Name POMID"].SetText(POMName); wizard.CurrentPage["Description POMID"].SetText(POMDescription); wizard.FinishButton.Click(); SleepWithDoEvents(2000); ApplicationPOMModel POM = (from x in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ApplicationPOMModel>() where x.Name == POMName select x).SingleOrDefault(); return(POM); }
private void SetActionsGridView(ucGrid actionsGrid) { GridViewDef view = new GridViewDef(GridViewDef.DefaultViewName); view.GridColsView = new ObservableList <GridColView>(); view.GridColsView.Add(new GridColView() { Field = Act.Fields.Description, Header = "Action Type", AllowSorting = true, WidthWeight = 4 }); if (actionsGrid == PlugInsActionsGrid) { view.GridColsView.Add(new GridColView() { Field = nameof(ActPlugIn.PluginId), Header = "Plugin ID", WidthWeight = 6, ReadOnly = true, BindingMode = BindingMode.OneWay }); view.GridColsView.Add(new GridColView() { Field = nameof(ActPlugIn.ServiceId), Header = "Service ID", WidthWeight = 6, ReadOnly = true, BindingMode = BindingMode.OneWay }); } else { view.GridColsView.Add(new GridColView() { Field = Act.Fields.SupportedPlatforms, Header = "Supported Platforms", WidthWeight = 6, ReadOnly = true }); } actionsGrid.SetAllColumnsDefaultView(view); actionsGrid.InitViewItems(); actionsGrid.grdMain.SelectionMode = DataGridSelectionMode.Single; actionsGrid.RowDoubleClick += ActionsGrid_MouseDoubleClick; }
public static void AddValidationRule(this ucGrid ucgrid, eValidationRule validationRule) { if (validationRule == eValidationRule.CannotBeEmpty) { AddValidation(ucgrid, ucGrid.RowsCountProperty, new GridValidationRule()); } //TODO: throw... }
private void SetActionsGridView(ucGrid actionsGrid) { //GridViewDef view = new GridViewDef(GridViewDef.DefaultViewName); //view.GridColsView = new ObservableList<GridColView>(); //view.GridColsView.Add(new GridColView() { Field = nameof(DriverAction.ID), Header = "ID", AllowSorting = true, WidthWeight = 4 }); //actionsGrid.SetAllColumnsDefaultView(view); //actionsGrid.InitViewItems(); //actionsGrid.grdMain.SelectionMode = DataGridSelectionMode.Single; //actionsGrid.RowDoubleClick += ActionsGrid_MouseDoubleClick; }
private Page AddVariable(string VariableDisplayName) { Task.Factory.StartNew(() => { Execute(() => { ucGrid grid = (ucGrid)FindElementByAutomationID <ucGrid>(mVariablesPage, "Variables Grid AID"); ucGridPOM gridPOM = new ucGridPOM(grid); gridPOM.EnhancedHeaderAddButton.Click(); }); }); Page addVaraiblePage = null; Stopwatch st = Stopwatch.StartNew(); while (addVaraiblePage == null && st.ElapsedMilliseconds < 10000) { SleepWithDoEvents(100); if (GenericWindow.CurrentWindow != null) { addVaraiblePage = CurrentGenericWindow.LoadedPage(); // return addVaraiblePage; Execute(() => { ucGrid ucGrid = (ucGrid)FindElementByAutomationID <ucGrid>(addVaraiblePage, "VariablesGrid AID"); ucGridPOM ucGridPOM = new ucGridPOM(ucGrid); ucGridPOM.GotoRow("VariableUIType", VariableDisplayName); }); Task.Factory.StartNew(() => { Execute(() => { CurrentGenericWindow.Buttons["Add Variable"].Click(); }); }); SleepWithDoEvents(100); Page p = null; Stopwatch st2 = Stopwatch.StartNew(); while (!(p is VariableEditPage) && st2.ElapsedMilliseconds < 10000) { SleepWithDoEvents(100); p = CurrentGenericWindow.LoadedPage(); return(p); } throw new Exception("timeout Error waiting for var edit page to load"); } } throw new Exception("timeout Error cannot find Add variable page"); }
private void xMapActivityGroupToTestCaseGrid_DragOver(object sender, DragEventArgs e) { ucGrid r = (ucGrid)sender; if (sender is ucGrid && (sender as ucGrid).Name == xMapActivityGroupToTestCaseGrid.Name) { var obj = DragDrop2.GetGridItemHit(xMapActivityGroupToTestCaseGrid); if (obj is ALMTestCaseManualMappingConfig && (obj as ALMTestCaseManualMappingConfig).activitiesGroup != null) { int selectedIndex = xMapActivityGroupToTestCaseGrid.DataSourceList.IndexOf((obj as ALMTestCaseManualMappingConfig)); xMapActivityGroupToTestCaseGrid.Drop -= xUnMapTestCaseGrid_ItemDropped; } } }
public void prikazeArtikleIzTabele() { ArtikalDAO artikalDAO = new ArtikalDAO(); ucGrid = new ucGrid(); DataTable table = artikalDAO.dajTabeluSaArtiklima(); ucGrid.ucitajGrid(table); ucGrid.Dock = DockStyle.Fill; ucTelo.Controls.Add(ucGrid); ucGrid.BringToFront(); List <Artikal> listaArt = artikalDAO.dajArtikle(); Console.WriteLine("Artikli:" + listaArt.Count); }
private void AddMultipleActions(object sender, RoutedEventArgs e) { if (ActionsTabs.SelectedContent != null) { ucGrid actionsGrid = ((ucGrid)ActionsTabs.SelectedContent); if (actionsGrid.Grid.SelectedItems != null && actionsGrid.Grid.SelectedItems.Count > 0) { foreach (Act selectedAct in actionsGrid.Grid.SelectedItems) { ActionsFactory.AddActionsHandler(selectedAct, mContext); } } else { Reporter.ToUser(eUserMsgKey.NoItemWasSelected); } } }
private void GroupActivitiesHandler(object sender, RoutedEventArgs e) { ucGrid senderGrid = sender as ucGrid; ObservableList <Amdocs.Ginger.Repository.RepositoryItemBase> selectedActivitiesList = null; if (senderGrid != null) { selectedActivitiesList = senderGrid.GetSelectedItems(); if (selectedActivitiesList != null && selectedActivitiesList.Count > 0) { foreach (Activity sharedActivity in selectedActivitiesList) { Activity newInstance = sharedActivity.CreateInstance(true) as Activity; mActivitiesGroup.AddActivityToGroup(newInstance); } } } }
public void CreateLocatorList(ucGrid LocatorsGrid, ObservableList <Act> Locators) { string[] lstMultiLocVals; lstMultiLocVals = Ginger.BusinessFlowWindows.EditLocatorsWindow.sMultiLocatorVals.Split('|'); if (lstMultiLocVals.Length >= 1) { if (lstMultiLocVals.Length == 1 && lstMultiLocVals[0].ToString() == "") { Locators.Add(new ActDummy() { LocateBy = eLocateBy.ByLocalizedControlType, LocateValue = "edit" }); } else { foreach (string s in lstMultiLocVals) { string[] ls = s.Split(':'); if (ls.Length > 0) { Locators.Add(new ActDummy() { LocateBy = getLocatorTypeByString(ls[0].ToString()), LocateValue = ls[1].ToString() }); } } } } if (Locators.Count == 0) { Locators.Add(new ActDummy() { LocateBy = eLocateBy.ByLocalizedControlType, LocateValue = "edit" }); } LocatorsGrid.DataSourceList = Locators; }
private void Init() { App.ObjFieldBinding(SolutionNameTextBox, TextBox.TextProperty, mSolution, Solution.Fields.Name); App.ObjFieldBinding(SolutionFolderTextBox, TextBox.TextProperty, mSolution, Solution.Fields.Folder); App.ObjFieldBinding(AccountTextBox, TextBox.TextProperty, mSolution, Solution.Fields.Account); ApplicationGrid = new ucGrid(); ApplicationGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddApplication)); ApplicationGrid.Grid.PreparingCellForEdit += ApplicationGrid_PreparingCellForEdit; ApplicationGrid.Grid.CellEditEnding += ApplicationGrid_CellEditEnding; SetAppsGridView(); ApplicationGrid.ShowTitle = System.Windows.Visibility.Collapsed; if (mSolution.ApplicationPlatforms == null) { mSolution.ApplicationPlatforms = new ObservableList <ApplicationPlatform>(); } ApplicationGrid.DataSourceList = mSolution.ApplicationPlatforms; ApplicationsFrame.Content = ApplicationGrid; VariablesPage varbsPage = new VariablesPage(eVariablesLevel.Solution); varbsPage.grdVariables.ShowTitle = System.Windows.Visibility.Collapsed; VariablesFrame.Content = varbsPage; infoImage.ToolTip = "The first application in the list of Target Application(s) is consider to be the Solution Main Application." + Environment.NewLine + "Application: The local name of the application to be automated i.e.: CRM, select the name you use to call this app and how it is known to all people in the project" + Environment.NewLine + "Core: The core product on which this application is built on i.e: Amdocs CRM, this name is used to search packages in the global repository" + Environment.NewLine + "Core Version: The version of the core product i.e.: for CRM we have v8 or v9"; SolutionTagsEditorPage p = new SolutionTagsEditorPage(mSolution.Tags); TagsFrame.Content = p; }
public ucGridPOM(ucGrid grid) { mGrid = grid; }
// ------------------------------------------------------------ // ucGrid // ------------------------------------------------------------ public static void AddValidationRule(this ucGrid ucgrid, ValidationRule validationRule) { AddValidation(ucgrid, ucGrid.RowsCountProperty, validationRule); }
// TODO Move to generic class. private int GetItemIndex(ucGrid itemGrid, object item) { return(itemGrid.DataSourceList.IndexOf(item)); }