Beispiel #1
0
        public void DebugOutput_WhenRunWithOutputs_ContainsWorkflowInput()
        {
            try
            {
                //------------Setup for test--------------------------
                //Open the correct workflow
                ExplorerUIMap.DoubleClickWorkflow("TravsTestFlow", "Trav");

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

                // Check for valid input in the input boxes ;)

                RibbonUIMap.ClickDebug();

                DebugUIMap.ClickExecute();
                OutputUIMap.WaitForExecution(3000);
                UITestControl lastStep         = OutputUIMap.GetStep(1);
                string        workflowStepName = OutputUIMap.GetStepName(lastStep);
                Assert.AreEqual("TravsTestFlow", workflowStepName);
                Assert.IsTrue(OutputUIMap.AssertDebugOutputContains(lastStep, new[] { "Inputs :", "[[a]]", "=" }));
            }
            catch (Exception e)
            {
                Assert.Fail("It appears there is a debug issue. [ " + e.Message + " ]");
            }
        }
Beispiel #2
0
        public void DebugOutput_WhenRun10Times_NormalExecution_CloseTagsReturned10Times()
        {
            try
            {
                //------------Setup for test--------------------------
                //Open the correct workflow
                ExplorerUIMap.DoubleClickWorkflow("TravsTestFlow", "Trav");

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

                // Check for valid input in the input boxes ;)
                for (int i = 0; i < 9; i++)
                {
                    RibbonUIMap.ClickDebug();

                    DebugUIMap.ClickExecute();
                    OutputUIMap.WaitForExecution(3000);
                    UITestControl lastStep         = OutputUIMap.GetLastStep();
                    string        workflowStepName = OutputUIMap.GetStepName(lastStep);
                    Assert.AreEqual("TravsTestFlow", workflowStepName);
                }
            }
            catch (Exception e)
            {
                Assert.Fail("It appears there is a debug issue. [ " + e.Message + " ]");
            }
        }
Beispiel #3
0
        public void Debug_WhenUsingQuickDebugCommand_ExpectSavedInputsUsedInExecution()
        {
            // Remove the PersistSettings.dat ;)
            var appData     = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", "");
            var settingPath = Path.Combine(appData, @"Local\Warewolf\DebugData\PersistSettings.dat");

            if (File.Exists(settingPath))
            {
                File.Delete(settingPath);
            }

            //------------Setup for test--------------------------
            //Open the correct workflow
            ExplorerUIMap.DoubleClickWorkflow("Bug9394", "TestCategory");

            // prime the values ;)
            RibbonUIMap.ClickDebug();

            DebugUIMap.EnterTextIntoRow(0, "1");
            DebugUIMap.EnterTextIntoRow(1, "2");

            DebugUIMap.ClickExecute();
            OutputUIMap.WaitForExecution();
            RibbonUIMap.ClickDebug();
            DebugUIMap.CloseDebugWindow_ByCancel();
            //---------------Execute------------------------------
            SendKeys.SendWait(KeyboardCommands.QuickDebug);
            //------------Assert Results-------------------------
            OutputUIMap.WaitForExecution();
            UITestControl lastStep         = OutputUIMap.GetLastStep();
            string        workflowStepName = OutputUIMap.GetStepName(lastStep);

            Assert.AreEqual("Bug9394", workflowStepName);
        }
Beispiel #4
0
        public void CheckIfDebugProcessingBarIsShowingDurningExecutionExpectedToShowDuringExecutionOnly()
        {
            //Open the correct workflow
            ExplorerUIMap.DoubleClickWorkflow("LargeFileTesting", "TESTS");

            RibbonUIMap.ClickDebug();

            DebugUIMap.ClickExecute();

            var status   = OutputUIMap.GetStatusBarStatus();
            var spinning = OutputUIMap.IsSpinnerSpinning();

            Assert.AreEqual("Executing", status, "Debug output status text does not say executing when executing");
            Assert.IsTrue(spinning, "Debug output spinner not spinning during execution");
        }
