Пример #1
0
        public UITestControlCollection GetStepsByFriendly(UITestControl outputWindow, string friendlyName)
        {
            var children     = outputWindow.GetChildren().Where(c => c.FriendlyName.Equals(friendlyName, StringComparison.CurrentCultureIgnoreCase));
            var uiCollection = new UITestControlCollection();

            foreach (var child in children)
            {
                uiCollection.Add(child);
            }

            return(uiCollection);
        }
        public void UITestControlCollection_CanAddRange()
        {
            UITestControlCollection siblings = CheckBox.GetParent().GetChildren();

            siblings.Should().NotBeNullOrEmpty("because the CheckBox should have siblings");

            var beforeCount = siblings.Count;
            var lastItem    = siblings.Last();
            var toAdd       = new UITestControlCollection();

            toAdd.Add(lastItem);
            toAdd.Add(lastItem);

            siblings
            .AddRange(toAdd);

            siblings
            .Count
            .Should()
            .Be(beforeCount + 2, "because we added 2 Items");
        }
Пример #3
0
        public UITestControlCollection GetStepInOutputWindow(UITestControl outputWindow, string stepToFind)
        {
            UITestControlCollection coll    = outputWindow.GetChildren();
            UITestControlCollection results = new UITestControlCollection();

            foreach (var child in coll)
            {
                if (child.Name.Equals(stepToFind))
                {
                    results.Add(child);
                }
            }

            return(results);
        }
Пример #4
0
        /// <summary>
        /// Gets the navigation item categories.
        /// </summary>
        /// <returns></returns>
        public UITestControlCollection GetNavigationItemCategories()
        {
            UITestControlCollection categories = _explorerTree.GetChildren();

            UITestControlCollection categoryCollection = new UITestControlCollection();

            foreach (UITestControl category in categories)
            {
                if (category.ControlType.ToString() == "TreeItem")
                {
                    categoryCollection.Add(category);
                }
            }

            return(categoryCollection);
        }
        public void UITestControlCollection_CanSetElementByIndex()
        {
            UITestControlCollection siblings = CheckBox.GetParent().GetChildren();

            siblings.Should().NotBeNullOrEmpty("because the CheckBox should have siblings");

            var lastUiTestControl = siblings.Last();

            siblings.Add(new UITestControl());

            siblings[siblings.Count - 1] = lastUiTestControl;
            siblings
            .Last()
            .ShouldBeEquivalentTo(
                lastUiTestControl,
                "because we copied the second last element to be the last.");
        }
        public UITestControlCollection GetScalarVariableList()
        {
            UITestControl variableMenu = GetScalarVariables();

            UITestControlCollection variableList = variableMenu.GetChildren();
            UITestControlCollection returnList   = new UITestControlCollection();

            foreach (UITestControl theItem in variableList)
            {
                if (theItem.ControlType == ControlType.TreeItem)
                {
                    returnList.Add(theItem);
                }
            }

            return(returnList);
        }
Пример #7
0
 public static UITestControlCollection GetInputDetailsDetails(UITestControl outputWindow)
 {
     var coll = outputWindow.GetChildren();
     var results = new UITestControlCollection();
     for(int i = 0; i <= coll.Count; i++)
     {
         if(coll[i].Name.Equals("Inputs : "))
         {
             int j = 1;
             while(!coll[i + j].Name.Equals("Outputs : "))
             {
                 if(coll[i + j].ControlType != ControlType.Button)
                     results.Add(coll[i + j]);
                 j++;
             }
             return results;
         }
     }
     return results;
 }
Пример #8
0
        public UITestControlCollection GetAllTools()
        {
            UITestControlCollection result = new UITestControlCollection();

            foreach (var category in _toolTree.GetChildren())
            {
                var tools = category.GetChildren();
                if (tools.Count > 0)
                {
                    foreach (var tool in tools)
                    {
                        if (tool.ControlType == ControlType.TreeItem)
                        {
                            result.Add(tool);
                        }
                    }
                }
            }
            return(result);
        }
Пример #9
0
        private UITestControlCollection GetWorkflowNotSavedButtons(string windowTitle = "Workflow not saved...")
        {
            // Workflow not saved...
            UITestControl theWindow = new UITestControl();

            theWindow.TechnologyName                  = "MSAA";
            theWindow.SearchProperties["Name"]        = windowTitle;
            theWindow.SearchProperties["ControlType"] = "Window";
            theWindow.Find();
            UITestControlCollection firstChildren = theWindow.GetChildren();

            var ctrls = firstChildren.Where(c => c.ClassName == "Uia.Button");

            UITestControlCollection saveDialogButtons = new UITestControlCollection();

            foreach (UITestControl control in ctrls)
            {
                saveDialogButtons.Add(control);
            }

            return(saveDialogButtons);
        }
Пример #10
0
        public static UITestControlCollection GetInputDetailsDetails(UITestControl outputWindow)
        {
            var coll    = outputWindow.GetChildren();
            var results = new UITestControlCollection();

            for (int i = 0; i <= coll.Count; i++)
            {
                if (coll[i].Name.Equals("Inputs : "))
                {
                    int j = 1;
                    while (!coll[i + j].Name.Equals("Outputs : "))
                    {
                        if (coll[i + j].ControlType != ControlType.Button)
                        {
                            results.Add(coll[i + j]);
                        }
                        j++;
                    }
                    return(results);
                }
            }
            return(results);
        }
