public void AutoConnectorTests_DragAToolOnALineBetweenConnectors_ASecondConnectorIsCreated() { //Drag a tool to the design surface var theTab = ExplorerUIMap.DoubleClickWorkflow("AutoConnectorResource", "UI Test Resources"); UITestControl control = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "MultiAssignDesigner"); //Drag a tool 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.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 var newPoint = new Point(control.BoundingRectangle.X + 120, control.BoundingRectangle.Y - 150); if (point != newPoint) { var theControl = WorkflowDesignerUIMap.GetAllControlsOnDesignSurface(theTab)[5]; Mouse.StartDragging(theControl, new Point(10, 10)); Mouse.StopDragging(newPoint); } } else { throw new Exception("MultiAssignDesigner not found on active tab"); } var connectors = WorkflowDesignerUIMap.GetAllConnectors(); //Assert that the line was split Assert.IsTrue(connectors.Count >= 2, "Connector line wasn't split"); }
public void WorkflowDesigner_CodedUI_CopyAndPastingAndDeleteingActivity_CopyPasteAndDeleteWork() { //------------Setup for test-------------------------- RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); //Find the start point UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, workflowPoint1); WorkflowDesignerUIMap.AssignControl_ClickLeftTextboxInRow(theTab, "Assign", 0); SendKeys.SendWait("Hello"); //Get Large View button WorkflowDesignerUIMap.OpenCloseLargeView(ToolType.Assign, theTab); //------------Execute Test--------------------------- SendKeys.SendWait("^c"); SendKeys.SendWait("^v"); //------------Assert Results------------------------- UITestControlCollection allControlsOnDesignSurface = WorkflowDesignerUIMap.GetAllControlsOnDesignSurface(theTab); IEnumerable <UITestControl> uiTestControls = allControlsOnDesignSurface.Where(c => c.Name == "DsfMultiAssignActivity"); Assert.IsTrue(uiTestControls.Count() == 2); SendKeys.SendWait("{DELETE}"); allControlsOnDesignSurface = WorkflowDesignerUIMap.GetAllControlsOnDesignSurface(theTab); uiTestControls = allControlsOnDesignSurface.Where(c => c.Name == "DsfMultiAssignActivity"); Assert.IsTrue(uiTestControls.Count() == 1); }