Esempio n. 1
0
        public void AutoConnectorTests_DragADecisionOnStartAutoConnectorNode_ASecondConnectorIsCreated()
        {
            Mouse.MouseMoveSpeed = 500;
            Mouse.MouseDragSpeed = 500;

            CreateWorkflow();

            Point point = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(TabManagerUIMap.GetActiveTab());

            //Drag a control to the design surface
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, point);
            DecisionWizardUIMap.ClickDone(2500);
            //If the screen resolution is low or if the studio is windowed this point can jump as soon as the control is dragged over the work surface, the control might need to be re-dragged to hit the connector line
            Point newPoint = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(TabManagerUIMap.GetActiveTab());

            if (point != newPoint)
            {
                WorkflowDesignerUIMap.DragControl("Decision", newPoint);
            }

            var connectors = WorkflowDesignerUIMap.GetAllConnectors();

            //Assert start auto connector worked
            Assert.AreEqual(1, connectors.Count, "Start auto connector doesnt work");
        }
Esempio n. 2
0
        /// <summary>
        /// Drags the resource from the explorer to the active tab.
        /// </summary>
        /// <param name="tabToDropOnto">The tab to drop the resource onto.</param>
        /// <param name="resourceName">The name of the resource.</param>
        /// <param name="categoryName">The name of the category.</param>
        /// <param name="serviceType">Type of the service.</param>
        /// <param name="serverName">Name of the server (Will default to "localhost").</param>
        /// <param name="pointToDragTo">The point to drop the resource on the designer (Will default to just below the start node).</param>
        /// <param name="overrideDblClickBehavior">if set to <c>true</c> [override double click behavior].</param>
        public UITestControl DragResourceOntoWorkflowDesigner(UITestControl tabToDropOnto, string resourceName, string categoryName, string serverName = "localhost", Point pointToDragTo = new Point())
        {
            if (pointToDragTo.X == 0 && pointToDragTo.Y == 0)
            {
                pointToDragTo = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(tabToDropOnto);
            }
            EnterExplorerSearchText(resourceName);
            UITestControl theControl = null;

            if (categoryName != "Unassigned" && categoryName != string.Empty)
            {
                theControl = VisualTreeWalker.GetChildByAutomationIdPath(_explorerTree, serverName, categoryName, resourceName);
            }
            else
            {
                theControl = VisualTreeWalker.GetChildByAutomationIdPath(_explorerTree, serverName, resourceName);
            }
            Mouse.StartDragging(theControl);
            Playback.Wait(20);
            Mouse.StopDragging(pointToDragTo);
            Playback.Wait(100);
            UITestControl resourceOnDesignSurface = WorkflowDesignerUIMap.FindControlByAutomationId(tabToDropOnto, resourceName);
            int           counter = 0;

            while (resourceOnDesignSurface == null && counter < 5)
            {
                Playback.Wait(1000);
                resourceOnDesignSurface = WorkflowDesignerUIMap.FindControlByAutomationId(tabToDropOnto, resourceName);
                Playback.Wait(500);
                counter++;
            }

            return(resourceOnDesignSurface);
        }
Esempio n. 3
0
        public void SqlBulkInsertTest_OpenQuickVariableInputAndCloseItImmediately_ReturnsToSmallView()
        {
            // Create the workflow
            RibbonUIMap.CreateNewWorkflow();
            var theTab = TabManagerUIMap.GetActiveTab();

            // Get some variables
            var startPoint = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(theTab);
            var point      = new Point(startPoint.X, startPoint.Y + 200);

            // Drag the tool onto the workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.SqlBulkInsert, point, "Sql Bulk");

            //Open the quick variable input view
            var toggleButton = GetControlByFriendlyName("Open Quick Variable Input");

            MouseCommands.ClickControlAtPoint(toggleButton, new Point(5, 5));
            WaitForControlLoad();

            var quickVarInputContent = GetControlByFriendlyName("QuickVariableInputContent");

            Assert.IsNotNull(quickVarInputContent);

            //Close the quick variable input view
            toggleButton = GetControlByFriendlyName("Close Quick Variable Input");
            MouseCommands.ClickControlAtPoint(toggleButton, new Point(5, 5));
            WaitForControlLoad();

            var smallDataGrid = GetControlById("SmallDataGrid", theTab);

            Assert.IsNotNull(smallDataGrid);
        }
        public void QuickVariableInputFromListTest()
        {
            Clipboard.Clear();
            // Create the workflow
            RibbonUIMap.CreateNewWorkflow();

            // Get some variables
            UITestControl theTab     = TabManagerUIMap.GetActiveTab();
            Point         startPoint = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(theTab);
            Point         point      = new Point(startPoint.X - 100, startPoint.Y + 100);

            // Drag the tool onto the workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, point);

            //Get Mappings button
            UITestControl button = WorkflowDesignerUIMap.Adorner_GetButton(theTab, "Assign", "Open Quick Variable Input");

            // Click it
            MouseCommands.MoveAndClick(new Point(button.BoundingRectangle.X + 5, button.BoundingRectangle.Y + 5));

            // Enter some invalid data
            WorkflowDesignerUIMap.AssignControl_QuickVariableInputControl_EnterData(theTab, "Assign", ",",
                                                                                    "some(<).", "_suf",
                                                                                    "varOne,varTwo,varThree");

            // Click done
            WorkflowDesignerUIMap.AssignControl_QuickVariableInputControl_ClickAdd(theTab, "Assign");

            var errorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab,
                                                                               "Prefix contains invalid characters");

            Assert.IsNotNull(errorControl, "No error displayed for incorrect QVI input");

            #region Scroll Right

            var scrollBarH = WorkflowDesignerUIMap.ScrollViewer_GetHorizontalScrollBar(theTab);
            WorkflowDesignerUIMap.ScrollViewer_GetHorizontalScrollBar(theTab);

            // Look far right
            Mouse.StartDragging(scrollBarH);
            Mouse.StopDragging(WorkflowDesignerUIMap.ScrollViewer_GetScrollRight(theTab));

            #endregion

            // Assert clicking an error focuses the correct text-box
            MouseCommands.ClickControl(errorControl.GetChildren()[0]);

            // enter some correct data
            KeyboardCommands.SendKey("^a^xpre_", 100);

            WorkflowDesignerUIMap.AssignControl_QuickVariableInputControl_ClickAdd(theTab, "Assign");

            // Check the data
            string varName = WorkflowDesignerUIMap.AssignControl_GetVariableName(theTab, "Assign", 0);
            StringAssert.Contains(varName, "[[pre_varOne_suf]]");
        }
        public void ToolDesigners_ForEach_DraggingSwitch_NotAllowed()
        {
            using (var dsfActivityUiMap = new DsfForEachUiMap(false, false)
            {
                TheTab = RibbonUIMap.CreateNewWorkflow(2000)
            })
            {
                Point pointToDragTo = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(dsfActivityUiMap.TheTab);
                dsfActivityUiMap.Activity = ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.ForEach, dsfActivityUiMap.TheTab, pointToDragTo);
                dsfActivityUiMap.DragActivityOnDropPoint(ToolType.Switch);

                var forEachActivity = dsfActivityUiMap.GetActivity();
                Assert.IsNull(forEachActivity);
            }
        }
        public void ToolDesigners_SequenceSmallView_DraggingNonDecision_Allowed()
        {
            Mouse.MouseDragSpeed = 500;

            using (var dsfActivityUiMap = new DsfSequenceUiMap(false, false)
            {
                TheTab = RibbonUIMap.CreateNewWorkflow(2000)
            })
            {
                Point pointToDragTo = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(dsfActivityUiMap.TheTab);
                dsfActivityUiMap.Activity = ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Sequence, dsfActivityUiMap.TheTab, pointToDragTo);
                dsfActivityUiMap.DragActivityOnDropPoint(ToolType.Assign);

                var activityList = dsfActivityUiMap.GetActivityList();
                Assert.AreEqual(1, activityList.Count);
            }
        }
