Example #1
0
		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();
		}
Example #2
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();

			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");
		}
Example #3
0
		public void RunBeforeBVTTests()
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "Upgrade Setup");

			XDocument doc = XDocument.Load(DataFileLocation);

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

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

			string userName = settings.Attribute("UserName").Value;
			string password = settings.Attribute("Password").Value;

			Trace.WriteLine("Running TEST: 'BVT over upgraded site'");

			UpgradePage upgradePage = new UpgradePage(driver);

			upgradePage.OpenUsingUrl(baseUrl);

			upgradePage.FillAccountInfo(userName, password);

			upgradePage.ClickOnUpgradeButton();

			upgradePage.WaitForUpgradingProcessToFinish();

			upgradePage.ClickOnSeeLogsButton();

			upgradePage.ClickOnVisitWebsiteButton();

			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);

			var adminSiteSettingsPage = new AdminSiteSettingsPage(driver);
			adminSiteSettingsPage.OpenUsingButtons(baseUrl);
			adminSiteSettingsPage.DisablePopups();
		}
Example #4
0
		public void SearchResultsOnMainPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Search Results Main Page'");

			var loginPage = new LoginPage(_driver);

			loginPage.LetMeOut();
			loginPage.OpenUsingUrl(_baseUrl);
			loginPage.DoLoginUsingLoginLink("host", "dnnhost");

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);
			VerifySearchResults(mainPage);
		}
Example #5
0
		public void NavigationToLoginPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To Login Page'");

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			var loginPage = new LoginPage(_driver);
			loginPage.LetMeOut();
			loginPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Page Title for '" + loginPage.PageTitleLabel + "' page:");
			StringAssert.Contains(loginPage.PageTitleLabel,
			                      loginPage.WaitForElement(By.XPath(ControlPanelIDs.PageTitleID)).Text,
			                      "The wrong page is opened or The title of " + loginPage.PageTitleLabel + " page is changed");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Box is present'");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(ControlPanelIDs.SearchBox)),
			              "The Search Box is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present'");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(ControlPanelIDs.SearchButton)),
			              "The Search Button is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present'");
			Utilities.SoftAssert(
				() => StringAssert.Contains(ControlPanelIDs.CopyrightText, loginPage.FindElement(By.Id(ControlPanelIDs.CopyrightNotice)).Text,
				                            "Copyright notice is not present or contains wrong text message"));

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