Exemple #1
0
        private static void RunTypicalInstall(IWebDriver driver)
        {
            driver.Navigate().GoToUrl(StartPage);

            driver.WaitSendKeys(Password, "dnnhost");
            driver.WaitSendKeys(ConfirmPassword, "dnnhost");

            driver.WaitClick(ContinueButton);

            for (int i = 0; i < 201; i++)
            {
                try
                {
                    if (driver.FindElement(InstallStatus).Text.Contains("ERROR"))
                    {
                        Assert.Fail("Error found on install");
                    }

                    if (i > 200)
                    {
                        Assert.Fail("Install Took longer than 5 minutes");
                    }

                    if (!driver.FindElement(VisitSiteButton).GetAttribute("Class").Contains("dnnDisabledAction"))
                    {
                        break;
                    }
                }
                catch (NoSuchElementException) {}

                Thread.Sleep(1000);
            }

            driver.WaitClick(VisitSiteButton);

            int oldTimeout = Common.DriverTimeout;

            Common.DriverTimeout = 120000;

            driver.WaitClick(LetMeAtItButton);

            SiteSettings.DisablePopups(driver);

            SiteManagement.SwitchToNewPortal(driver, "TestPortal");

            driver.WaitClick(LetMeAtItButton);

            Common.DriverTimeout = oldTimeout;

            Login.AsHost(driver);

            Assert.That(driver.FindDnnElement(CurrentUserLink).Text, Is.StringContaining("SuperUser"));
        }