Пример #1
0
        public void ClickSave()
        {
            var control = StudioWindow.GetChildren()[0].GetChildren()[2];

            control.WaitForControlEnabled();
            Mouse.Click(control, new Point(648, 501));
        }
Пример #2
0
        public void ClickHelpFeedback_Expected_FeedbackWindowOpens()
        {
            RibbonUIMap.ClickRibbonMenuItem("Feedback", 600);
            var dialogPrompt = StudioWindow.GetChildren()[0];

            if (dialogPrompt.GetType() != typeof(WpfWindow))
            {
                Assert.Fail("Error - Clicking the Feedback button does not create the Feedback Window");
            }

            KeyboardCommands.SendEnter();
            KeyboardCommands.SendEnter();

            // Wait for the init, then click around a bit

            // Click stop, then make sure the Feedback window has appeared.
            FeedbackUIMap.ClickStartStopRecordingButton();

            if (!FeedbackUIMap.DoesFeedbackWindowExist())
            {
                Assert.Fail("The Feedback window did not appear after the recording has been stopped.");
            }

            FeedbackUIMap.FeedbackWindow_ClickCancel();
        }
Пример #3
0
        public void ClickNewWebSource()
        {
            var control = StudioWindow.GetChildren()[0].GetChildren()[2];

            control.WaitForControlEnabled();
            Mouse.Click(control, new Point(410, 79));
        }
Пример #4
0
        public void ClickFourthAction()
        {
            var kids      = StudioWindow.GetChildren();
            var grandKids = kids[0].GetChildren();

            Mouse.Click(grandKids[2], new Point(172, 229));
        }
        private UITestControl GetLocalHostExplorerTree()
        {
            var SelectActivityDialog = StudioWindow.GetChildren()[0];

            foreach (var child in SelectActivityDialog.GetChildren())
            {
                var navViewAutoID = child.GetProperty("AutomationID").ToString();
                if (navViewAutoID.Contains("TheNavigationView"))
                {
                    foreach (var navigationViewChid in child.GetChildren())
                    {
                        var navAutoID = navigationViewChid.GetProperty("AutomationID").ToString();
                        if (navAutoID.Contains("Navigation"))
                        {
                            foreach (var navChild in navigationViewChid.GetChildren())
                            {
                                if (navChild.ControlType == ControlType.TreeItem)
                                {
                                    return(navChild);
                                }
                            }
                        }
                    }
                }
            }
            throw new UITestControlNotFoundException("Localhost explorer tree not found, Activity Drop Window may not have openned yet.");
        }
        /// <summary>
        /// ClickOK
        /// </summary>
        public void ClickDone(int waitAmt = 0)
        {
            Playback.Wait(waitAmt);
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            Mouse.Click(wizard, new Point(650, 450));
        }
Пример #7
0
        /// <summary>
        /// ClickFirstAction
        /// </summary>
        public void ClickFirstAction()
        {
            var control = StudioWindow.GetChildren()[0].GetChildren()[2];

            control.WaitForControlEnabled();
            Mouse.Click(control, new Point(172, 164));
        }
Пример #8
0
        /// <summary>
        /// ClickFirstAction
        /// </summary>
        public void ClickMappingTab(int x = 280)
        {
            UITestControl uIItemImage = StudioWindow.GetChildren()[0].GetChildren()[2];

            Playback.Wait(500);
            Mouse.Click(uIItemImage, new Point(x, 25));
        }
        /// <summary>
        /// Gets the first intellisense result
        /// </summary>
        public void GetFirstIntellisense(string startWith, bool deleteText = false, Point relativeToWizard = default(Point))
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            //prompt intellisense
            SendKeys.SendWait(startWith);

            //wait for intellisense to drop down
            Playback.Wait(500);

            if (relativeToWizard != default(Point))
            {
                Playback.Wait(1000);
                // nasty fixed sizing, but no other real choice to test what  I need to ;(
                Mouse.Click(new Point(wizard.Left + relativeToWizard.X, wizard.Top + relativeToWizard.Y));
            }
            else
            {
                Keyboard.SendKeys(wizard, "{DOWN}");
                Playback.Wait(250);
                Keyboard.SendKeys(wizard, "{ENTER}");
            }

            if (deleteText)
            {
                SendKeys.SendWait("^a");
                Playback.Wait(150);
                SendKeys.SendWait("^x");
                Playback.Wait(150);
            }
        }
Пример #10
0
        public bool TryWaitForWizard(int timeOut = 10000)
        {
            Playback.Wait(timeOut);
            var tryGetDialog = StudioWindow.GetChildren()[0].GetChildren()[2];
            var type         = tryGetDialog.GetType();

            return(type == typeof(WpfImage));
        }
        public WpfWindow GetWindow()
        {
            #region Variable Declarations
            WpfWindow theWindow = StudioWindow.GetChildren()[0] as WpfWindow;
            #endregion

            return(theWindow);
        }
