//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 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."); } }
// 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 DebugBuriedErrors_Expected_OnlyErrorStepIsInError() { //Open the correct workflow ExplorerUIMap.EnterExplorerSearchText("Bug8372"); ExplorerUIMap.DoubleClickOpenProject("localhost", "TestCategory", "Bug8372"); // Run debug RibbonUIMap.ClickRibbonMenuItem("Debug"); PopupDialogUIMap.WaitForDialog(); DebugUIMap.ClickExecute(); OutputUIMap.WaitForExecution(); var result = OutputUIMap.IsAnyStepsInError(); // Get nested steps Assert.IsTrue(result, "Cannot see nested error steps in the debug output."); }
// Unstable public void DebugOutputWithLargeDataExpectedDebugOutputWindowUpdatedWithin5Seconds() { //Open LargeFileTesting workflow DockManagerUIMap.ClickOpenTabPage("Explorer"); ExplorerUIMap.ClearExplorerSearchText(); ExplorerUIMap.EnterExplorerSearchText("large"); ExplorerUIMap.DoubleClickOpenProject("localhost", "WORKFLOWS", "TESTS", "LargeFileTesting"); ExplorerUIMap.ClearExplorerSearchText(); //Click debug SendKeys.SendWait("{F5}"); Thread.Sleep(2000); SendKeys.SendWait("{F5}"); //Assert the debug output window is responsive after 5 seconds // Get data split step DockManagerUIMap.ClickOpenTabPage("Output"); DebugOutputUIMap.ClearSearch(); Mouse.Click(); Keyboard.SendKeys("Data Split"); var getSteps = DebugOutputUIMap.GetOutputWindow(); Assert.IsTrue(getSteps.Count == 1, "Debug output window took too long to respond"); var dataSplitDebugOutput = getSteps[0]; Assert.IsTrue(dataSplitDebugOutput.Exists, "Debug output window took too long to respond"); //Assert recset node expands and the more data link within that recset node is visible var expander = dataSplitDebugOutput.GetChildren().Last(c => c.ControlType.Name == "Expander"); Mouse.Move(expander, new Point(0, 0)); Mouse.Move(new Point(Mouse.Location.X + 5, Mouse.Location.Y + 5)); Mouse.Click(); Mouse.Move(new Point(Mouse.Location.X - 25, Mouse.Location.Y - 25)); Mouse.Click(); for (var i = 0; i < 4; i++) { Mouse.MoveScrollWheel(-1); } // Get more data link var moreLink = expander.GetChildren()[1].GetChildren().Last(c => c.Name == "..."); var moreLinkClickablePoint = new Point(); Assert.IsTrue(moreLink.TryGetClickablePoint(out moreLinkClickablePoint), "Recordset did not expand properly"); new TestBase().DoCleanup("LargeFileTesting"); }
public void DebugAWorkFlow_EnsureSaveIsEnabledAfterCompletion() { ExplorerUIMap.EnterExplorerSearchText("ServiceExecutionTest"); ExplorerUIMap.DoubleClickOpenProject("localhost", "TestCategory", "ServiceExecutionTest"); PopupDialogUIMap.WaitForDialog(); KeyboardCommands.SendKey("{F5}"); PopupDialogUIMap.WaitForDialog(); KeyboardCommands.SendKey("{F6}"); PopupDialogUIMap.WaitForDialog(); var uiControl = RibbonUIMap.GetControlByName("Save"); uiControl.WaitForControlReady(); Assert.IsTrue(uiControl.Enabled); }
// 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)); } }
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); }