コード例 #1
0
        private void RunInstallerLogTest(XElement settings)
        {
            string testName          = settings.Attribute("name").Value;
            string baseUrl           = settings.Attribute("baseURL").Value;
            string browser           = settings.Attribute("browser").Value;
            string installerLanguage = settings.Attribute("InstallerLanguage").Value;
            string language          = settings.Attribute("Language").Value;

            IWebDriver driver = StartBrowser(browser);

            Trace.WriteLine("Running TEST: '" + testName + "'");

            InstallerPage installerPage = new InstallerPage(driver);

            installerPage.OpenUsingUrl(baseUrl);

            installerPage.SetInstallerLanguage(installerLanguage);
            installerPage.SetDictionary(installerLanguage);

            installerPage.FillAccountInfo(settings);

            installerPage.ClickOnContinueButton();

            installerPage.WaitForInstallationProcessToFinish();

            installerPage.ClickOnSeeLogsButton();

            installerPage.WaitForLogContainer();

            Trace.WriteLine("Assert Log records: ");
            StringAssert.DoesNotContain("ERROR", installerPage.FindElement(By.Id(InstallerPage.InstallerLogContainer)).Text, "PLZ check log file, it contains error messages");

            installerPage.ClickOnVisitWebsiteButton();

            installerPage.WelcomeScreen();

            Trace.WriteLine("Assert Log files do not contain ERRORs ");

            HostSettingsPage hostSettingsPage = new HostSettingsPage(driver);

            hostSettingsPage.SetDictionary(language);
            hostSettingsPage.OpenUsingButtons(baseUrl);

            hostSettingsPage.Click(By.XPath(HostSettingsPage.LogsTab));
            SlidingSelect.SelectByValue(driver, By.XPath("//a[contains(@id, '" + HostSettingsPage.LogFilesDropDownArrow + "')]"),
                                        By.XPath(HostSettingsPage.LogFilesDropDownList),
                                        HostSettingsPage.OptionOne,
                                        SlidingSelect.SelectByValueType.Contains);
            hostSettingsPage.WaitForElement(By.XPath(HostSettingsPage.LogContent), 30);
            StringAssert.Contains(hostSettingsPage.Translate("Successfull Log"), hostSettingsPage.FindElement(By.XPath(HostSettingsPage.LogContent)).Text, "The Log File is not empty");

            SlidingSelect.SelectByValue(driver, By.XPath("//a[contains(@id, '" + HostSettingsPage.LogFilesDropDownArrow + "')]"),
                                        By.XPath(HostSettingsPage.LogFilesDropDownList),
                                        HostSettingsPage.OptionTwo,
                                        SlidingSelect.SelectByValueType.Contains);
            hostSettingsPage.WaitForElement(By.XPath(HostSettingsPage.LogContent), 30);
            StringAssert.DoesNotContain("ERROR", hostSettingsPage.FindElement(By.XPath(HostSettingsPage.LogContent)).Text, "The Installer Log File contains ERRORS");
        }
コード例 #2
0
ファイル: BVTSetup.cs プロジェクト: ryanmalone/BGDNNWEB
        public void RunBeforeBVTTests()
        {
            Trace.WriteLine(BasePage.TraceLevelComposite + "BVT Setup");

            var doc = XDocument.Load(@"BVT\" + Settings.Default.BVTDataFile);

            XElement settings = doc.Document.Element("Tests").Element("settings");

            string testName          = settings.Attribute("name").Value;
            string installerLanguage = settings.Attribute("InstallerLanguage").Value;

            IWebDriver driver  = TestBase.StartDriver(settings.Attribute("browser").Value);
            string     baseUrl = settings.Attribute("baseURL").Value;

            Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
            Trace.WriteLine(BasePage.PreconditionsKeyWord);

            var installerPage = new InstallerPage(driver);

            installerPage.OpenUsingUrl(baseUrl);

            installerPage.SetInstallerLanguage(installerLanguage);
            installerPage.SetDictionary(installerLanguage);

            installerPage.FillAccountInfo(settings);

            installerPage.ClickOnContinueButton();

            installerPage.WaitForInstallationProcessToFinish();

            installerPage.ClickOnVisitWebsiteButton();

            installerPage.WelcomeScreen();

            AdminSiteSettingsPage adminSiteSettingsPage = new AdminSiteSettingsPage(driver);

            adminSiteSettingsPage.OpenUsingButtons(baseUrl);

            adminSiteSettingsPage.DisablePopups();

            driver.Quit();
        }
コード例 #3
0
        public void Test003_NavigateToChildSite()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigate to Child Site'");

            var hostSiteManagementPage = new HostSiteManagementPage(_driver);

            hostSiteManagementPage.OpenUsingButtons(_baseUrl);

            hostSiteManagementPage.NavigateToChildSite(_baseUrl, _siteAlias);

            var installerPage = new InstallerPage(_driver);

            installerPage.WelcomeScreen();

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT current window Title");
            Assert.That(installerPage.CurrentWindowTitle(), Is.StringContaining(_siteName + " > Home"),
                        "The website name is not correct");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT current window Url");
            Assert.That(installerPage.CurrentWindowUrl(), Is.EqualTo("http://" + _baseUrl + "/" + _siteAlias),
                        "The website URL is not correct");
        }