Пример #11
0
        /// <summary>
        /// Gets the navigation items.
        /// </summary>
        /// <returns></returns>
        public UITestControlCollection GetServiceItems()
        {
            UITestControlCollection categories = _explorerTree.GetChildren();

            UITestControlCollection categoryCollection = new UITestControlCollection();

            foreach (UITestControl category in categories)
            {
                if (category.ControlType.ToString() == "TreeItem")
                {
                    var kids = category.GetChildren();
                    foreach (var kid in kids)
                    {
                        if (kid.ControlType.ToString() == "TreeItem")
                        {
                            categoryCollection.Add(kid);
                        }
                    }
                }
            }

            return(categoryCollection);
        }
        public UITestControlCollection GetScalarVariableList()
        {
            UITestControl variableMenu = GetScalarVariables();

            UITestControlCollection variableList = variableMenu.GetChildren();
            UITestControlCollection returnList = new UITestControlCollection();
            foreach(UITestControl theItem in variableList)
            {
                if(theItem.ControlType == ControlType.TreeItem)
                {
                    returnList.Add(theItem);
                }
            }

            return returnList;
        }
Пример #13
0
        public UITestControlCollection GetStepInOutputWindow(UITestControl outputWindow, string stepToFind)
        {
            UITestControlCollection coll = outputWindow.GetChildren();
            UITestControlCollection results = new UITestControlCollection();
            foreach(var child in coll)
            {
                if(child.Name.Equals(stepToFind))
                {
                    results.Add(child);
                }
            }

            return results;
        }
        private UITestControlCollection GetWorkflowNotSavedButtons(string windowTitle = "Workflow not saved...")
        {
            // Workflow not saved...
            UITestControl theWindow = new UITestControl();
            theWindow.TechnologyName = "MSAA";
            theWindow.SearchProperties["Name"] = windowTitle;
            theWindow.SearchProperties["ControlType"] = "Window";
            theWindow.Find();
            UITestControlCollection firstChildren = theWindow.GetChildren();

            var ctrls = firstChildren.Where(c => c.ClassName == "Uia.Button");

            UITestControlCollection saveDialogButtons = new UITestControlCollection();
            foreach(UITestControl control in ctrls)
            {
                saveDialogButtons.Add(control);
            }

            return saveDialogButtons;
        }
Пример #15
0
        /// <summary>
        /// Gets the navigation item categories.
        /// </summary>
        /// <returns></returns>
        public UITestControlCollection GetNavigationItemCategories()
        {
            UITestControlCollection categories = _explorerTree.GetChildren();

            UITestControlCollection categoryCollection = new UITestControlCollection();

            foreach(UITestControl category in categories)
            {
                if(category.ControlType.ToString() == "TreeItem")
                {
                    categoryCollection.Add(category);
                }
            }

            return categoryCollection;
        }
Пример #16
0
        /// <summary>
        /// Gets the navigation items.
        /// </summary>
        /// <returns></returns>
        public UITestControlCollection GetServiceItems()
        {
            UITestControlCollection categories = _explorerTree.GetChildren();

            UITestControlCollection categoryCollection = new UITestControlCollection();

            foreach(UITestControl category in categories)
            {
                if(category.ControlType.ToString() == "TreeItem")
                {
                    var kids = category.GetChildren();
                    foreach(var kid in kids)
                    {
                        if(kid.ControlType.ToString() == "TreeItem")
                        {
                            categoryCollection.Add(kid);
                        }
                    }

                }
            }

            return categoryCollection;
        }
Пример #17
0
 public UITestControlCollection GetAllTools()
 {
     UITestControlCollection result = new UITestControlCollection();
     foreach(var category in _toolTree.GetChildren())
     {
         var tools = category.GetChildren();
         if(tools.Count > 0)
         {
             foreach(var tool in tools)
             {
                 if(tool.ControlType == ControlType.TreeItem)
                 {
                     result.Add(tool);
                 }
             }
         }
     }
     return result;
 }
        public void AssignControl_QuickVariableInputControl_EnterData(UITestControl theTab, string controlAutomationId, string splitOn, string prefix, string suffix, string variableList)
        {
            // Find the control
            UITestControl assignControl = FindControlByAutomationId(theTab, controlAutomationId);
            UITestControlCollection assignControlCollection = assignControl.GetChildren();
            var qviControl = GetQVIControl(assignControlCollection);

            UITestControlCollection qviChildren = qviControl.GetChildren();

            UITestControlCollection textBoxes = new UITestControlCollection();
            foreach(UITestControl theControl in qviChildren)
            {
                if(theControl.ControlType == ControlType.Edit)
                {
                    textBoxes.Add(theControl);
                }
            }

            if(textBoxes.Count == 0)
            {
                Assert.Fail("Cant find QVI textboxes");
            }


            Mouse.Click(textBoxes[0], new Point(15, 5));
            Playback.Wait(250);
            SendKeys.SendWait(variableList.Replace("(", "{(}").Replace(")", "{)}"));
            Playback.Wait(250);
            SendKeys.SendWait("{TAB}{TAB}");
            Playback.Wait(250);
            // And enter all the data
            SendKeys.SendWait(splitOn.Replace("(", "{(}").Replace(")", "{)}"));
            Playback.Wait(250);
            SendKeys.SendWait("{TAB}");
            Playback.Wait(250);
            SendKeys.SendWait(prefix.Replace("(", "{(}").Replace(")", "{)}"));
            Playback.Wait(250);
            SendKeys.SendWait("{TAB}");
            Playback.Wait(250);
            SendKeys.SendWait(suffix.Replace("(", "{(}").Replace(")", "{)}"));
        }
Пример #19
0
        public UITestControlCollection GetStepsByFriendly(UITestControl outputWindow, string friendlyName)
        {
            var children = outputWindow.GetChildren().Where(c => c.FriendlyName.Equals(friendlyName, StringComparison.CurrentCultureIgnoreCase));
            var uiCollection = new UITestControlCollection();

            foreach(var child in children)
            {
                uiCollection.Add(child);
            }

            return uiCollection;
        }