예제 #1
0
        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");
        }
예제 #2
0
        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);
        }
예제 #3
0
        private List <WpfListItem> SelectItemOnComboBox(string autoId, UITestControl theTab)
        {
            var      selectedItems = new List <WpfListItem>();
            WpfTable middleBox     = WorkflowDesignerUIMap.AssignControl_GetSmallViewTable(theTab, autoId, 0);
            // Get the textbox
            var uiTestControlCollection = middleBox.Rows[0]
                                          .GetChildren()
                                          .SelectMany(c => c.GetChildren())
                                          .Where(c => c.ControlType == ControlType.ComboBox)
                                          .ToList();

            foreach (WpfComboBox dbDropDownControl in uiTestControlCollection)
            {
                Point pointOnDropDownControl = new Point(dbDropDownControl.BoundingRectangle.X + 25,
                                                         dbDropDownControl.BoundingRectangle.Y + 5);
                Mouse.Click(pointOnDropDownControl);
                Playback.Wait(1000); // Sorted with framework ;)
                var comboBoxList = dbDropDownControl.Items.Select(i => i as WpfListItem).ToList();
                var selectedItem = comboBoxList[1];
                selectedItems.Add(selectedItem);
                Mouse.Click(selectedItem, new Point(5, 5));
                Playback.Wait(1000); // Sorted with framework ;)
            }
            return(selectedItems);
        }
예제 #4
0
        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");
        }
예제 #5
0
        UITestControl GetControlByFriendlyName(string name)
        {
            var sqlBulkInsert  = WorkflowDesignerUIMap.FindControlByAutomationId(TabManagerUIMap.GetActiveTab(), "SqlBulkInsertDesigner");
            var uiTestControls = WorkflowDesignerUIMap.GetSqlBulkInsertChildren(sqlBulkInsert);

            return(uiTestControls.FirstOrDefault(c => c.FriendlyName.Contains(name)));
        }
예제 #6
0
        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++;
            }
        }
예제 #7
0
        /// <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);
        }
예제 #8
0
        public void PluginServiceTests_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, "DummyService");

            using (DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false)
            {
                Activity = service, TheTab = theTab
            })
            {
                activityUiMap.ClickEdit();
                //Wizard actions
                PluginServiceWizardUIMap.ClickMappingTab();
                PluginServiceWizardUIMap.EnterDataIntoMappingTextBox(3, newMapping);
                PluginServiceWizardUIMap.ClickSaveButton(1);
                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());
            }
        }
예제 #9
0
        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");
        }
예제 #10
0
        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);
        }
예제 #11
0
        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());
            }
        }
예제 #12
0
        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");
            }
        }
예제 #13
0
        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.");
            }
        }
예제 #14
0
        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]]");
        }
예제 #15
0
        public void AutoConnectorTests_DragActivityOnStartAutoConnectorNode_AConnectorIsCreated()
        {
            UITestControl theTab = CreateWorkflow();

            ExplorerUIMap.DragResourceOntoWorkflowDesigner(theTab, "Email Service", "Integration Test Resources");
            //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
            List <UITestControl> connectors = WorkflowDesignerUIMap.GetAllConnectors();

            //Assert start auto connector worked
            Assert.AreEqual(1, connectors.Count, "Start auto connector was not created");
        }
예제 #16
0
        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 ToolDesigners_ForEach_DraggingSwitch_NotAllowed()
        {
            using (var dsfActivityUiMap = new DsfForEachUiMap(false, false)
            {
                TheTab = RibbonUIMap.CreateNewWorkflow(2000)
            })
            {
                Point pointToDragTo = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(dsfActivityUiMap.TheTab);
                dsfActivityUiMap.Activity = ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.ForEach, dsfActivityUiMap.TheTab, pointToDragTo);
                dsfActivityUiMap.DragActivityOnDropPoint(ToolType.Switch);

                var forEachActivity = dsfActivityUiMap.GetActivity();
                Assert.IsNull(forEachActivity);
            }
        }
예제 #18
0
        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());
        }
예제 #19
0
        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));
        }
예제 #20
0
        // 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);
            }
        }
예제 #21
0
        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");
        }
예제 #22
0
        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 ToolDesigners_SequenceSmallView_DraggingNonDecision_Allowed()
        {
            Mouse.MouseDragSpeed = 500;

            using (var dsfActivityUiMap = new DsfSequenceUiMap(false, false)
            {
                TheTab = RibbonUIMap.CreateNewWorkflow(2000)
            })
            {
                Point pointToDragTo = WorkflowDesignerUIMap.GetStartNodeBottomAutoConnectorPoint(dsfActivityUiMap.TheTab);
                dsfActivityUiMap.Activity = ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Sequence, dsfActivityUiMap.TheTab, pointToDragTo);
                dsfActivityUiMap.DragActivityOnDropPoint(ToolType.Assign);

                var activityList = dsfActivityUiMap.GetActivityList();
                Assert.AreEqual(1, activityList.Count);
            }
        }
예제 #24
0
        private bool VerifySelectedItems(string autoId, UITestControl theTab, List <WpfListItem> selectedItems)
        {
            bool     isValid   = false;
            WpfTable middleBox = WorkflowDesignerUIMap.AssignControl_GetSmallViewTable(theTab, autoId, 0);
            // Get the textbox
            var uiTestControlCollection = middleBox.Rows[0]
                                          .GetChildren()
                                          .SelectMany(c => c.GetChildren())
                                          .Where(c => c.ControlType == ControlType.ComboBox)
                                          .ToList();

            foreach (WpfComboBox dbDropDownControl in uiTestControlCollection)
            {
                isValid = selectedItems.Select(i => i.DisplayText).Contains(dbDropDownControl.SelectedItem);
            }

            return(isValid);
        }
예제 #25
0
        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");
            }
        }
예제 #26
0
        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));
        }
예제 #27
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)"));
        }
예제 #28
0
        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");
        }
예제 #29
0
        // 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);
        }
예제 #30
0
        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 ;(");
        }