상속: UIMapBase
예제 #1
0
        public void DragASwitchIntoForEachExpectNotAddedToForEach()
        {
            // 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, 20);

            // Drag a ForEach onto the Workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.ForEach, workflowPoint1, "For Each");

            // Open the toolbox, and drag the control onto the Workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Switch, requiredPoint);
            // Cancel Decision Wizard
            if (WizardsUIMap.TryWaitForWizard(3000))
            {
                KeyboardCommands.SendTab();
                KeyboardCommands.SendTab();
                KeyboardCommands.SendEnter(100);

                Assert.Fail("Got dropped ;(");
            }
        }
예제 #2
0
        // 05/11 - Failure is Intermittent ;)
        public void DecisionWizard_Save_WhenMouseUsedToSelect2ndAnd3rdInputFields_FieldDataSavedCorrectly()
        {
            //------------Setup for test--------------------------
            RibbonUIMap.CreateNewWorkflow();

            var theTab = TabManagerUIMap.GetActiveTab();

            //------------Execute Test---------------------------
            VariablesUIMap.EnterTextIntoScalarName(0, "VariableName");

            var pt = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab);

            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, pt);
            WizardsUIMap.WaitForWizard();
            Assert.AreEqual("Decision Flow", WizardsUIMap.GetLeftTitleText());
            _decisionWizardUiMap.SendTabs(5, 500);
            _decisionWizardUiMap.SelectMenuItem(17, 100); // select between ;)

            _decisionWizardUiMap.SendTabs(11, 500);
            _decisionWizardUiMap.GetFirstIntellisense("[[V", false, new Point(100, 120));

            _decisionWizardUiMap.SendTabs(2, 500);
            _decisionWizardUiMap.GetFirstIntellisense("[[V", false, new Point(400, 120));
            _decisionWizardUiMap.SendTabs(1, 500);
            _decisionWizardUiMap.GetFirstIntellisense("[[V", false, new Point(600, 120));

            _decisionWizardUiMap.SendTabs(6, 500);
            KeyboardCommands.SendEnter();

            //------------Assert Results-------------------------

            const string expected = "If [[VariableName]] Is Between [[VariableName]] and [[VariableName]]";

            var getDecision = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "FlowDecisionDesigner");

            getDecision.WaitForControlEnabled();
            var getDecisionText = getDecision.GetChildren()[0] as WpfEdit;

            if (getDecisionText != null)
            {
                var displayValue = getDecisionText.Text;

                Assert.AreEqual(expected, displayValue,
                                "Decision intellisense doesnt work when using the mouse to select intellisense results");
            }
            else
            {
                Assert.Fail("Null decision");
            }
        }
예제 #3
0
        public void Decision_Intellisense_KeyboardSelect_DecisionTitleUpdatesCorrectly()
        {
            RibbonUIMap.CreateNewWorkflow();
            UITestControl theTab = TabManagerUIMap.GetActiveTab();

            VariablesUIMap.ClickScalarVariableName(0);
            SendKeys.SendWait("VariableName");

            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, WorkflowDesignerUIMap.GetPointUnderStartNode(theTab));
            Playback.Wait(5000);
            //------------Execute Test---------------------------
            _decisionWizardUiMap.SendTabs(5, 1000);
            _decisionWizardUiMap.SelectMenuItem(17, 2000);
            _decisionWizardUiMap.SendTabs(11, 1000);

            //First field
            _decisionWizardUiMap.GetFirstIntellisense("[[V");
            _decisionWizardUiMap.SendTabs(2, 1000);

            //Second field
            _decisionWizardUiMap.GetFirstIntellisense("[[V");
            _decisionWizardUiMap.SendTabs(1, 1000);

            //Third field
            _decisionWizardUiMap.GetFirstIntellisense("[[V");
            _decisionWizardUiMap.SendTabs(6, 1000);

            //Wait for wizard to close
            KeyboardCommands.SendEnter(1500);

            // Assert Decision Title Updates Correctly
            const string Expected = "If [[VariableName]] Is Between [[VariableName]] and [[VariableName]]";

            var getDecision     = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "FlowDecisionDesigner");
            var getDecisionText = getDecision.GetChildren()[0] as WpfEdit;

            if (getDecisionText != null)
            {
                var displayValue = getDecisionText.Text;

                Assert.AreEqual(Expected, displayValue, "Decision intellisense doesnt work when using the keyboard to select intellisense results");
            }
            else
            {
                Assert.Fail();
            }
        }
예제 #4
0
        public void CopyDecisionsWithContextMenuAndPasteExpectedNoWizardsDisplayed()
        {
            //Initialize
            Clipboard.SetText(" ");
            RibbonUIMap.CreateNewWorkflow();
            UITestControl theTab = TabManagerUIMap.GetActiveTab();

            //Drag on two decisions
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, WorkflowDesignerUIMap.GetPointUnderStartNode(theTab));
            WizardsUIMap.WaitForWizard();

            _decisionWizardUiMap.HitDoneWithKeyboard();
            var newPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab);

            newPoint.Y = newPoint.Y + 200;

            var clickPoint = new Point(newPoint.X, newPoint.Y);

            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, newPoint);
            WizardsUIMap.WaitForWizard(7000);

            _decisionWizardUiMap.HitDoneWithKeyboard();

            //Rubber-band select them
            var startDragPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab);

            startDragPoint.X = startDragPoint.X - 100;
            startDragPoint.Y = startDragPoint.Y - 100;
            Mouse.Move(startDragPoint);
            newPoint.X = newPoint.X + 100;
            newPoint.Y = newPoint.Y + 100;
            Mouse.StartDragging();
            Mouse.StopDragging(newPoint);
            startDragPoint.X = startDragPoint.X + 150;
            startDragPoint.Y = startDragPoint.Y + 150;
            Mouse.Click(MouseButtons.Right, ModifierKeys.None, clickPoint);
            var designSurface = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab);

            SendKeys.SendWait("{DOWN}{DOWN}{ENTER}");
            Mouse.Click(designSurface);
            SendKeys.SendWait("^v");
            UITestControl uIItemImage = DatabaseServiceWizardUIMap.UIBusinessDesignStudioWindow.GetChildren()[0].GetChildren()[0];

            // Assert
            Assert.AreEqual("System Menu Bar", uIItemImage.FriendlyName);
        }