Esempio n. 7
0
        public void SqlBulkInsertTest_NoDatabaseIsSelected_GridHasNothing()
        {
            // Create the workflow
            RibbonUIMap.CreateNewWorkflow();
            var theTab = TabManagerUIMap.GetActiveTab();

            // Get some variables
            var startPoint = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(theTab);
            var point      = new Point(startPoint.X, startPoint.Y + 200);

            // Drag the tool onto the workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.SqlBulkInsert, point, "Sql Bulk");

            var smallDataGrid = GetControlById("SmallDataGrid", theTab);

            Assert.IsTrue(smallDataGrid.GetChildren().Count == 0);
        }
Esempio n. 8
0
        // 05/11 - Failure is Intermittent - Problems finding LargeView button ;)
        public void SqlBulkInsertTest_SelectDatabaseAndTableName_GridHasColumnnames()
        {
            // Create the workflow
            RibbonUIMap.CreateNewWorkflow();
            var theTab = TabManagerUIMap.GetActiveTab();

            var startPoint = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(theTab);
            var point      = new Point(startPoint.X, startPoint.Y + 200);

            // Drag the tool onto the workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.SqlBulkInsert, point, "Sql Bulk");

            //Select a database
            var dbDropDown = GetControlById("UI__Database_AutoID", theTab) as WpfComboBox;

            MouseCommands.ClickControlAtPoint(dbDropDown, new Point(10, 10));
            WaitForControlLoad(15000);
            if (dbDropDown != null)
            {
                var listOfDbNames = dbDropDown.Items.Select(i => i as WpfListItem).ToList();
                var databaseName  = listOfDbNames.SingleOrDefault(i => i.DisplayText.Contains(TestingDb));
                MouseCommands.ClickControlAtPoint(databaseName, new Point(5, 5));
            }

            //Select a table
            var tableDropDown = GetControlById("UI__TableName_AutoID", theTab) as WpfComboBox;

            MouseCommands.ClickControlAtPoint(tableDropDown, new Point(10, 10));
            WaitForControlLoad(15000);
            if (tableDropDown != null)
            {
                var listOfTableNames = tableDropDown.Items.Select(i => i as WpfListItem).ToList();
                WaitForControlLoad(2500);
                MouseCommands.ClickControlAtPoint(listOfTableNames[TableIndex], new Point(5, 5));
            }

            WaitForControlLoad(3000);

            //Assert that grid is not empty
            var smallDataGrid = GetControlById("SmallDataGrid", theTab);

            Assert.IsTrue(smallDataGrid.GetChildren().Count > 0);
        }
Esempio n. 9
0
        public void AutoConnectorTests_DragAToolOnStartAutoConnectorNode_AConnectorIsCreated()
        {
            UITestControl theTab = CreateWorkflow();

            Point point = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(theTab);

            //Drag a control to the design surface
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, point);
            //If the screen resolution is low or if the studio is windowed this point can jump as soon as the control is dragged over the work surface, the control might need to be re-dragged to hit the connector line
            Point newPoint = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(theTab);

            if (point != newPoint)
            {
                WorkflowDesignerUIMap.DragControl("Assign", newPoint);
            }
            List <UITestControl> connectors = WorkflowDesignerUIMap.GetAllConnectors();

            //Assert start auto connector worked
            Assert.AreEqual(1, connectors.Count, "Start auto connector was not created");
        }