コード例 #4
0
ファイル: SmokeTest.cs プロジェクト: techbubble/Dnn.Platform
        public void LoginToSite()
        {
            var doc = XDocument.Load(DataFileLocation);

            XElement settings = doc.Document.Element("Tests").Element("settings");

            _driver  = StartBrowser(settings.Attribute("browser").Value);
            _baseUrl = settings.Attribute("baseURL").Value;

            _siteAlias = settings.Attribute("siteAlias").Value;
            _siteName  = settings.Attribute("siteName").Value;
            _pageName  = settings.Attribute("pageName").Value;
            _userName  = settings.Attribute("userName").Value;

            Trace.WriteLine(BasePage.PreconditionsKeyWord);

            var installerPage = new InstallerPage(_driver);

            installerPage.OpenUsingUrl(_baseUrl);
            installerPage.WelcomeScreen();

            LoginPage loginPage = new LoginPage(_driver);

            loginPage.WaitForElement(By.XPath(ControlPanelIDs.LoginLink), 20).WaitTillVisible(20).Click();

            loginPage.WaitAndSwitchToFrame(30);

            loginPage.DoLoginUsingLoginLink("host", "dnnhost");

            loginPage.WaitAndSwitchToWindow(30);

            AdminSiteSettingsPage adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);

            adminSiteSettingsPage.OpenUsingButtons(_baseUrl);
            adminSiteSettingsPage.DisablePopups();
        }
コード例 #5
0
        public void RunUpgradeTest(XElement settings)
        {
            string testName = settings.Attribute("name").Value;
            string baseUrl  = settings.Attribute("baseURL").Value;
            string browser  = settings.Attribute("browser").Value;
            string userName = settings.Attribute("UserName").Value;
            string password = settings.Attribute("Password").Value;

            IWebDriver driver = StartBrowser(browser);

            Trace.WriteLine("Running TEST: '" + testName + "'");

            UpgradePage upgradePage = new UpgradePage(driver);

            upgradePage.OpenUsingUrl(baseUrl);

            upgradePage.FillAccountInfo(userName, password);

            upgradePage.ClickOnUpgradeButton();

            upgradePage.WaitForUpgradingProcessToFinish();

            upgradePage.ClickOnSeeLogsButton();

            upgradePage.WaitForLogContainer();

            Trace.WriteLine("Assert Log records: ");
            StringAssert.DoesNotContain("ERROR", upgradePage.FindElement(By.XPath(UpgradePage.UpgraderLogContainer)).Text, "PLZ check log file, it contains error messages");

            upgradePage.ClickOnVisitWebsiteButton();

            var installerPage = new InstallerPage(driver);

            installerPage.WelcomeScreen();

            LoginPage loginPage = new LoginPage(driver);

            loginPage.WaitForElement(By.XPath(ControlPanelIDs.LoginLink), 20).WaitTillVisible(20).Click();

            loginPage.WaitAndSwitchToFrame(30);

            loginPage.DoLoginUsingLoginLink(userName, password);

            loginPage.WaitAndSwitchToWindow(30);

            HostSettingsPage hostSettingsPage = new HostSettingsPage(driver);

            hostSettingsPage.OpenUsingButtons(baseUrl);

            hostSettingsPage.Click(By.XPath(HostSettingsPage.LogsTab));
            SlidingSelect.SelectByValue(driver, By.XPath("//a[contains(@id, '" + HostSettingsPage.LogFilesDropDownArrow + "')]"),
                                        By.XPath(HostSettingsPage.LogFilesDropDownList),
                                        HostSettingsPage.OptionOne,
                                        SlidingSelect.SelectByValueType.Contains);
            hostSettingsPage.WaitForElement(By.XPath(HostSettingsPage.LogContent));
            StringAssert.Contains("the script ran successfully", hostSettingsPage.FindElement(By.XPath(HostSettingsPage.LogContent)).Text, "The Log File is not empty");

            SlidingSelect.SelectByValue(driver, By.XPath("//a[contains(@id, '" + HostSettingsPage.LogFilesDropDownArrow + "')]"),
                                        By.XPath(HostSettingsPage.LogFilesDropDownList),
                                        HostSettingsPage.OptionTwo,
                                        SlidingSelect.SelectByValueType.Contains);
            hostSettingsPage.WaitForElement(By.XPath(HostSettingsPage.LogContent));
            StringAssert.DoesNotContain("ERROR", hostSettingsPage.FindElement(By.XPath(HostSettingsPage.LogContent)).Text, "The Installer Log File contains ERRORS");
        }