Beispiel #5
0
        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.");
        }
Beispiel #6
0
        // Faulty DebugInput window
        public void DebugOutputWithRefreshOnBrowserExpectedDebugOutputWindowNotUpdated()
        {
            // Create a new workflow

            CreateWorkflow();

            UITestControl control = TabManagerUIMap.FindTabByName("Unsaved 1");

            if (control != null)
            {
                // Drag an assign onto the Design Surface and configure the control
                DockManagerUIMap.ClickOpenTabPage("Toolbox");
                ToolboxUIMap.DragControlToWorkflowDesigner("Assign", WorkflowDesignerUIMap.GetPointUnderStartNode(control));
                WorkflowDesignerUIMap.SetStartNode(control, "Assign");
                WorkflowDesignerUIMap.AssignControl_EnterData(control, "Assign", "[[test]]", "test");
                //Debug the workflow.
                RibbonUIMap.ClickRibbonMenuItem("Home", "Debug");
                DebugUIMap.ExecuteDebug();
                // Check the output tab for the debug data
                DockManagerUIMap.ClickOpenTabPage("Output");
                var ctrl = DebugOutputUIMap.GetOutputWindow();
                // View in Browser then refresh
                RibbonUIMap.ClickRibbonMenuItem("Home", "View in Browser");
                Thread.Sleep(1000);
                ExternalUIMap.SendIERefresh();
                // Close Internet Explorer
                ExternalUIMap.CloseAllInstancesOfIE();
                // Check that the Output window only contains the Compiler message for successful service compilation
                // As it always does on View in Browser
                DockManagerUIMap.ClickOpenTabPage("Output");
                UITestControlCollection actualOutputs = DebugOutputUIMap.GetOutputWindow();

                Assert.AreEqual(1, actualOutputs.Count);
            }
            else
            {
                Assert.Fail("Unable to create workflow to test Debug Output on Browser Refresh");
            }
            // All good - Cleanup time!
            new TestBase().DoCleanup("Unsaved 1", true);
        }
Beispiel #7
0
        public void DebugOutput_ClickStep_ActivityIsHighlighted()
        {
            //Create testing workflow
            RibbonUIMap.CreateNewWorkflow();
            var theTab = TabManagerUIMap.GetActiveTab();

            //Drag on multiassign
            UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start");
            var           thePoint       = new Point(theStartButton.BoundingRectangle.X + 30, theStartButton.BoundingRectangle.Y + 90);

            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, thePoint);

            WorkflowDesignerUIMap.AssignControl_ClickLeftTextboxInRow(theTab, "Assign", 0);

            //Set up multi assign
            SendKeys.SendWait("[[AssignThis]]{TAB}Some Data");

            //run and wait until debug output comes through
            RibbonUIMap.ClickRibbonMenuItem("Debug");
            PopupDialogUIMap.WaitForDialog();
            DebugUIMap.ClickExecute();
            OutputUIMap.WaitForExecution();

            //Click step
            var step = OutputUIMap.GetOutputWindow();

            Playback.Wait(1500);
            Mouse.Click(step[2]);
            Playback.Wait(100);
            Mouse.Click(step[1]);
            Playback.Wait(100);
            Mouse.Click(step[2]);
            Playback.Wait(100);

            //Assert the design surface activity is highlighted
            var assign = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Assign");

            Assert.IsTrue(WorkflowDesignerUIMap.IsControlSelected(assign),
                          "Selecting a step in the debug output does not select the activity on the design surface");
        }
