示例#1
0
        public void StudioTooling_StudioToolingUITest_CanToolsDisplay_IconIsVisible()
        {
            // Open the Workflow
            ExplorerUIMap.DoubleClickWorkflow("AllTools", "UI Test Resources");
            UITestControl theTab = TabManagerUIMap.GetActiveTab();

            // Assert all the icons are visible
            var designer = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab);

            designer.GetChildren();

            #region Scroll All Items Into View

            var scrollBarV = WorkflowDesignerUIMap.ScrollViewer_GetVerticalScrollBar(theTab);
            WorkflowDesignerUIMap.ScrollViewer_GetHorizontalScrollBar(theTab);

            // Look low
            Mouse.StartDragging(scrollBarV);
            Mouse.StopDragging(WorkflowDesignerUIMap.ScrollViewer_GetScrollDown(theTab));

            // Look high
            Mouse.StartDragging(scrollBarV);
            Mouse.StopDragging(WorkflowDesignerUIMap.ScrollViewer_GetScrollUp(theTab));

            #endregion

            // Assert all the icons are visible
            designer = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab);
            var toolCollection        = designer.GetChildren();
            HashSet <string> controls = new HashSet <string>();

            foreach (var child in toolCollection)
            {
                if (child.ControlType == "Custom" &&
                    child.ClassName != "Uia.ConnectorWithoutStartDot" &&
                    child.ClassName != "Uia.StartSymbol" &&
                    child.ClassName != "Uia.UserControl" &&
                    child.ClassName != "Uia.DsfWebPageActivityDesigner")
                {
                    Assert.IsTrue(WorkflowDesignerUIMap.IsActivityIconVisible(child),
                                  child.FriendlyName + " is missing its icon on the design surface");
                    controls.Add(child.ClassName);
                }
            }

            Assert.AreEqual(27, controls.Count, "Not all tools on the alls tools text workflow can be checked for icons");
        }