示例#1
0
        public void WizardUiTests_EmailSourceWizard_CreateNewSource_ExpectedSourceCreated()
        {
            //Initialization
            var startEmailServer = TestUtils.StartEmailServer();

            var sourceName = Guid.NewGuid().ToString().Substring(0, 5);
            var name       = "codeduitest" + sourceName;

            //Open wizard
            EmailSourceWizardUIMap.OpenWizard();

            Assert.AreEqual("New Email Source", WizardsUIMap.GetLeftTitleText());
            Assert.AreEqual("localhost (http://localhost:3142/dsf)", WizardsUIMap.GetRightTitleText());

            //Create Email Source
            EmailSourceWizardUIMap.CreateEmailSource(name);

            // clean up ;)
            Bootstrap.DeleteSource(sourceName);

            //Assert
            Assert.IsTrue(ExplorerUIMap.ValidateSourceExists(name, "Unassigned"), "Email source was not created.");

            TestUtils.StopEmailServer(startEmailServer);
        }
示例#2
0
        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);
        }