Пример #1
0
        public int ClickOnUndoBtn()
        {
            Execute(() =>
            {
                Frame f1 = (Frame)mMainWindow.FindName("xMainWindowFrame");
                BusinessFlowsAutomatePage page1 = (BusinessFlowsAutomatePage)f1.Content;
                Frame f2 = (Frame)page1.FindName("xContentFrame");
                NewAutomatePage page2 = (NewAutomatePage)f2.Content;

                var elByName = FindElementByName(page2, "xUndoChangesBtn");

                if (elByName != null)
                {
                    if (elByName is Amdocs.Ginger.UserControls.ucButton)
                    {
                        Dispatcher.Invoke(() =>
                        {
                            (elByName as Amdocs.Ginger.UserControls.ucButton).DoClick();
                            SleepWithDoEvents(100);
                        });
                    }
                }

                Frame f3 = (Frame)page2.FindName("xActivitiesListFrame");
                ActivitiesListViewPage activitiesListPage = (ActivitiesListViewPage)f3.Content;

                ActivityCount = activitiesListPage.ListView.DataSourceList.Count;
            });

            return(ActivityCount);
        }
Пример #2
0
        public void AddActivityToLIstView()
        {
            Execute(() =>
            {
                Frame f1 = (Frame)mMainWindow.FindName("xMainWindowFrame");
                BusinessFlowsAutomatePage page1 = (BusinessFlowsAutomatePage)f1.Content;
                Frame f2 = (Frame)page1.FindName("xContentFrame");
                NewAutomatePage page2 = (NewAutomatePage)f2.Content;
                Frame f3 = (Frame)page2.FindName("xActivitiesListFrame");
                ActivitiesListViewPage activitiesListPage = (ActivitiesListViewPage)f3.Content;
                Activity activity2     = new Activity();
                activity2.ActivityName = "Test Activity";
                Dispatcher.Invoke(() =>
                {
                    activitiesListPage.ListView.DataSourceList.Add(activity2);
                    SleepWithDoEvents(100);
                });

                ClickOnBackToBFTreeBtn();
            });
        }
Пример #3
0
        //private void SelectMenu(string automationID)
        //{
        //    Execute(() => {
        //        Menu rc = (Menu)mMainWindow.FindName("MainRibbon");
        //        foreach (RibbonTab RT in rc.Items)
        //        {
        //            if (AutomationProperties.GetAutomationId(RT) == automationID)
        //            {
        //                //mimic user click
        //                //MouseEventArgs - not working...
        //                //MouseDevice mouse = InputManager.Current.PrimaryMouseDevice;
        //                //MouseButtonEventArgs arg = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left);
        //                //arg.RoutedEvent = RibbonTab.PreviewMouseLeftButtonDownEvent;
        //                //RT.RaiseEvent(arg);

        //                // for now use direct change of the tab
        //                rc.SelectedItem = RT;

        //                SleepWithDoEvents(100);

        //                //while (!rc.IsVisible)
        //                //{
        //                //    Thread.Sleep(100);
        //                //}
        //                return;
        //            }
        //        }
        //        throw new Exception("SelectRibbonTab element not found by AutomationID: " + automationID);
        //    });
        //}


        //private void SelectRibbonTab(string automationID)
        //{
        //    Execute(() => {
        //        Ribbon rc = (Ribbon)mMainWindow.FindName("MainRibbon");
        //        foreach (RibbonTab RT in rc.Items)
        //        {
        //            if (AutomationProperties.GetAutomationId(RT) == automationID)
        //            {
        //                //mimic user click
        //                //MouseEventArgs - not working...
        //                //MouseDevice mouse = InputManager.Current.PrimaryMouseDevice;
        //                //MouseButtonEventArgs arg = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left);
        //                //arg.RoutedEvent = RibbonTab.PreviewMouseLeftButtonDownEvent;
        //                //RT.RaiseEvent(arg);

        //                // for now use direct change of the tab
        //                rc.SelectedItem = RT;

        //                SleepWithDoEvents(100);

        //                //while (!rc.IsVisible)
        //                //{
        //                //    Thread.Sleep(100);
        //                //}
        //                return;
        //            }
        //        }
        //        throw new Exception("SelectRibbonTab element not found by AutomationID: " + automationID);
        //    });
        //}

        public BusinessFlowPOM SelectBusinessFlow()
        {
            businessFlow = null;
            Execute(() =>
            {
                ClickBusinessFlowRibbon();
                Frame f = (Frame)mMainWindow.FindName("xMainWindowFrame");
                BusinessFlowsAutomatePage resourcesPage = (BusinessFlowsAutomatePage)f.Content;
                Frame f2 = (Frame)resourcesPage.FindName("xContentFrame");
                SingleItemTreeViewExplorerPage singleItemTreePage = (SingleItemTreeViewExplorerPage)f2.Content;

                TreeView1 lv = (TreeView1)singleItemTreePage.FindName("xTreeView");

                while (!singleItemTreePage.IsVisible)
                {
                    SleepWithDoEvents(100);
                }

                businessFlow = new BusinessFlowPOM(singleItemTreePage);
            });

            return(businessFlow);
        }
Пример #4
0
        public void ClickOnBackToBFTreeBtn()
        {
            Execute(() =>
            {
                Frame f1 = (Frame)mMainWindow.FindName("xMainWindowFrame");
                BusinessFlowsAutomatePage page1 = (BusinessFlowsAutomatePage)f1.Content;
                Frame f2 = (Frame)page1.FindName("xContentFrame");
                NewAutomatePage page2 = (NewAutomatePage)f2.Content;

                var elByName = FindElementByName(page2, "xGoToBFsTreeBtn");

                if (elByName != null)
                {
                    if (elByName is Amdocs.Ginger.UserControls.ucButton)
                    {
                        Dispatcher.Invoke(() =>
                        {
                            (elByName as Amdocs.Ginger.UserControls.ucButton).DoClick();
                            SleepWithDoEvents(100);
                        });
                    }
                }
            });
        }