UITestControl GetControlByFriendlyName(string name) { var sqlBulkInsert = WorkflowDesignerUIMap.FindControlByAutomationId(TabManagerUIMap.GetActiveTab(), "SqlBulkInsertDesigner"); var uiTestControls = WorkflowDesignerUIMap.GetSqlBulkInsertChildren(sqlBulkInsert); return(uiTestControls.FirstOrDefault(c => c.FriendlyName.Contains(name))); }
/// <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); }
public void PluginServiceTests_CodedUI_EditSource_FromEditService_ExceptNoNameError() { //------------Setup for test-------------------------- //Drag the service onto the design surface UITestControl theTab = ExplorerUIMap.DoubleClickWorkflow("ErrorFrameworkTestWorkflow", "UI TEST"); UITestControl service = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "DummyService"); using (DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false) { Activity = service, TheTab = theTab }) { //------------Execute Test--------------------------- activityUiMap.ClickEdit(); PluginServiceWizardUIMap.EditSource(); var contents = PluginServiceWizardUIMap.GetWindowContents(); PluginServiceWizardUIMap.CancelEntireOperation(); var result = (contents.IndexOf("Name already exists.", StringComparison.Ordinal) >= 0); var isEmpty = (contents.Length == 0); //------------Assert Results------------------------- Assert.IsFalse(isEmpty, "Copy did not copy content of Edit Source Wizard!"); Assert.IsFalse(result, "Plugin Source Window Contains Save Message?! Check your warewolf-utils.js - updateSaveValidationSpan method"); } }
public void DbServiceTests_CodedUI_EditService_ExpectErrorButton() { var newMapping = "ZZZ" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 6); //Drag the service onto the design surface UITestControl theTab = ExplorerUIMap.DoubleClickWorkflow("ErrorFrameworkTestWorkflow", "UI TEST"); UITestControl service = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "TravsTestService"); using (DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false) { Activity = service, TheTab = theTab }) { activityUiMap.ClickEdit(); WizardsUIMap.WaitForWizard(); //Wizard actions DatabaseServiceWizardUIMap.ClickMappingTab(); DatabaseServiceWizardUIMap.EnterDataIntoMappingTextBox(0, newMapping); DatabaseServiceWizardUIMap.ClickSaveButton(4); // IT IS THE STRANGES THING. 3 IF RUN FROM DESKTOP, 4 FOR RDP SESSION?! ResourceChangedPopUpUIMap.ClickCancel(); //Assert the the error button is there Assert.IsTrue(activityUiMap.IsFixErrorButtonShowing()); //Click the fix errors button activityUiMap.ClickFixErrors(); activityUiMap.ClickCloseMapping(5000); //Assert that the fix errors button isnt there anymore Assert.IsFalse(activityUiMap.IsFixErrorButtonShowing()); } }
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 WebServiceTests_CodedUI_EditService_ExpectErrorButton() { var newMapping = "ZZZ" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 6); UITestControl theTab = ExplorerUIMap.DoubleClickWorkflow("ErrorFrameworkTestWorkflow", "UI TEST"); UITestControl service = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "FetchCities"); using (DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false) { Activity = service, TheTab = theTab }) { activityUiMap.ClickEdit(); //Wizard actions WebServiceWizardUIMap.ClickMappingTab(); WebServiceWizardUIMap.EnterDataIntoMappingTextBox(6, newMapping); WebServiceWizardUIMap.TabToSaveButton(2); ResourceChangedPopUpUIMap.ClickCancel(); //Assert the the error button is there Assert.IsTrue(activityUiMap.IsFixErrorButtonShowing()); //Click the fix errors button activityUiMap.ClickFixErrors(); activityUiMap.ClickCloseMapping(); //Assert that the fix errors button isnt there anymore Assert.IsFalse(activityUiMap.IsFixErrorButtonShowing()); } }
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 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"); }
public void LargeViewTextboxesEnterTestData(ToolType tool, UITestControl theTab) { //Find the start point 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(tool, workflowPoint1); WorkflowDesignerUIMap.OpenCloseLargeView(tool, theTab); // Add the data! List <UITestControl> listOfTextboxes = GetAllTextBoxesFromLargeView(tool.ToString(), theTab); int counter = 0; foreach (var textbox in listOfTextboxes) { WpfEdit tb = textbox as WpfEdit; if (tb != null && !tb.IsPassword) { tb.SetFocus(); SendKeys.SendWait("[[theVar" + counter.ToString(CultureInfo.InvariantCulture) + "]]"); } counter++; } }
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]]"); }
UITestControl GetControlById(string autoId, UITestControl theTab) { var sqlBulkInsert = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "SqlBulkInsertDesigner"); var uiTestControls = WorkflowDesignerUIMap.GetSqlBulkInsertChildren(sqlBulkInsert); var result = uiTestControls.FirstOrDefault(c => c.AutomationId.Equals(autoId)); if (result != null) { result.WaitForControlReady(); } return(result); }
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 ClickDoneButton(UITestControl theTab, string toolName) { UITestControl assignControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, toolName); UITestControlCollection assignControlCollection = assignControl.GetChildren(); UITestControl addBtn = new UITestControl(); foreach (UITestControl controlChild in assignControlCollection) { if (controlChild.FriendlyName == "Done") { addBtn = controlChild; } } Mouse.Click(addBtn, new Point(5, 5)); }
public void DesignTimeErrorHandling_DesignTimeErrorHandlingUITest_FixErrorsButton_DbServiceMappingsFixed() { const string workflowToUse = "Bug_10011"; const string serviceToUse = "Bug_10011_DbService"; var newColumnName = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 8); Clipboard.Clear(); // Open the Workflow var theTab = ExplorerUIMap.DoubleClickWorkflow(workflowToUse, "TestCategory"); // Edit the DbService ExplorerUIMap.DoubleClickService(serviceToUse, "utility"); //Test the service to get output mappings KeyboardCommands.SendTabs(11); KeyboardCommands.SendKey("a"); KeyboardCommands.SendTabs(11); KeyboardCommands.SendEnter(); Playback.Wait(2000); // Tab to mappings DatabaseServiceWizardUIMap.ClickMappingTab(320); KeyboardCommands.SendTabs(4); KeyboardCommands.SendKey(newColumnName); KeyboardCommands.SendTabs(4); KeyboardCommands.SendEnter(); // Save if (ResourceChangedPopUpUIMap.WaitForDialog(5000)) { ResourceChangedPopUpUIMap.ClickCancel(); } using (DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false)) { activityUiMap.Activity = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, serviceToUse + "(ServiceDesigner)"); Assert.IsTrue(activityUiMap.IsFixErrorButtonShowing(), "Error button should be showing"); activityUiMap.ClickFixErrors(); activityUiMap.ClickDoneButton(); Assert.IsFalse(activityUiMap.IsFixErrorButtonShowing(), "Error button shouldn't be showing"); } }
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 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 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 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"); }
// Properly broken functionality public void DesignTimeErrorHandling_DesignTimeErrorHandlingUITest_FixErrorsButton_UserIsPromptedToAddRequiredDbServiceMappings() { const string workflowResourceName = "DesignTimeErrorHandlingRequiredMappingUITest"; const string dbResourceName = "UserIsPromptedToAddRequiredDbServiceMappingsTest"; // Open the Workflow UITestControl theTab = ExplorerUIMap.DoubleClickWorkflow(workflowResourceName, "UI TEST"); // Edit the DbService ExplorerUIMap.DoubleClickService(dbResourceName, "INTEGRATION TEST SERVICES"); // Get wizard window DatabaseServiceWizardUIMap.ClickMappingTab(550); // over-ride cuz silly chickens like long names in test ;( //set the first input to required KeyboardCommands.SendTabs(2, 50); KeyboardCommands.SendSpace(); // Save KeyboardCommands.SendTabs(4, 250); KeyboardCommands.SendEnter(); ResourceChangedPopUpUIMap.ClickCancel(); UITestControl activity = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, dbResourceName); using (DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false) { TheTab = theTab, Activity = activity }) { Assert.IsTrue(activityUiMap.IsFixErrorButtonShowing(), "'Fix Errors' button not visible"); activityUiMap.ClickFixErrors(); KeyboardCommands.SendKey("[[Name]]", 25); activityUiMap.ClickCloseMapping(); Assert.IsFalse(activityUiMap.IsFixErrorButtonShowing(), "'Fix Errors' button is still visible"); } }
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); }
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"); }
public List <UITestControl> GetAllTextBoxesFromLargeView(string toolName, UITestControl theTab) { List <UITestControl> results = new List <UITestControl>(); UITestControl activityControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, toolName); UITestControl findContent = null; foreach (var child in activityControl.GetChildren()) { if (child.FriendlyName == "LargeViewContent") { findContent = child; break; } } if (findContent != null) { var children = findContent.GetChildren(); results = children.Where(c => c.ControlType.Name == "Edit").ToList(); } return(results); }
public void SqlBulkInsertTest_OpenLargeViewAndEnterAnInvalidBatchAndTimeoutSizeAndClickDone_CorrectingErrorsAndClickDoneWillReturnToSmallView() { // Open the Explorer ExplorerUIMap.EnterExplorerSearchText("Sql Bulk Insert Large View"); // Open the Workflow ExplorerUIMap.DoubleClickOpenProject("localhost", "UI TEST", "Sql Bulk Insert Large View"); var theTab = TabManagerUIMap.GetActiveTab(); //Select a database var dbDropDown = GetControlById("UI__Database_AutoID", theTab) as WpfComboBox; Mouse.Click(dbDropDown, new Point(10, 10)); WaitForControlLoad(); if (dbDropDown != null) { var listOfDbNames = dbDropDown.Items.Select(i => i as WpfListItem).ToList(); var databaseName = listOfDbNames.SingleOrDefault(i => i.DisplayText.Contains(TestingDb)); Mouse.Click(databaseName, new Point(5, 5)); } WaitForControlLoad(5000); //Select a table var tableDropDown = GetControlById("UI__TableName_AutoID", theTab) as WpfComboBox; Mouse.Click(tableDropDown, new Point(10, 10)); WaitForControlLoad(10000); if (tableDropDown != null) { var listOfTableNames = tableDropDown.Items.Select(i => i as WpfListItem).ToList(); WaitForControlLoad(); Mouse.Click(listOfTableNames[TableIndex], new Point(5, 5)); } WaitForControlLoad(5000); UITestControl controlOnWorkflow = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "DsfSqlBulkInsertActivity"); //Open the large view using context menu WorkflowDesignerUIMap.OpenCloseLargeViewUsingContextMenu(theTab, "DsfSqlBulkInsertActivity"); WaitForControlLoad(5000); //Enter a few mappings // THIS IS FAULTY LOGIC!!!! var getFirstTextbox = WorkflowDesignerUIMap.GetSqlBulkInsertLargeViewFirstInputTextbox(controlOnWorkflow); if (getFirstTextbox == null) { throw new Exception("Failed to Locate Text Box"); } Mouse.Click(getFirstTextbox); KeyboardCommands.SendKey("^a^xrecord().id"); KeyboardCommands.SendTab(); KeyboardCommands.SendKey("^a^xrecord().name"); KeyboardCommands.SendTab(); KeyboardCommands.SendKey("^a^xrecord().mail"); KeyboardCommands.SendTab(); WaitForControlLoad(); var batchSize = GetControlById("UI__BatchSize_AutoID", theTab); MouseCommands.ClickControlAtPoint(batchSize, new Point(5, 5)); KeyboardCommands.SendKey("^a^x-2"); var timeout = GetControlById("UI__Timeout_AutoID", theTab); MouseCommands.ClickControlAtPoint(timeout, new Point(5, 5)); KeyboardCommands.SendKey("^a^x-2"); var result = GetControlById("UI__Result_AutoID", theTab); MouseCommands.ClickControlAtPoint(result, new Point(5, 5)); KeyboardCommands.SendKey("^a^x-2"); var done = GetControlById("DoneButton", theTab); MouseCommands.ClickControlAtPoint(done, new Point(5, 5)); WaitForControlLoad(); var batchErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Batch size must be a number"); MouseCommands.MoveAndClick(new Point(batchErrorMessage.GetChildren()[0].BoundingRectangle.X + 5, batchErrorMessage.GetChildren()[0].BoundingRectangle.Y + 5)); KeyboardCommands.SendKey("^a^x200"); var timeoutErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Timeout must be a number"); MouseCommands.MoveAndClick(new Point(timeoutErrorMessage.GetChildren()[0].BoundingRectangle.X + 5, timeoutErrorMessage.GetChildren()[0].BoundingRectangle.Y + 5)); KeyboardCommands.SendKey("^a^x200"); MouseCommands.ClickControlAtPoint(done, new Point(5, 5)); batchErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Batch size must be a number"); timeoutErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Timeout must be a number"); Assert.IsNull(batchErrorMessage); Assert.IsNull(timeoutErrorMessage); }
public void ToolDesigners_RenameLargeView_TabOrderAndDestinationUserNameAndPassword_UiRepondingFine() { const string ToolName = "Rename"; const ToolType ToolType = ToolType.Rename; // Create the workflow RibbonUIMap.CreateNewWorkflow(); // Get some variables UITestControl theTab = TabManagerUIMap.GetActiveTab(); #region Test entering text into the textboxes //Enter test data into all the textboxes in the large view LargeViewUtilMethods.LargeViewTextboxesEnterTestData(ToolType, theTab); //Get all the textboxes off the large view List <UITestControl> allTextBoxesFromLargeView = LargeViewUtilMethods.GetAllTextBoxesFromLargeView(ToolName, theTab); //Click the done button LargeViewUtilMethods.ClickDoneButton(theTab, ToolName); //Get the first error control var errorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Password must have a value"); //Get the second error control var desErrorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Destination Password must have a value"); //Make sure that the error controls arnt null Assert.IsNotNull(errorControl, "The error didnt show up"); Assert.IsNotNull(desErrorControl, "The error didnt show up"); //Enter data into the password boxes LargeViewUtilMethods.EnterDataIntoPasswordBoxes(allTextBoxesFromLargeView); //Click the done button LargeViewUtilMethods.ClickDoneButton(theTab, ToolName); WorkflowDesignerUIMap.OpenCloseLargeView(ToolType, theTab); //Try get the error controls errorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Password must have a value"); desErrorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Destination Password must have a value"); //Make sure that the error controls are null Assert.IsNull(errorControl, "The error showed up"); Assert.IsNull(desErrorControl, "The error didnt showed up"); //Check each textbox contains the right text int counter = 0; foreach (var uiTestControl in allTextBoxesFromLargeView) { WpfEdit textbox = uiTestControl as WpfEdit; if (textbox != null && !textbox.IsPassword) { Assert.AreEqual("[[theVar" + counter.ToString(CultureInfo.InvariantCulture) + "]]", textbox.Text, "the wrong text was in the textbox"); } counter++; } #endregion #region Test tabbing //Set the focus into the first textbox allTextBoxesFromLargeView[0].SetFocus(); //Tab through the controlls int numberOfTabsToLastTextbox = 7; for (int i = 0; i < numberOfTabsToLastTextbox; i++) { KeyboardCommands.SendTab(50); } //Assert that the focus is in the last textbox Assert.IsTrue(allTextBoxesFromLargeView[allTextBoxesFromLargeView.Count - 1].HasFocus, "The tabbing is out of order"); #endregion }
public void ResizeAdornerMappingsOnDrop_Expected_AdornerMappingIsResized() { const string resourceToUse = "NewForeachUpgradeDifferentExecutionTests"; RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); // Get a point underneath the start button for the workflow // ReSharper disable ObjectCreationAsStatement new Point(theStartButton.BoundingRectangle.X - 100, // ReSharper restore ObjectCreationAsStatement theStartButton.BoundingRectangle.Y + 100); // Get a sample workflow ExplorerUIMap.DragResourceOntoWorkflowDesigner(theTab, resourceToUse, "INTEGRATION TEST SERVICES"); UITestControl controlOnWorkflow = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, resourceToUse, 100); Mouse.Click(controlOnWorkflow, new Point(5, 5)); 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.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."); } }