public void AdornerHelpButtonOpenAnExampleWorlkflowTest() { // Create the workflow RibbonUIMap.CreateNewWorkflow(); // Get some design surface UITestControl theTab = TabManagerUIMap.GetActiveTab(); //Get a point Point requiredPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab); //Drag a control to the design surface ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, requiredPoint); //Get Adorner buttons var button = WorkflowDesignerUIMap.Adorner_GetButton(theTab, "Assign", "Open Help"); Mouse.Click(button); //Get 'View Sample' link button var findViewSampleLink = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "View Sample Workflow"); Mouse.Click(findViewSampleLink.GetChildren()[0]); //Wait for sample workflow UITestControl waitForTabToOpen = null; var count = 10; while (waitForTabToOpen == null && count > 0) { waitForTabToOpen = TabManagerUIMap.FindTabByName("Utility - Assign", 500); count--; } //Assert workflow opened after a time out. Assert.IsNotNull(waitForTabToOpen); }
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]]"); }
// ReSharper disable InconsistentNaming public void QuickVariableInput_GriddedToolsWithComboboxes_OpenAndCloseQVI_SelectedValueIsPreserved() // ReSharper restore InconsistentNaming { var gridedToolsWithComboboxes = new List <string> { "DsfDataMergeActivity", "DsfDataSplitActivity", "DsfBaseConvertActivity", "DsfCaseConvertActivity" }; // Open the Explorer ExplorerUIMap.EnterExplorerSearchText("AllTools"); // Open the Workflow ExplorerUIMap.DoubleClickOpenProject("localhost", "Mocake", "AllTools"); UITestControl theTab = TabManagerUIMap.GetActiveTab(); var designer = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab); var toolsWithLargeViews = designer.GetChildren() .Where(t => gridedToolsWithComboboxes.Contains(t.FriendlyName)) .ToList(); foreach (var tool in toolsWithLargeViews) { //Some of the tools on the design surface are out of view, look for them... if (tool.BoundingRectangle.Y > 800) { //might already be scrolled var scrollBar = WorkflowDesignerUIMap.ScrollViewer_GetVerticalScrollBar(theTab); WpfControl getTop = scrollBar as WpfControl; if (getTop != null && getTop.Top < 200) { //Look low Mouse.StartDragging(scrollBar); Mouse.StopDragging(WorkflowDesignerUIMap.ScrollViewer_GetScrollDown(theTab)); } } else { //might already be scrolled var scrollBar = WorkflowDesignerUIMap.ScrollViewer_GetVerticalScrollBar(theTab); WpfControl getTop = scrollBar as WpfControl; if (getTop != null && getTop.Top > 200) { //Look high Mouse.StartDragging(scrollBar); Mouse.StopDragging(WorkflowDesignerUIMap.ScrollViewer_GetScrollUp(theTab)); } } // var selectedItems = SelectItemOnComboBox(tool.FriendlyName, theTab); //Get Mappings button UITestControl toggleButton = WorkflowDesignerUIMap.Adorner_GetButton(theTab, tool.FriendlyName, "Open Quick Variable Input") as WpfToggleButton; // Click it Mouse.Click(toggleButton); //Get Mappings button toggleButton = WorkflowDesignerUIMap.Adorner_GetButton(theTab, tool.FriendlyName, "Close Quick Variable Input") as WpfToggleButton; // Click it Mouse.Click(toggleButton); //Assert Assert.IsTrue(VerifySelectedItems(tool.FriendlyName, theTab, selectedItems)); } }