Inheritance: ActivityUiMapBase
Esempio n. 1
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");
            }
        }
Esempio n. 2
0
        public void WebServiceTests_CodedUI_EditService_ExpectErrorButton()
        {
            var newMapping = "ZZZ" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 6);

            UITestControl theTab = ExplorerUIMap.DoubleClickWorkflow("ErrorFrameworkTestWorkflow", "UI TEST");

            UITestControl service = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "FetchCities");

            using(DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false) { Activity = service, TheTab = theTab })
            {
                activityUiMap.ClickEdit();

                //Wizard actions
                WebServiceWizardUIMap.ClickMappingTab();
                WebServiceWizardUIMap.EnterDataIntoMappingTextBox(6, newMapping);
                WebServiceWizardUIMap.TabToSaveButton(2);

                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());
            }
        }
Esempio n. 3
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());

            }
        }
 public void DsfActivityTests_CodedUI_GetAServiceWilALongDisplayName_TheDisplayNameBoxWidthSizeWillBe174()
 {
     using(var dsfActivityUiMap = new DsfActivityUiMap())
     {
         dsfActivityUiMap.DragWorkflowOntoDesigner("this name is so long the display name", "TEST");
         dsfActivityUiMap.ClickCloseMapping();
         Assert.AreEqual(178, dsfActivityUiMap.GetDisplayNameMaxWidth());
     }
 }
 public void RemoteServerUITests_EditRemoteWorkFlow_WorkflowIsEdited()
 {
     UITestControl tab = ExplorerUIMap.DoubleClickWorkflow("Find Records", "TESTS", RemoteServerName);
     using(ActivityUiMapBase activityUiMapBase = new DsfActivityUiMap(false))
     {
         activityUiMapBase.TheTab = tab;
         activityUiMapBase.DragToolOntoDesigner(ToolType.Assign);
         var activeTabName = TabManagerUIMap.GetActiveTabName();
         StringAssert.Contains(activeTabName, "Find Records - Remote Connection Integration *");
     }
 }
Esempio n. 6
0
        public void SetRoundingType_None_ExpectedRoundingInputIsDisabled()
        {
            DsfActivityUiMap activityUiMap = new DsfActivityUiMap();
            activityUiMap.DragToolOntoDesigner(ToolType.FormatNumber);

            FormatNumberUIMap.SetFormatNumberControl(activityUiMap.Activity);
            FormatNumberUIMap.InputNumber("1234.56");
            FormatNumberUIMap.SelectRoundingType("None");
            FormatNumberUIMap.InputDecimalsToShow("3");
            FormatNumberUIMap.InputResult("[[Result]]");
            Assert.IsFalse(FormatNumberUIMap.IsRoundingInputEnabled());
        }
        public void DsfActivityTests_CodedUI_SetInitialFocusElementIfNoInputs_HelpTextIsNotEmpty()
        {
            const string expectedHelpText = @"Only variables go in here.
Insert the variable that you want the output of the workflow to be mapped into. By default similar matches from the variable list are used where possible.
You can use [[Scalar]] as well as [[Recordset().Fields]].
Using recordset () will add a new record and (*) will assign every record.";

            using(var dsfActivityUiMap = new DsfActivityUiMap())
            {

                dsfActivityUiMap.DragWorkflowOntoDesigner("Sql Bulk Insert Test", "TEST");
                Playback.Wait(500);
                dsfActivityUiMap.ClickHelp();
                string actualHelpText = dsfActivityUiMap.GetHelpText();
                Assert.AreEqual(expectedHelpText, actualHelpText);
            }
        }
        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");
            }
        }
        // Properly broken functionality
        public void DesignTimeErrorHandling_DesignTimeErrorHandlingUITest_FixErrorsButton_UserIsPromptedToAddRequiredDbServiceMappings()
        {
            const string workflowResourceName = "DesignTimeErrorHandlingRequiredMappingUITest";
            const string dbResourceName = "UserIsPromptedToAddRequiredDbServiceMappingsTest";

            // Open the Workflow
            UITestControl theTab = ExplorerUIMap.DoubleClickWorkflow(workflowResourceName, "UI TEST");

            // Edit the DbService
            ExplorerUIMap.DoubleClickService(dbResourceName, "INTEGRATION TEST SERVICES");

            // Get wizard window
            DatabaseServiceWizardUIMap.ClickMappingTab(550); // over-ride cuz silly chickens like long names in test ;(

            //set the first input to required
            KeyboardCommands.SendTabs(2, 50);
            KeyboardCommands.SendSpace();

            // Save
            KeyboardCommands.SendTabs(4, 250);
            KeyboardCommands.SendEnter();
            ResourceChangedPopUpUIMap.ClickCancel();

            UITestControl activity = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, dbResourceName);

            using(DsfActivityUiMap activityUiMap = new DsfActivityUiMap(false) { TheTab = theTab, Activity = activity })
            {

                Assert.IsTrue(activityUiMap.IsFixErrorButtonShowing(), "'Fix Errors' button not visible");

                activityUiMap.ClickFixErrors();
                KeyboardCommands.SendKey("[[Name]]", 25);

                activityUiMap.ClickCloseMapping();
                Assert.IsFalse(activityUiMap.IsFixErrorButtonShowing(), "'Fix Errors' button is still visible");
            }
        }