Пример #12
0
        public void TabToOutputMappings()
        {
            TabToMappingsTab();
            Playback.Wait(500);
            var wizard = StudioWindow.GetChildren()[0];

            Keyboard.SendKeys(wizard, "{TAB}{TAB}{TAB}{TAB}");
            Playback.Wait(200);
        }
Пример #13
0
        public void TabToInputMappings()
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            TabToMappingsTab();
            wizard.WaitForControlReady();
            Keyboard.SendKeys(wizard, "{TAB}");
            Playback.Wait(200);
        }
Пример #14
0
        public void ClickSaveButton(int numberOfTabsToSaveButton)
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            KeyboardCommands.SendTabs(numberOfTabsToSaveButton, 200);
            KeyboardCommands.SendEnter();
            Playback.Wait(500);
        }
        /// <summary>
        /// ClickCancel
        /// </summary>
        public void HitDoneWithKeyboard()
        {
            UITestControl decisionDialog = StudioWindow.GetChildren()[0].GetChildren()[2];

            // Click middle of the image to set focus
            Mouse.Click(decisionDialog, new Point(decisionDialog.BoundingRectangle.X + decisionDialog.Width / 2, decisionDialog.BoundingRectangle.Y + decisionDialog.Height / 2));
            SendKeys.SendWait("{TAB}");
            Playback.Wait(200);
            SendKeys.SendWait("{ENTER}");
        }
Пример #16
0
        /// <summary>
        /// Click Save
        /// </summary>
        public void ClickSave()
        {
            var uIItemImage = StudioWindow.GetChildren()[0].GetChildren()[2];

            // Click image
            Mouse.Click(uIItemImage, new Point(523, 450));

            // Click image
            Mouse.Click(uIItemImage, new Point(488, 436));
        }
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public UITestControl GetOkButtonOnActivityDropWindow()
 {
     foreach (var child in StudioWindow.GetChildren()[0].GetChildren())
     {
         if (child.FriendlyName == "OK")
         {
             return(child as WpfButton);
         }
     }
     return(null);
 }
Пример #18
0
 public string GetAssemblyPathText()
 {
     Mouse.Click(StudioWindow.GetChildren()[0].GetChildren()[2], new Point(423, 406));
     StudioWindow.GetChildren()[0].GetChildren()[2].WaitForControlReady();
     Keyboard.SendKeys(StudioWindow.GetChildren()[0].GetChildren()[2], "{CTRL}a");
     StudioWindow.GetChildren()[0].GetChildren()[2].WaitForControlReady();
     Keyboard.SendKeys(StudioWindow.GetChildren()[0].GetChildren()[2], "{CTRL}c");
     StudioWindow.GetChildren()[0].GetChildren()[2].WaitForControlReady();
     Keyboard.SendKeys(StudioWindow.GetChildren()[0].GetChildren()[2], "{RIGHT}");
     return(Clipboard.GetText());
 }
        public string GetUserName()
        {
            KeyboardCommands.SendTabs(3, 250);
            KeyboardCommands.SelectAll();
            KeyboardCommands.SendKey(KeyboardCommands.CopyCommand);
            var wizard   = StudioWindow.GetChildren()[0].GetChildren()[2];
            var userName = Clipboard.GetText();

            //Clipboard.SetText(persistClipboard);
            Mouse.Click(wizard, new Point(584, 160));
            return(userName);
        }
Пример #20
0
        public void EnterDataIntoMappingTextBox(int textboxNumber, string newMappingText)
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            for (int i = 0; i <= textboxNumber; i++)
            {
                SendKeys.SendWait("{TAB}");
                Playback.Wait(50);
            }
            Keyboard.SendKeys(newMappingText);
        }
Пример #21
0
        public void TabToSaveButton(int numberOfTabsToSaveButton)
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            for (int i = 0; i <= numberOfTabsToSaveButton; i++)
            {
                SendKeys.SendWait("{TAB}");
                Playback.Wait(250);
            }
            SendKeys.SendWait("{ENTER}");
            Playback.Wait(500);
        }
        public string GetActionName()
        {
            var persistClipboard = Clipboard.GetText();
            var wizard           = StudioWindow.GetChildren()[0].GetChildren()[2];

            Mouse.StartDragging(wizard, new Point(398, 83));
            Mouse.StopDragging(wizard, 125, 0);
            Keyboard.SendKeys(wizard, "{CTRL}c");
            var actionName = Clipboard.GetText();

            Clipboard.SetText(persistClipboard);
            return(actionName);
        }
