Пример #1
0
        public void WizardUiTests_WebServiceWizard_WebServiceInputMappingsDeleteAll_ExpectedNoInputMappings()
        {
            string    newGuid           = Guid.NewGuid().ToString();
            string    remove            = newGuid.Remove(8);
            string    newWebserviceName = "WebService" + remove;
            const int WaitMs            = 50;

            //Open wizard
            RibbonUIMap.ClickNewWebService();
            KeyboardCommands.SendTabs(2, WaitMs);
            KeyboardCommands.SendDownArrows(1, WaitMs);
            KeyboardCommands.SendTabs(8, WaitMs);
            KeyboardCommands.SendDownArrows(1, WaitMs);
            KeyboardCommands.SendTabs(4, WaitMs);
            KeyboardCommands.SendDel();
            KeyboardCommands.SendTabs(2, WaitMs);
            KeyboardCommands.SendEnter(5000);
            KeyboardCommands.SendTabs(1, WaitMs);
            KeyboardCommands.SendEnter(1000);
            KeyboardCommands.SendTabs(3, WaitMs);
            KeyboardCommands.SendKey(newWebserviceName, WaitMs);
            KeyboardCommands.SendTabs(1, WaitMs);
            KeyboardCommands.SendEnter(2000);

            UITestControl theTab          = RibbonUIMap.CreateNewWorkflow(1500);
            UITestControl activityControl = ExplorerUIMap.DragResourceOntoWorkflowDesigner(theTab, newWebserviceName, "Unassigned");

            using (var activity = new DsfActivityUiMap(false)
            {
                Activity = activityControl, TheTab = theTab
            })
            {
                Assert.AreEqual(0, activity.GetInputMappingRows().Count);
            }
        }
Пример #2
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");
        }
Пример #3
0
        public void WizardUiTests_WebServiceWizard_WebServiceInputMappings_ExpectedInputMappingsCreated()
        {
            string newGuid           = Guid.NewGuid().ToString();
            string remove            = newGuid.Remove(8);
            string newWebserviceName = "WebService" + remove;

            //Open wizard
            const int tabWait = 200;

            RibbonUIMap.ClickNewWebService();
            KeyboardCommands.SendTabs(2, tabWait);
            KeyboardCommands.SendDownArrows(1);
            KeyboardCommands.SendTabs(8, tabWait);
            KeyboardCommands.SendDownArrows(1); // first resource is faulty, we need the second ;)
            KeyboardCommands.SendTabs(4, tabWait);
            KeyboardCommands.SelectAllText();
            KeyboardCommands.SendDel();
            KeyboardCommands.SendKey("?[[a]]=[[b]][[c]]&[[d]]=[[f]]");
            KeyboardCommands.SendLeftArrows(2);
            KeyboardCommands.SendKey("e");
            KeyboardCommands.SendTabs(2, tabWait);
            KeyboardCommands.SendEnter(8000);
            KeyboardCommands.SendTabs(1, tabWait); // Test
            KeyboardCommands.SendEnter(5000);
            KeyboardCommands.SendTabs(3, tabWait);
            KeyboardCommands.SendKey(newWebserviceName);
            KeyboardCommands.SendTabs(1, tabWait);
            KeyboardCommands.SendEnter(2000);

            UITestControl theTab          = RibbonUIMap.CreateNewWorkflow(1500);
            UITestControl activityControl = ExplorerUIMap.DragResourceOntoWorkflowDesigner(theTab, newWebserviceName, "Unassigned");

            using (var activity = new DsfActivityUiMap(false)
            {
                Activity = activityControl, TheTab = theTab
            })
            {
                StringAssert.Contains(activity.GetInputMappingToServiceValue(1), "a");
                StringAssert.Contains(activity.GetInputMappingToServiceValue(2), "b");
                StringAssert.Contains(activity.GetInputMappingToServiceValue(3), "c");
                StringAssert.Contains(activity.GetInputMappingToServiceValue(4), "d");
                StringAssert.Contains(activity.GetInputMappingToServiceValue(5), "fe");
            }
        }
Пример #4
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");
        }
Пример #5
0
        public void WizardUiTests_WebServiceWizard_WebServiceInputMappingsCase3_ExpectedInputMappingsCreated()
        {
            string newGuid           = Guid.NewGuid().ToString();
            string remove            = newGuid.Remove(8);
            string newWebserviceName = "WebService" + remove;

            //Open wizard
            RibbonUIMap.ClickNewWebService();
            KeyboardCommands.SendTabs(2);
            KeyboardCommands.SendDownArrows(1);
            KeyboardCommands.SendTabs(8);
            KeyboardCommands.SendDownArrows(1);
            KeyboardCommands.SendTabs(4);
            KeyboardCommands.SelectAllText();
            KeyboardCommands.SendKey("[[foobar]]?a=[[a]]");
            KeyboardCommands.SendTabs(2);
            KeyboardCommands.SendEnter(5000);
            KeyboardCommands.SendTabs(1);
            KeyboardCommands.SendEnter(1000);
            KeyboardCommands.SendTabs(3);
            KeyboardCommands.SendKey(newWebserviceName);
            KeyboardCommands.SendTabs(1);
            KeyboardCommands.SendEnter(2000);

            UITestControl theTab          = RibbonUIMap.CreateNewWorkflow(1500);
            UITestControl activityControl = ExplorerUIMap.DragResourceOntoWorkflowDesigner(theTab, newWebserviceName, "Unassigned");

            using (var activity = new DsfActivityUiMap(false)
            {
                Activity = activityControl, TheTab = theTab
            })
            {
                Assert.AreEqual("a", activity.GetInputMappingToServiceValue(1));
                Assert.AreEqual("foobar", activity.GetInputMappingToServiceValue(2));
            }
        }
Пример #6
0
        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.");
            }
        }
Пример #7
0
 public void DragServiceOntoDesigner(string serviceName, string categoryName, string serverName = "localhost", Point pointToDragTo = new Point())
 {
     Activity = ExplorerUIMap.DragResourceOntoWorkflowDesigner(TheTab, serviceName, categoryName, serverName, pointToDragTo);
 }