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++; } }
// 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 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 ClickCloseLargeView() { WorkflowDesignerUIMap.OpenCloseLargeView(Activity); }
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 }