Пример #23
0
        public string GetActionName()
        {
            var persistClipboard = System.Windows.Clipboard.GetText();
            var wizard           = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            Mouse.StartDragging(wizard, new Point(418, 81));
            Mouse.StopDragging(wizard, 108, -1);
            Keyboard.SendKeys(wizard, "{CTRL}c");
            var actionName = System.Windows.Clipboard.GetText();

            System.Windows.Clipboard.SetText(persistClipboard);
            return(actionName);
        }
Пример #24
0
 public string GetWorkflowWizardName()
 {
     #region Variable Declarations
     WinWindow uIWorkflowServiceDetaiWindow1 = StudioWindow.GetChildren()[0] as WinWindow;
     #endregion
     if (uIWorkflowServiceDetaiWindow1.WindowTitles.Count > 1)
     {
         throw new Exception("More than 1 wizard window opened");
     }
     else
     {
         return(uIWorkflowServiceDetaiWindow1.WindowTitles[0].ToString());
     }
 }
Пример #25
0
        /// <summary>
        /// Click the "Done" button on the Workflow Service Details Wizard
        /// </summary>
        public void DoneButtonClick()
        {
            #region Variable Declarations
            WinWindow uIServiceDetailsWindow1 = StudioWindow.GetChildren()[0] as WinWindow;
            #endregion

            int l1 = uIServiceDetailsWindow1.BoundingRectangle.Left;
            int t1 = uIServiceDetailsWindow1.BoundingRectangle.Top;

            Point toClick = new Point(l1 + 471, t1 + 190); // Ack :< Required due to lack of Workflow Inspectibility

            // Click 'Workflow Service Details' window
            Mouse.Click(toClick);
        }
Пример #26
0
        private WpfText GetTitleLabel(string autoId)
        {
            UITestControlCollection uiTestControlCollection = StudioWindow.GetChildren();
            var tryGetDialog = uiTestControlCollection[0];

            UITestControl childByAutomationIDPath = VisualTreeWalker.GetChildByAutomationIdPath(tryGetDialog, autoId);
            WpfText       wpfText = childByAutomationIDPath as WpfText;

            if (wpfText != null)
            {
                return(wpfText);
            }
            throw new Exception("Could not find the " + autoId + " label.");
        }
        /// <summary>
        /// ClickCancelButton
        /// </summary>
        public void ClickCancelButton()
        {
            WpfButton uICancelButton = null;

            foreach (var child in StudioWindow.GetChildren()[0].GetChildren())
            {
                if (child.FriendlyName == "Cancel")
                {
                    uICancelButton = child as WpfButton;
                    break;
                }
            }

            // Click 'Cancel' button
            Mouse.Click(uICancelButton, new Point(64, 7));
        }
Пример #28
0
        public void EnterWorkflowName(string name)
        {
            #region Variable Declarations
            WinWindow uIServiceDetailsWindow1 = StudioWindow.GetChildren()[0] as WinWindow;
            #endregion
            uIServiceDetailsWindow1.Find();
            int l1 = uIServiceDetailsWindow1.BoundingRectangle.Left;
            int t1 = uIServiceDetailsWindow1.BoundingRectangle.Top;

            Point toClick = new Point(l1 + 184, t1 + 77); // Ack :< Required due to lack of Workflow Inspectibility

            // Click 'Name' Textbox
            Mouse.Click(toClick);

            // Type 'CodedUITestWorkflow' in 'Workflow Name' textbox
            Keyboard.SendKeys(uIServiceDetailsWindow1, name, ModifierKeys.None);
        }
Пример #29
0
        /// <summary>
        /// Returns true if found in the timeout period.
        /// </summary>
        public bool WaitForDebugWindow(int timeOut)
        {
            const int waitLength = 100;
            Type      type       = null;
            var       timeNow    = 0;

            while (type != typeof(WpfWindow) & timeNow < timeOut)
            {
                timeNow = timeNow + waitLength;
                Playback.Wait(waitLength);
                var tryGetDialog = StudioWindow.GetChildren()[0];
                type = tryGetDialog.GetType();
                if (timeNow > timeOut)
                {
                    break;
                }
            }
            return(type == typeof(WpfWindow));
        }
Пример #30
0
        public void RemoteServerUITests_ViewRemoteWorkFlowInBrowser_WorkflowIsExecuted()
        {
            ExplorerUIMap.DoubleClickWorkflow("Find Records", "TESTS", RemoteServerName);
            KeyboardCommands.SendKey("{F7}");
            PopupDialogUIMap.WaitForDialog();
            //assert error dialog not showing
            var child = StudioWindow.GetChildren()[0];

            if (child != null)
            {
                Assert.IsNotInstanceOfType(child.GetChildren()[0], typeof(Window));
            }
            else
            {
                Assert.Fail("Cannot get studio window after remote workflow show in browser");
            }

            //Try close browser
            ExternalUIMap.CloseAllInstancesOfIE();
        }