Beispiel #8
0
        public void DebugOutput_WhenStopped_WaitsForRenderToCompleteBeforeStoppedMessage()
        {
            try
            {
                //------------Setup for test--------------------------
                //Open the correct workflow
                ExplorerUIMap.DoubleClickWorkflow("CodedUI_DebugOutputStop", "TESTS");
                string status = OutputUIMap.GetStatusBarStatus();
                Assert.AreEqual("Ready", status);
                UITestControl debugButton      = RibbonUIMap.ClickDebug();
                Point         debugButtonPoint = new Point(debugButton.BoundingRectangle.X + 5, debugButton.BoundingRectangle.Y + 5);
                DebugUIMap.ClickExecute(1500);
                MouseCommands.ClickPoint(debugButtonPoint, 500);

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

                status = OutputUIMap.GetStatusBarStatus();
                StringAssert.Contains(status, "Ready");
            }
            catch (Exception e)
            {
                Assert.Fail("It appears there is a debug issue. [ " + e.Message + " ]");
            }
        }
Beispiel #9
0
        public void DebugOutput_WhenUsingAColumnInput_ExecutesDataSplitCorrectly()
        {
            try
            {
                //------------Setup for test--------------------------

                ExplorerUIMap.DoubleClickWorkflow("12086", "Sprint12");

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



                RibbonUIMap.ClickDebug();

                DebugUIMap.ClickExecute();
                OutputUIMap.WaitForExecution(3000);
                UITestControl lastStep = OutputUIMap.GetLastStep();
                Assert.IsTrue(OutputUIMap.AssertDebugOutputContains(lastStep, new[] { "Outputs :", "[[moop]]", "=", "a" }));
            }
            catch (Exception e)
            {
                Assert.Fail("It appears there is a debug issue. [ " + e.Message + " ]");
            }
        }
Beispiel #10
0
        public void DebugInput_WhenRun10Times_ExpectInputsPersistAndXMLRemainsLinked_InputsAndXMLRemainPersisted()
        {
            // Remove the PersistSettings.dat ;)
            var appData     = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", "");
            var settingPath = Path.Combine(appData, @"Local\Warewolf\DebugData\PersistSettings.dat");

            if (File.Exists(settingPath))
            {
                File.Delete(settingPath);
            }

            //------------Setup for test--------------------------
            //Open the correct workflow
            ExplorerUIMap.DoubleClickWorkflow("Bug9394", "TestCategory");
            // prime the values ;)
            RibbonUIMap.ClickDebug();
            DebugUIMap.EnterTextIntoRow(0, "1");
            DebugUIMap.EnterTextIntoRow(1, "2");

            DebugUIMap.ClickExecute();
            OutputUIMap.WaitForExecution();

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

            // Check for valid input in the input boxes ;)
            for (int i = 0; i < 9; i++)
            {
                RibbonUIMap.ClickDebug();
                DebugUIMap.WaitForDebugWindow(7000);

                Assert.AreEqual("1", DebugUIMap.GetTextFromRow(0), "After executing " + i + " times the debug input dialog did not persist");
                Assert.AreEqual("2", DebugUIMap.GetTextFromRow(1), "After executing " + i + " times the debug input dialog did not persist");


                DebugUIMap.ClickExecute();
                OutputUIMap.WaitForExecution();
            }

            //Now check the XML tab works ;)

            RibbonUIMap.ClickDebug();
            DebugUIMap.ClickXMLTab();

            // flip back and forth to check persistence ;)
            DebugUIMap.ClickInputDataTab();
            DebugUIMap.ClickXMLTab();

            SendKeys.SendWait(KeyboardCommands.TabCommand);
            Playback.Wait(200);
            SendKeys.SendWait(KeyboardCommands.SelectAllCommand);
            Playback.Wait(200);
            Clipboard.Clear();
            SendKeys.SendWait(KeyboardCommands.CopyCommand);
            var actualXML = Clipboard.GetData(DataFormats.Text);

            actualXML = actualXML.ToString().Replace(Environment.NewLine, "").Replace(" ", "");

            //close the window ;)
            DebugUIMap.CloseDebugWindow_ByCancel();

            const string expectedXML = @"<DataList><countries><CountryID>1</CountryID><Description>2</Description></countries></DataList>";

            Assert.AreEqual(expectedXML, actualXML, "Got [ " + actualXML + " ]");
        }