Esempio n. 10
0
        public void WizardUiTests_WebServiceWizard_WebServiceInputMappingsCase2_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]]");
            KeyboardCommands.SendTabs(2, tabWait);
            KeyboardCommands.SendEnter(8000);
            KeyboardCommands.SendTabs(1, tabWait);
            KeyboardCommands.SendEnter(5000); // Test
            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");
            }
        }
Esempio n. 11
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);
            }
        }
Esempio n. 12
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));
            }
        }
        [Ignore] // Does not work over RDP / Inconsistent results
        public void RemoteServerUITests_AddRenameAndDeleteARemoteWorkFlow_CompletesSuccessfully()
        {
            const string CategoryName = "Unassigned";

            //CREATE A WORKFLOW
            using(DsfActivityUiMap activityUiMap = new DsfActivityUiMap())
            {
                activityUiMap.DragToolOntoDesigner(ToolType.Assign);

                //SAVE A WORKFLOW
                RibbonUIMap.ClickSave();
                string InitialName = Guid.NewGuid().ToString();
                SaveDialogUIMap.ClickAndTypeInNameTextbox(InitialName);

                //RENAME A WORKFLOW
                string RenameTo = Guid.NewGuid().ToString();
                ExplorerUIMap.RightClickRenameResource(InitialName, CategoryName, RenameTo, RemoteServerName);

                //DELETE A WORKFLOW
                ExplorerUIMap.RightClickDeleteResource(RenameTo, CategoryName, RemoteServerName);
                Assert.IsFalse(ExplorerUIMap.ValidateServiceExists(RenameTo, CategoryName, RemoteServerName));
            }

        }
        public void RemoteServerUITests_DragAndDropWorkflowFromRemoteServerOnALocalHostCreatedWorkflow_WorkFlowIsDroppedAndCanExecute()
        {
            const string remoteWorkflowName = "MyLocalWF";

            //Ensure that we're in localhost
            ExplorerUIMap.ClickServerInServerDDL(LocalHostServerName);

            //Create new workflow and drag a remote workflow onto it
            using(DsfActivityUiMap activityUiMap = new DsfActivityUiMap())
            {
                activityUiMap.DragWorkflowOntoDesigner(remoteWorkflowName, "TestCategory", RemoteServerName);

                //Should be able to get clean debug output
                RibbonUIMap.DebugShortcutKeyPress();
                OutputUIMap.WaitForExecution();

                //Assert that the workflow really is on the design surface and debug output is clean
                Assert.IsFalse(OutputUIMap.IsAnyStepsInError(), "The remote workflow threw errors when executed locally");
                Assert.IsNotNull(activityUiMap.Activity);
            }
        }