public void RemoteServerUITests_EditRemoteWebSource_WebSourceIsEdited()
        {
            const string TextToSearchWith = "Dev2GetCountriesWebService";

            //Edit remote web source
            ExplorerUIMap.DoubleClickSource(TextToSearchWith, "WEB SRC", RemoteServerName);

            var actualLeftTitleText  = WebSourceWizardUIMap.GetLeftTitleText();
            var actualRightTitleText = WebSourceWizardUIMap.GetRightTitleText();

            Assert.AreEqual("Edit - Dev2GetCountriesWebService", actualLeftTitleText);
            Assert.AreEqual(remoteConnectionString, actualRightTitleText);

            WebSourceWizardUIMap.EnterTextIntoWizardTextBox(3, "?extension=json&prefix=b");
            WebSourceWizardUIMap.PressButtonOnWizard(3);
            SaveDialogUIMap.ClickSave();

            //Change it back
            ExplorerUIMap.DoubleClickSource(TextToSearchWith, "WEB SRC", RemoteServerName);
            //Get textbox text
            var persistClipboard = Clipboard.GetText();

            KeyboardCommands.SendTabs(3);
            WebSourceWizardUIMap.PressCtrlC();
            WebSourceWizardUIMap.EnterTextIntoWizardTextBox(0, "?extension=json&prefix=a");
            WebSourceWizardUIMap.PressButtonOnWizard(3);
            string query = Clipboard.GetText();

            Clipboard.SetText(persistClipboard);
            SaveDialogUIMap.ClickSave();

            Assert.AreEqual("?extension=json&prefix=b", query, "Cannot change remote web source");
        }
        public void RemoteServerUITests_EditRemoteEmailSource_EmailSourceIsEdited()
        {
            var          emailServer      = TestUtils.StartEmailServer();
            var          machineName      = Environment.MachineName;
            const string TextToSearchWith = "EmailSource";

            //Edit remote email source
            ExplorerUIMap.DoubleClickSource(TextToSearchWith, "REMOTETESTS", RemoteServerName);

            var actualLeftTitleText  = EmailSourceWizardUIMap.GetLeftTitleText();
            var actualRightTitleText = EmailSourceWizardUIMap.GetRightTitleText();

            Assert.AreEqual("Edit - EmailSource", actualLeftTitleText);
            Assert.AreEqual(remoteConnectionString, actualRightTitleText);


            //Change Timeout
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(1, machineName);
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(5, "1234");
            //Test Email Source
            EmailSourceWizardUIMap.PressButtonOnWizard(1, 1000);
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(0, "@gmail.com");
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(1, "*****@*****.**");
            EmailSourceWizardUIMap.PressButtonOnWizard(1, 5000);
            EmailSourceWizardUIMap.PressButtonOnWizard(8);
            SaveDialogUIMap.ClickSave();

            //Change it back
            ExplorerUIMap.DoubleClickSource(TextToSearchWith, "REMOTETESTS", RemoteServerName);
            //Get the Timeout text
            var persistClipboard = Clipboard.GetText();

            EmailSourceWizardUIMap.SendTabsForWizard(6);
            EmailSourceWizardUIMap.PressCtrlC();
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(0, "100");
            EmailSourceWizardUIMap.PressButtonOnWizard(1);
            string timeout = Clipboard.GetText();

            Clipboard.SetText(persistClipboard);

            //Test Email Source
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(0, "@gmail.com");
            EmailSourceWizardUIMap.EnterTextIntoWizardTextBox(1, "*****@*****.**");
            EmailSourceWizardUIMap.PressButtonOnWizard(1, 5000);
            EmailSourceWizardUIMap.PressButtonOnWizard(8);
            SaveDialogUIMap.ClickSave();

            //Assert remote email source changed its timeout
            Assert.AreEqual("1234", timeout, "Cannot edit remote email source");

            TestUtils.StopEmailServer(emailServer);
        }
        public void RemoteServerUITests_EditRemotePluginSource_PluginSourceIsEdited()
        {
            // NOTE :
            // Requires a Plugin Directory on server with :
            // Plugins\PrimativesTestDLL.dll
            // And Plugins\PrimativesTestDLL - Copy.dll

            const string TextToSearchWith = "PluginSource";

            //Edit remote plugin source
            ExplorerUIMap.DoubleClickSource(TextToSearchWith, "REMOTETESTS", RemoteServerName);

            var actualLeftTitleText  = PluginSourceMap.GetLeftTitleText();
            var actualRightTitleText = PluginSourceMap.GetRightTitleText();

            Assert.AreEqual("Edit - PluginSource", actualLeftTitleText);
            Assert.AreEqual(remoteConnectionString, actualRightTitleText);

            KeyboardCommands.SendTabs(2, 250);
            KeyboardCommands.SelectAll();
            KeyboardCommands.SendDel();
            KeyboardCommands.SendKey("Plugins\\PrimativesTestDLL - Copy.dll");
            PluginServiceWizardUIMap.PressButtonOnWizard(1);
            SaveDialogUIMap.ClickSave();

            // Change it back
            ExplorerUIMap.DoubleClickSource(TextToSearchWith, "REMOTETESTS", RemoteServerName);
            KeyboardCommands.SendTabs(2, 250);
            KeyboardCommands.SelectAll();

            // get the path to see what it saved as ;)
            var path = KeyboardCommands.SendCopy();

            KeyboardCommands.SendDel();
            KeyboardCommands.SendKey("Plugins\\PrimativesTestDLL.dll");
            PluginServiceWizardUIMap.PressButtonOnWizard(1);
            SaveDialogUIMap.ClickSave();

            Assert.AreEqual(path, @"Plugins\PrimativesTestDLL - Copy.dll", "Cannot change remote plugin source");
        }
        public void RemoteServerUITests_EditRemoteDbSource_DbSourceIsEdited()
        {
            // NOTE : Needs to use Dev2TestingDB

            const string TextToSearchWith = "DBSource";
            string       userName;

            try
            {
                //Edit remote db source
                ExplorerUIMap.DoubleClickSource(TextToSearchWith, "REMOTETESTS", RemoteServerName);

                var actualLeftTitleText  = DatabaseSourceUIMap.GetLeftTitleText();
                var actualRightTitleText = DatabaseSourceUIMap.GetRightTitleText();

                Assert.AreEqual("Edit - DBSource", actualLeftTitleText);
                Assert.AreEqual(remoteConnectionString, actualRightTitleText);

                DatabaseSourceUIMap.EnterUsernameAndPassword("testuser2", "pass1234");
                DatabaseSourceUIMap.TestConnection();
                Playback.Wait(5000);
                DatabaseSourceUIMap.ClickSaveDbConnectionFromTestConnection();

                SaveDialogUIMap.ClickSave();
            }
            finally
            {
                //Change it back
                ExplorerUIMap.DoubleClickSource(TextToSearchWith, "REMOTETESTS", RemoteServerName);
                userName = DatabaseSourceUIMap.GetUserName();

                DatabaseSourceUIMap.EnterUsernameAndPassword("testuser", "test123");
                DatabaseSourceUIMap.TestConnection();
                Playback.Wait(5000);
                DatabaseSourceUIMap.ClickSaveDbConnectionFromTestConnection();
                SaveDialogUIMap.ClickSave();
            }

            Assert.AreEqual("testuser2", userName, "Cannot edit remote db source");
        }