//This test could fail because of the really long time it takes to save a workflow and close the old tab public void TabManagerTests_CodedUI_CreateTwoWorkflowsSwitchBetween_ExpectStarNotShowingInName() { const string firstName = "Bug_10528"; const string secondName = "Bug_10528_InnerWorkFlow"; ExplorerUIMap.EnterExplorerSearchText("Bug_10528"); ExplorerUIMap.DoubleClickOpenProject("localhost", "INTEGRATION TEST SERVICES", firstName); var tab1 = TabManagerUIMap.GetActiveTab(); ExplorerUIMap.DoubleClickOpenProject("localhost", "INTEGRATION TEST SERVICES", secondName); var tab2 = TabManagerUIMap.GetActiveTab(); //Switch tabs a couple of times TabManagerUIMap.Click(tab1); TabManagerUIMap.Click(tab2); TabManagerUIMap.Click(tab1); //Check that the tabs names dont have stars in them var tabCount = TabManagerUIMap.GetTabCount(); Assert.IsTrue(tabCount >= 2); for (int i = 0; i < tabCount; i++) { Assert.IsFalse(TabManagerUIMap.GetTabNameAtPosition(i).Contains("*")); } }
public void Deploy_ResourceTree_DeployFromExplorer_AllServiceTypesVisibleAndDeployedItemNotFiltered() { ExplorerUIMap.EnterExplorerSearchText("PluginsReturningXMLFromComplexType"); //------------Execute Test--------------------------- ExplorerUIMap.RightClickDeployProject("INTEGRATION TEST SERVICES", "PluginsReturningXMLFromComplexType"); var theTab = TabManagerUIMap.GetActiveTab(); //wait for resource tree to load Playback.Wait(5000); // Assert All Service Types Visible var sourceResources = DeployUIMap.GetSourceNavigationTree(); var environmentNode = (sourceResources.Nodes[0] as WpfTreeItem); Assert.IsNotNull(environmentNode, "Nothing in the deploy source resource navigation tree."); DeployUIMap.EnterTextInSourceServerFilterBox(theTab, "ldnslgnsdg"); // Random text var result = DeployUIMap.DoesSourceServerHaveDeployItems(theTab); TabManagerUIMap.CloseTab("Deploy"); if (!result) { Assert.Fail("The deployed item has been removed with the filter - It should not be"); } }
public void DragASwitchIntoForEachExpectNotAddedToForEach() { // Create the workflow RibbonUIMap.CreateNewWorkflow(); // Get some variables UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); Point requiredPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab); requiredPoint.Offset(20, 20); // Drag a ForEach onto the Workflow ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.ForEach, workflowPoint1, "For Each"); // Open the toolbox, and drag the control onto the Workflow ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Switch, requiredPoint); // Cancel Decision Wizard if (WizardsUIMap.TryWaitForWizard(3000)) { KeyboardCommands.SendTab(); KeyboardCommands.SendTab(); KeyboardCommands.SendEnter(100); Assert.Fail("Got dropped ;("); } }
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"); }
public void DragAStartNodeOntoATool_HoverOverAToolForAWhile_NoDrillDownShouldHappen() { // Create the workflow RibbonUIMap.CreateNewWorkflow(); // Get some variables UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); var workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); // Drag an assign onto the Workflow ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, workflowPoint1); //Drag Start Node Mouse.StartDragging(theStartButton, MouseButtons.Left); UITestControl assign = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Assign"); var point = new Point(assign.BoundingRectangle.X + 150, assign.BoundingRectangle.Y + 50); //Hover over the multi assign for 5 seconds Mouse.Move(point); Playback.Wait(2000); Mouse.Click(); // ensure the start btn is visible, hence no drill down theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Assert.IsTrue(theStartButton.Exists, "Start Node Hover Caused Drilldown"); }
UITestControl GetControlByFriendlyName(string name) { var sqlBulkInsert = WorkflowDesignerUIMap.FindControlByAutomationId(TabManagerUIMap.GetActiveTab(), "SqlBulkInsertDesigner"); var uiTestControls = WorkflowDesignerUIMap.GetSqlBulkInsertChildren(sqlBulkInsert); return(uiTestControls.FirstOrDefault(c => c.FriendlyName.Contains(name))); }
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 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 WpfTree GetSourceNavigationTree() { var activeTab = TabManagerUIMap.GetActiveTab(); var deployUserControl = GetDeployUserControl(activeTab); return(VisualTreeWalker.GetChildByAutomationIdPath(deployUserControl, "SourceNavigationView", "Navigation") as WpfTree); }
public void ResizeAdornerMappings_Expected_AdornerMappingIsResized() { const string resourceToUse = "Bug_10528"; const string innerResource = "Bug_10528_InnerWorkFlow"; // Open the Explorer ExplorerUIMap.EnterExplorerSearchText(resourceToUse); ExplorerUIMap.DoubleClickOpenProject("localhost", "INTEGRATION TEST SERVICES", resourceToUse); UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl controlOnWorkflow = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, innerResource); Mouse.Move(controlOnWorkflow, new Point(5, 5)); Mouse.DoubleClick(); UITestControlCollection controlCollection = controlOnWorkflow.GetChildren(); Point initialResizerPoint = new Point(); // Validate the assumption that the last child is the resizer var resizeThumb = controlCollection[controlCollection.Count - 1]; if (resizeThumb.ControlType.ToString() == "Indicator") { if (resizeThumb.BoundingRectangle.X == -1) { Assert.Fail("Resize indicator is not visible"); } initialResizerPoint.X = resizeThumb.BoundingRectangle.X + 5; initialResizerPoint.Y = resizeThumb.BoundingRectangle.Y + 5; } else { Assert.Fail("Cannot find resize indicator"); } // Drag Mouse.Move(new Point(resizeThumb.Left + 5, resizeThumb.Top + 5)); Mouse.Click(); Mouse.StartDragging(); // Y - 50 since it starts at the lowest point Mouse.StopDragging(new Point(initialResizerPoint.X + 50, initialResizerPoint.Y + 50)); // Check position to see it dragged Point newResizerPoint = new Point(); if (resizeThumb.ControlType.ToString() == "Indicator") { newResizerPoint.X = resizeThumb.BoundingRectangle.X + 5; newResizerPoint.Y = resizeThumb.BoundingRectangle.Y + 5; } if (!(newResizerPoint.X > initialResizerPoint.X) || !(newResizerPoint.Y > initialResizerPoint.Y)) { Assert.Fail("The control was not resized properly."); } }
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]]"); }
// 05/11 - Failure is Intermittent ;) public void DecisionWizard_Save_WhenMouseUsedToSelect2ndAnd3rdInputFields_FieldDataSavedCorrectly() { //------------Setup for test-------------------------- RibbonUIMap.CreateNewWorkflow(); var theTab = TabManagerUIMap.GetActiveTab(); //------------Execute Test--------------------------- VariablesUIMap.EnterTextIntoScalarName(0, "VariableName"); var pt = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab); ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, pt); WizardsUIMap.WaitForWizard(); Assert.AreEqual("Decision Flow", WizardsUIMap.GetLeftTitleText()); _decisionWizardUiMap.SendTabs(5, 500); _decisionWizardUiMap.SelectMenuItem(17, 100); // select between ;) _decisionWizardUiMap.SendTabs(11, 500); _decisionWizardUiMap.GetFirstIntellisense("[[V", false, new Point(100, 120)); _decisionWizardUiMap.SendTabs(2, 500); _decisionWizardUiMap.GetFirstIntellisense("[[V", false, new Point(400, 120)); _decisionWizardUiMap.SendTabs(1, 500); _decisionWizardUiMap.GetFirstIntellisense("[[V", false, new Point(600, 120)); _decisionWizardUiMap.SendTabs(6, 500); KeyboardCommands.SendEnter(); //------------Assert Results------------------------- const string expected = "If [[VariableName]] Is Between [[VariableName]] and [[VariableName]]"; var getDecision = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "FlowDecisionDesigner"); getDecision.WaitForControlEnabled(); var getDecisionText = getDecision.GetChildren()[0] as WpfEdit; if (getDecisionText != null) { var displayValue = getDecisionText.Text; Assert.AreEqual(expected, displayValue, "Decision intellisense doesnt work when using the mouse to select intellisense results"); } else { Assert.Fail("Null decision"); } }
/// <summary> /// Drags the resource from the explorer to the active tab. /// </summary> /// <param name="resourceName">The name of the resource.</param> /// <param name="categoryName">The name of the category.</param> /// <param name="serverName">Name of the server (Will default to "localhost").</param> /// <returns></returns> public UITestControl DoubleClickWorkflow(string resourceName, string categoryName, string serverName = "localhost") { DoubleClickResource(resourceName, categoryName, serverName); UITestControl newTab = TabManagerUIMap.GetActiveTab(); int counter = 0; while (newTab == null || !TabManagerUIMap.GetActiveTabName().Contains(resourceName) && counter < 7) { Playback.Wait(500); newTab = TabManagerUIMap.GetActiveTab(); counter++; } return(newTab); }
public void SetRoundingType_Normal_ExpectedRoundingInputIsEnabled() { RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); // Drag the tool onto the workflow ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.FormatNumber, workflowPoint1, "Format Number"); UITestControl ctrl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "NumberFormat"); FormatNumberUIMap.InputAllFormatNumberValues(ctrl, "1234.56", "Normal", "1", "3", "[[Result]]"); Assert.IsTrue(FormatNumberUIMap.IsRoundingInputEnabled()); }
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"); }
// ReSharper disable InconsistentNaming public void StudioTooling_StudioToolingUITest_CanOpenLargeView_NoExceptionsThrown() // ReSharper restore InconsistentNaming { var toolsWithLargeView = new List <string> { "DsfPathCopy", "DsfPathCreate", "DsfPathDelete", "DsfWebGetRequestActivity", "DsfAssignActivity", "DsfPathRename", "DsfSqlBulkInsertActivity", "DsfPathMove", "DsfFileRead", "DsfFileWrite", "DsfFolderRead ", "DsfUnZip", "DsfZip" }; // 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 => toolsWithLargeView.Contains(t.FriendlyName)) .ToList(); foreach (var child in toolsWithLargeViews) { //Some of the tools on the design surface are out of view, look for them... WorkflowDesignerUIMap.ScrollControlIntoView(theTab, child); Mouse.Move(child, new Point(15, 15)); Playback.Wait(2500); // Sorted with framework ;) WorkflowDesignerUIMap.OpenCloseLargeView(child.Name, theTab); Playback.Wait(500); WorkflowDesignerUIMap.OpenCloseLargeView(child.Name, theTab); Playback.Wait(500); } }
public void Decision_Intellisense_KeyboardSelect_DecisionTitleUpdatesCorrectly() { RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); VariablesUIMap.ClickScalarVariableName(0); SendKeys.SendWait("VariableName"); ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, WorkflowDesignerUIMap.GetPointUnderStartNode(theTab)); Playback.Wait(5000); //------------Execute Test--------------------------- _decisionWizardUiMap.SendTabs(5, 1000); _decisionWizardUiMap.SelectMenuItem(17, 2000); _decisionWizardUiMap.SendTabs(11, 1000); //First field _decisionWizardUiMap.GetFirstIntellisense("[[V"); _decisionWizardUiMap.SendTabs(2, 1000); //Second field _decisionWizardUiMap.GetFirstIntellisense("[[V"); _decisionWizardUiMap.SendTabs(1, 1000); //Third field _decisionWizardUiMap.GetFirstIntellisense("[[V"); _decisionWizardUiMap.SendTabs(6, 1000); //Wait for wizard to close KeyboardCommands.SendEnter(1500); // Assert Decision Title Updates Correctly const string Expected = "If [[VariableName]] Is Between [[VariableName]] and [[VariableName]]"; var getDecision = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "FlowDecisionDesigner"); var getDecisionText = getDecision.GetChildren()[0] as WpfEdit; if (getDecisionText != null) { var displayValue = getDecisionText.Text; Assert.AreEqual(Expected, displayValue, "Decision intellisense doesnt work when using the keyboard to select intellisense results"); } else { Assert.Fail(); } }
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); }
public void CopyDecisionsWithContextMenuAndPasteExpectedNoWizardsDisplayed() { //Initialize Clipboard.SetText(" "); RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); //Drag on two decisions ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, WorkflowDesignerUIMap.GetPointUnderStartNode(theTab)); WizardsUIMap.WaitForWizard(); _decisionWizardUiMap.HitDoneWithKeyboard(); var newPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab); newPoint.Y = newPoint.Y + 200; var clickPoint = new Point(newPoint.X, newPoint.Y); ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, newPoint); WizardsUIMap.WaitForWizard(7000); _decisionWizardUiMap.HitDoneWithKeyboard(); //Rubber-band select them var startDragPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab); startDragPoint.X = startDragPoint.X - 100; startDragPoint.Y = startDragPoint.Y - 100; Mouse.Move(startDragPoint); newPoint.X = newPoint.X + 100; newPoint.Y = newPoint.Y + 100; Mouse.StartDragging(); Mouse.StopDragging(newPoint); startDragPoint.X = startDragPoint.X + 150; startDragPoint.Y = startDragPoint.Y + 150; Mouse.Click(MouseButtons.Right, ModifierKeys.None, clickPoint); var designSurface = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab); SendKeys.SendWait("{DOWN}{DOWN}{ENTER}"); Mouse.Click(designSurface); SendKeys.SendWait("^v"); UITestControl uIItemImage = DatabaseServiceWizardUIMap.UIBusinessDesignStudioWindow.GetChildren()[0].GetChildren()[0]; // Assert Assert.AreEqual("System Menu Bar", uIItemImage.FriendlyName); }
// 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); }
public void CopyWorkFlowWithContextMenuCopyAndPasteToAnotherWorkflowExpectedNothingCopied() { Clipboard.SetText(" "); RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); WorkflowDesignerUIMap.CopyWorkflowXamlWithContextMenu(theTab); Assert.IsTrue(string.IsNullOrWhiteSpace(Clipboard.GetText()), "Able to copy workflow Xaml using context menu"); RibbonUIMap.CreateNewWorkflow(); theTab = TabManagerUIMap.GetActiveTab(); var startButton = WorkflowDesignerUIMap.FindStartNode(theTab); Mouse.Click(new Point(startButton.BoundingRectangle.X - 5, startButton.BoundingRectangle.Y - 5)); SendKeys.SendWait("^V"); Assert.IsFalse(WorkflowDesignerUIMap.DoesControlExistOnWorkflowDesigner(theTab, "Unsaved 1(FlowchartDesigner)")); }
public void AutoConnectorTests_DragAnActivityOnALineBetweenConnectors_ASecondConnectorIsCreated() { //Drag an activity to the design surface var theTab = ExplorerUIMap.DoubleClickWorkflow("AutoConnectorResource", "UI Test Resources"); var control = WorkflowDesignerUIMap.FindControlByAutomationId(TabManagerUIMap.GetActiveTab(), "MultiAssignDesigner"); // slow it down so it works ;) Mouse.MouseMoveSpeed = 500; Mouse.MouseDragSpeed = 500; //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 - 140); ExplorerUIMap.DragResourceOntoWorkflowDesigner(theTab, "Email Service", "Communication", "localhost", point); if (WorkflowDesignerUIMap.TryCloseMappings("Email Service")) { //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 - 140); if (point != newPoint) { WorkflowDesignerUIMap.DragControl("Email Service", new Point(control.BoundingRectangle.X + 120, control.BoundingRectangle.Y - 40)); } } else { //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 - 140); if (point != newPoint) { WorkflowDesignerUIMap.DragControl("Email Service", newPoint); } } } else { throw new Exception("MultiAssignDesigner not found on active tab"); } var connectors = WorkflowDesignerUIMap.GetAllConnectors(); //Assert start auto connector worked Assert.IsTrue(connectors.Count >= 2, "Connector line wasn't split"); }
public void ClickShowMapping_Expected_InputOutputAdornersAreDisplayed() { // Create the workflow RibbonUIMap.CreateNewWorkflow(); // Get some variables UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); // Get a sample workflow ExplorerUIMap.EnterExplorerSearchText("TestFlow"); ExplorerUIMap.DragControlToWorkflowDesigner("localhost", "WORKFLOWS", "TEST", "TestFlow", workflowPoint1); // Click it UITestControl controlOnWorkflow = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "TestFlow"); Mouse.Click(controlOnWorkflow, new Point(65, 5)); }
public void DragAWorkflowIntoAndOutOfAForEach_Expected_NoErrors() { // Create the workflow RibbonUIMap.CreateNewWorkflow(); // Get some variables UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); Point requiredPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab); requiredPoint.Offset(20, 50); // Drag a ForEach onto the Workflow ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.ForEach, workflowPoint1, "For Each"); // Get a sample workflow, and drag it onto the "Drop Activity Here" part of the ForEach box ExplorerUIMap.EnterExplorerSearchText("CalculateTaxReturns"); var targetPoint = new Point(workflowPoint1.X + 25, workflowPoint1.Y + 25); ExplorerUIMap.DragControlToWorkflowDesigner("localhost", "WORKFLOWS", "MO", "CalculateTaxReturns", targetPoint); // Now - Onto Part 2! // 5792.2 // Get the location of the ForEach box UITestControl forEachControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "ForEach"); MouseCommands.MoveAndClick(new Point(forEachControl.BoundingRectangle.X + 175, forEachControl.BoundingRectangle.Y + 75)); // And drag it down Mouse.StartDragging(); Mouse.StopDragging(new Point(workflowPoint1.X - 200, workflowPoint1.Y + 100)); // Now get its position UITestControl calcTaxReturnsControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "CalculateTaxReturns"); // Its not on the design surface, must be in foreach Assert.IsNotNull(calcTaxReturnsControl, "Could not drop it ;("); }
public void AddSecondServiceToWorkFlowExpectedDisplayTitleNotDsfActivity() { RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl startButton = WorkflowDesignerUIMap.FindStartNode(theTab); ExplorerUIMap.EnterExplorerSearchText("email service"); ExplorerUIMap.DragControlToWorkflowDesigner("localhost", "SERVICES", "Communication", "Email Service", new Point(startButton.BoundingRectangle.X + 50, startButton.BoundingRectangle.Y + 150)); WorkflowDesignerUIMap.TryCloseMappings("Email Service"); ExplorerUIMap.DragControlToWorkflowDesigner("localhost", "SERVICES", "Communication", "Email Service", new Point(startButton.BoundingRectangle.X + 50, startButton.BoundingRectangle.Y + 300)); Assert.IsFalse(WorkflowDesignerUIMap.DoesControlExistOnWorkflowDesigner(theTab, "DsfActivity(ServiceDesigner)"), "Dropped services display title was 'DsfActivity' rather than the name of the service"); }
public void RemoteServerUITests_DebugARemoteWorkflowWhenLocalWorkflowWithSameNameIsOpen_WorkflowIsExecuted() { const string TextToSearchWith = "Find Records"; var localTab = ExplorerUIMap.DoubleClickWorkflow(TextToSearchWith, "TESTS"); Assert.IsNotNull(localTab); var remoteTab = ExplorerUIMap.DoubleClickWorkflow(TextToSearchWith, "TESTS", RemoteServerName); Assert.IsNotNull(remoteTab); RibbonUIMap.DebugShortcutKeyPress(); OutputUIMap.WaitForExecution(); var canidateTab = TabManagerUIMap.GetActiveTab(); // verify the active tab is the remote tab Assert.AreEqual(remoteTab, canidateTab); Assert.IsTrue(OutputUIMap.IsExecutionRemote()); }
public void ChangeRoundingType_None_Expected_RoundingInputBecomesDisabledAndEmpty() { RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); // Drag the tool onto the workflow ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.FormatNumber, workflowPoint1, "Format Number"); UITestControl ctrl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "NumberFormat"); FormatNumberUIMap.InputAllFormatNumberValues(ctrl, "1234.56", "Normal", "1", "3", "[[Result]]"); FormatNumberUIMap.SelectRoundingType("None"); WpfEdit inputControl = FormatNumberUIMap.GetRoudingInputBoxControl(); //Assert.IsFalse(ctrl.Enabled); Assert.IsFalse(inputControl.Enabled); Assert.AreEqual(inputControl.GetProperty("Text").ToString(), string.Empty); }
public void DebugOutput_ClickStep_ActivityIsHighlighted() { //Create testing workflow RibbonUIMap.CreateNewWorkflow(); var theTab = TabManagerUIMap.GetActiveTab(); //Drag on multiassign UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); var thePoint = new Point(theStartButton.BoundingRectangle.X + 30, theStartButton.BoundingRectangle.Y + 90); ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, thePoint); WorkflowDesignerUIMap.AssignControl_ClickLeftTextboxInRow(theTab, "Assign", 0); //Set up multi assign SendKeys.SendWait("[[AssignThis]]{TAB}Some Data"); //run and wait until debug output comes through RibbonUIMap.ClickRibbonMenuItem("Debug"); PopupDialogUIMap.WaitForDialog(); DebugUIMap.ClickExecute(); OutputUIMap.WaitForExecution(); //Click step var step = OutputUIMap.GetOutputWindow(); Playback.Wait(1500); Mouse.Click(step[2]); Playback.Wait(100); Mouse.Click(step[1]); Playback.Wait(100); Mouse.Click(step[2]); Playback.Wait(100); //Assert the design surface activity is highlighted var assign = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Assign"); Assert.IsTrue(WorkflowDesignerUIMap.IsControlSelected(assign), "Selecting a step in the debug output does not select the activity on the design surface"); }
public void UnsavedStar_UITest_WhenWorkflowIsChanged_ExpectStarIsShowing() { //------------Setup for test-------------------------- RibbonUIMap.CreateNewWorkflow(); // Get some data var tabName = TabManagerUIMap.GetActiveTabName(); UITestControl theTab = TabManagerUIMap.FindTabByName(tabName); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); // Drag a Multi Assign on ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, workflowPoint1); // Click away MouseCommands.ClickPoint(new Point(workflowPoint1.X + 50, workflowPoint1.Y + 50), 500); //------------Execute Test--------------------------- var theUnsavedTab = TabManagerUIMap.GetActiveTab(); //------------Assert Results------------------------- Assert.IsNotNull(theUnsavedTab, "Editted workflow does not have the unsaved * after its name on the tab"); }
public UITestControl CreateNewWorkflow(int waitAmt = 0) { var uiTestControlCollection = StudioWindow.GetChildren(); var control = uiTestControlCollection.FirstOrDefault(c => c.FriendlyName == "UI_RibbonHomeTabWorkflowBtn_AutoID"); if (control == null) { var message = string.Format("Resource with name : [{0}] was not found", "UI_RibbonHomeTabWorkflowBtn_AutoID"); throw new Exception(message); } var p = new Point(control.BoundingRectangle.Left + 5, control.BoundingRectangle.Top + 5); Mouse.Click(p); Playback.Wait(500); var tab = TabManagerUIMap.GetActiveTab(); Playback.Wait(waitAmt); return(tab); }