Exemplo 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");
        }
Exemplo n.º 2
0
        public void AutoConnectorTests_DragADecisionOnALineBetweenConnectors_ASecondConnectorIsCreated()
        {
            var theTab  = ExplorerUIMap.DoubleClickWorkflow("AutoConnectorResource", "UI Test Resources");
            var control = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "MultiAssignDesigner");

            //Drag a decision to the design surface
            //Note that this point is a position relative to the multi assign on the design surface. This is to ensure that the tool is dropped exactly on the line
            if (control != null)
            {
                var point = new Point(control.BoundingRectangle.X + 120, control.BoundingRectangle.Y - 150);
                ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, point);
            }
            else
            {
                throw new Exception("MultiAssignDesigner not found on active tab");
            }

            DecisionWizardUIMap.CancelWizard();
            var connectors = WorkflowDesignerUIMap.GetAllConnectors();

            //Assert start auto connector worked
            Assert.IsTrue(connectors.Count == 2, "Connector line wasn't split");
        }