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

			XDocument doc = XDocument.Load(DataFileLocation);

			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;
			bool dummyProvider = settings.Attribute("runWithDummyCachingProvider")
										 .Value.Equals("yes", StringComparison.InvariantCultureIgnoreCase);

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

			var adminSiteSettingsPage = new AdminSiteSettingsPage(driver);
			adminSiteSettingsPage.OpenUsingButtons(baseUrl);
			adminSiteSettingsPage.DisablePopups();

			if (dummyProvider)
			{
				var hostExtensionsPage = new HostExtensionsPage(driver);
				hostExtensionsPage.OpenUsingButtons(baseUrl);
				hostExtensionsPage.InstallExtension(@"Drivers\" + "DummySerializationCachingProvider_01.00.01_Install.zip");
			}
			
			driver.Quit();
		}
Beispiel #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), 60).WaitTillVisible(20).Click();

			loginPage.WaitAndSwitchToFrame(30);

			loginPage.DoLogin(userName, password);

			loginPage.WaitAndSwitchToWindow(30);

			upgradePage.WelcomeScreen();

			var adminSiteSettingsPage = new AdminSiteSettingsPage(driver);
			adminSiteSettingsPage.OpenUsingButtons(baseUrl);
			adminSiteSettingsPage.DisablePopups();

			driver.Quit();
		}
Beispiel #4
0
		public void RunBeforeBVTTests()
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "BVT Setup");

			XDocument doc = XDocument.Load(DataFileLocation);

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

			var adminSiteSettingsPage = new AdminSiteSettingsPage(driver);
			adminSiteSettingsPage.OpenUsingButtons(baseUrl);
			adminSiteSettingsPage.DisablePopups();

			driver.Quit();
		}
		public void Test001_VerifyNoneRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'None' registration option'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.NoneRadioButton);

			loginPage.LetMeOut();
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' link is NOT present on the screen");
			Assert.IsFalse(loginPage.ElementPresent(By.XPath(ControlPanelIDs.RegisterLink)),
			               "The Register link is present on the screen");

			loginPage.OpenUsingUrl(_baseUrl);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' button is NOT present on the screen");
			Assert.IsFalse(loginPage.ElementPresent(By.XPath(LoginPage.RegisterFrameButton)),
			               "The Register button is present on the screen");
		}
		public void CreateChildSiteAndPrepareSettings(string childSiteName)
		{
			//create a child site
			HostSiteManagementPage hostSiteMgmtPage = new HostSiteManagementPage(_driver);
			hostSiteMgmtPage.OpenUsingButtons(_baseUrl);
			hostSiteMgmtPage.AddNewChildSite(_baseUrl, childSiteName, "Child Site");

			//navigate to child site
			hostSiteMgmtPage.OpenUsingButtons(_baseUrl);
			hostSiteMgmtPage.NavigateToChildSite(_baseUrl, childSiteName);

			//close welcome screen on child site
			var installerPage = new InstallerPage(_driver);
			installerPage.WelcomeScreen();

			//disable popups on child site
			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);
			adminSiteSettingsPage.DisablePopups();
		}
		public void Test002_VerifyPrivateRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Private' registration option'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.PrivateRadioButton);

			loginPage.RegisterUser(_userWithPrivateRegistration, "DisplayName", "*****@*****.**", "www3434");

			loginPage.LoginUsingLoginLink(_userWithPrivateRegistration, "www3434");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Warning message is present");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(LoginPage.NotAuthorizedWarningMessage)),
			              "The Warning message is not present");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Warning message text is correct");
			Assert.That(loginPage.WaitForElement(By.XPath(LoginPage.NotAuthorizedWarningMessage)).Text,
			            Is.EqualTo(LoginPage.NotAuthorizedWarningMessageText),
			            "The Warning message text is not correct");

			loginPage.LoginAsHost(_baseUrl);

			var manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingControlPanel(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is NOT authorized");
			Assert.IsFalse(
				manageUsersPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _userWithPrivateRegistration + "']]/td/img[contains(@id, '_imgApproved')]")),
				"The User is authorized");
		}
		public void Test004_VerifyVerifiedRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Verified' registration option'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.VerifiedRadioButton);

			loginPage.RegisterUser(_userWithVerifiedRegistration, "DisplayName", "*****@*****.**", "www3434");

			var manageUserProfilePage = new ManageUserProfilePage(_driver);
			manageUserProfilePage.OpenUsingLink(_baseUrl);
			manageUserProfilePage.OpenTab(By.XPath(ManageUserProfilePage.ManageAccountTab));
			manageUserProfilePage.AccordionOpen(By.XPath(ManageUserProfilePage.AccountSettings));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User can Edit Profile");
			Assert.IsTrue(manageUserProfilePage.FindElement(By.XPath(ManageUserProfilePage.DisplayName)).Enabled,
			              "Display Name textbox is disabled");

			loginPage.LoginAsHost(_baseUrl);

			var manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingControlPanel(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is authorized");
			Assert.IsFalse(
				manageUsersPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _userWithVerifiedRegistration + "']]/td/img[contains(@id, '_imgApproved')]")),
				"The User is authorized");
		}
		public void DisablePopups(string url)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Disable Popups: '");

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(url);
			adminSiteSettingsPage.DisablePopups();
		}
		public void Test004_ExportTemplateWithLanguages()
		{
			string childSiteName = _childSiteName + "004";

			var adminAdvancedSettingsPage = new AdminAdvancedSettingsPage(_driver);
			adminAdvancedSettingsPage.OpenUsingButtons(_baseUrl);
			adminAdvancedSettingsPage.DeployLanguagePack(adminAdvancedSettingsPage.SetLanguageName(_languagePackToDeploy));

			var adminLanguagesPage = new AdminLanguagesPage(_driver);
			adminLanguagesPage.OpenUsingButtons(_baseUrl);
			adminLanguagesPage.EnableLanguage(adminLanguagesPage.SetLanguageName(_languagePackToDeploy));

			var hostSettingsPage = new HostSettingsPage(_driver);
			hostSettingsPage.OpenUsingButtons(_baseUrl);
			hostSettingsPage.EnableContentLocalization();
			
			adminLanguagesPage.OpenUsingButtons(_baseUrl);
			adminLanguagesPage.EnableLocalization(CheckBox.ActionType.Check);

			var hostSiteManagementPage = new HostSiteManagementPage(_driver);
			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			hostSiteManagementPage.ExportSiteTemplateWithContent(_siteName, "LanguageTemplate", "LanguageTemplate");

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			hostSiteManagementPage.AddNewChildSite(_baseUrl, childSiteName, "title", "LanguageTemplate");

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl + "/" + childSiteName);
			adminSiteSettingsPage.DisablePopups();
			
			var aboutUsPage = new AboutUsPage(_driver);
			aboutUsPage.OpenUsingLink(_baseUrl + "/" + childSiteName);

			aboutUsPage.SelectMenuOption(ControlPanelIDs.ControlPanelEditPageOption, ControlPanelIDs.PageSettingsOption);
			aboutUsPage.OpenTab(By.XPath(ControlPanelIDs.LocalizationTab));

			Trace.WriteLine(BasePage.TraceLevelPage + "Two language flags should be available");
			Assert.That(adminLanguagesPage.FindElements(By.XPath(ControlPanelIDs.LanguageIcon)).Count, Is.EqualTo(2),
						"The language flag number is not correct");

			Trace.WriteLine(BasePage.TraceLevelPage + "Two language pages should be available");
			Assert.That(aboutUsPage.FindElements(By.XPath("//tr[@class = 'pageHeaderRow']/th")).Count, Is.EqualTo(2));
		}