Пример #1
0
		public void AddNewSite(string siteType, string siteAlias, string siteTitle)
		{
			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			int originaltemNumber = hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count;

			if (siteType == "ChildSite")
			{
				hostSiteManagementPage.AddNewChildSite(_baseUrl, siteAlias, siteTitle, "Default Website");
			}
			else
			{
				hostSiteManagementPage.AddNewParentSite(siteAlias + _baseUrl, siteTitle, "Default Website");
			}

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine("ASSERT the number of elements in the list increased by 1");
			Assert.That(originaltemNumber + 1,
						Is.EqualTo(hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count),
						"The Site is not added correctly");

			Trace.WriteLine("ASSERT the Site name is present in the list");
			Assert.IsTrue(hostSiteManagementPage.ElementPresent(
					By.XPath("//tr/td/span[contains(@id, 'lblPortalAliases')]/a[contains(string(), '" + siteAlias + "')]")),
					"The Site is not added correctly");
		}
Пример #2
0
		public void Test001_AddNewSite()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Child Site'");

			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			hostSiteManagementPage.WaitForElement(By.XPath(HostSiteManagementPage.PortalsTable));
			int originaltemNumber = hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count;

			hostSiteManagementPage.AddNewChildSite(_baseUrl, _siteAlias, _siteName);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			hostSiteManagementPage.WaitForElement(By.XPath(HostSiteManagementPage.PortalsTable));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list increased by 1");
			Assert.That(originaltemNumber + 1,
			            Is.EqualTo(hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count),
			            "The Child site is not added correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Site name is present in the list");
			Assert.IsTrue(
				hostSiteManagementPage.ElementPresent(
					By.XPath("//tr/td/span[contains(@id, 'lblPortalAliases')]/a[contains(string(), '" + _baseUrl + "/" + _siteAlias +
					         "')]")),
				"The Child site is not added correctly");
		}
Пример #3
0
		public void Test001_ExportTemplateWithNoContent()
		{
			string childSiteName = _childSiteName + "001";

			var hostSiteManagementPage = new HostSiteManagementPage(_driver);
			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			hostSiteManagementPage.WaitAndClick(By.XPath(HostSiteManagementPage.ExportSiteTemplateButton));
			hostSiteManagementPage.AccordionOpen(By.XPath(HostSiteManagementPage.AdvancedConfigurationAccordion));

			int orignalNumber =
				hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PagesList)).Count;

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			hostSiteManagementPage.ExportSiteTemplate(_siteName, "NoContentTemplate", "NoContentTemplate");

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

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl + "/" + childSiteName);

			Trace.WriteLine(BasePage.TraceLevelPage + "The page Module should be present");
			Assert.IsTrue(adminPageManagementPage.ElementPresent(By.XPath(AdminPageManagementPage.Module)));

			Trace.WriteLine(BasePage.TraceLevelPage + "The number of pages is correct");
			Assert.That(adminPageManagementPage.FindElements(By.XPath(HostSiteManagementPage.PagesList)).Count, Is.EqualTo(orignalNumber), "");

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

			Trace.WriteLine(BasePage.TraceLevelPage + "The page doesn't have a Content");
			Assert.IsFalse(adminPageManagementPage.ElementPresent(By.XPath(AboutUsPage.PageContent)));
		}
Пример #4
0
		public void Test002_EditSite()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit the Child Site'");

			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			
			hostSiteManagementPage.AddDescriptionToSite(_baseUrl, _siteAlias, _siteDescription);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			hostSiteManagementPage.EditSite(_baseUrl, _siteAlias);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Site description is present");
			Assert.That(hostSiteManagementPage.WaitForElement(By.XPath(HostSiteManagementPage.SiteNameDescriptionTextBox)).Text,
			            Is.EqualTo(_siteDescription),
			            "The site description is not added correctly");
		}
Пример #5
0
		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();
		}
Пример #6
0
		public void Test002_DeleteSite()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the Child Site'");

			HostSiteManagementPage hostSiteManagementPage = new HostSiteManagementPage(_driver);
			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			int itemNumber = hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count;

			hostSiteManagementPage.DeleteSite(_baseUrl, _siteAlias);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list decreased by 1");
			Assert.That(hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count, Is.EqualTo(itemNumber - 1),
					"The Child site is not deleted correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Site name is not present in the list");
			Assert.IsFalse(hostSiteManagementPage.ElementPresent(By.XPath("//tr/td/span[contains(@id, 'lblPortalAliases')]/a[contains(string(), '" + _baseUrl + "/" + _siteAlias + "')]")),
			"The Child site is not added correctly");
		}
Пример #7
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");
		}
Пример #8
0
		public void CreateParentSiteAndPrepareSettings(string parentSiteName, string parentSiteTitle)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Create Parent Site And Prepare Settings: '");

			HostSiteManagementPage hostSiteMgmtPage = new HostSiteManagementPage(_driver);
			hostSiteMgmtPage.OpenUsingButtons(_baseUrl);
			hostSiteMgmtPage.AddNewParentSite(parentSiteName, parentSiteTitle, "Default Website");

			LoginPage loginPage = new LoginPage(_driver);
			loginPage.OpenUsingUrl(parentSiteName);
			loginPage.DoLogin("host", "dnnhost");
			
			DisablePopups(parentSiteName);
		}
Пример #9
0
		public void CreateChildSiteAndPrepareSettings(string childSiteName, string childSiteTitle)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Create Child Site And Prepare Settings: '");

			HostSiteManagementPage hostSiteMgmtPage = new HostSiteManagementPage(_driver);
			hostSiteMgmtPage.OpenUsingButtons(_baseUrl);
			hostSiteMgmtPage.AddNewChildSite(_baseUrl, childSiteName, childSiteTitle, "Default Website");

			DisablePopups(_baseUrl + "/" + childSiteName);
		}
Пример #10
0
		public void EditSite(string siteName, string siteDescription)
		{
			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			hostSiteManagementPage.AddDescriptionToSite(siteName, siteDescription);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			hostSiteManagementPage.EditSite(siteName);

			Trace.WriteLine("ASSERT the Site description is present");
			Assert.That(hostSiteManagementPage.WaitForElement(By.XPath(HostSiteManagementPage.SiteNameDescriptionTextBox)).Text,
			            Is.EqualTo(siteDescription),
			            "The site description is not added correctly");
		}
Пример #11
0
		public void DeleteSite(string siteName)
		{
			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);
			int itemNumber = hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count;

			hostSiteManagementPage.DeleteSite(siteName);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine("ASSERT the number of elements in the list decreased by 1");
			Assert.That(hostSiteManagementPage.FindElements(By.XPath(HostSiteManagementPage.PortalsList)).Count,
			            Is.EqualTo(itemNumber - 1),
			            "The Site is not deleted correctly");

			Trace.WriteLine("ASSERT the Site name is not present in the list");
			Assert.IsFalse(
				hostSiteManagementPage.ElementPresent(
					By.XPath("//tr/td/span[contains(@id, 'lblPortalAliases')]/a[contains(string(), '" + siteName + "')]")),
				"The Site is not added correctly");
		}
Пример #12
0
		public void NavigateToSite(string siteName, string siteTitle)
		{
			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			hostSiteManagementPage.NavigateToSite(siteName);

			var mainPage = new MainPage(_driver);

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

			Trace.WriteLine("ASSERT current window Url");
			Assert.That(mainPage.CurrentWindowUrl(), Is.StringStarting("http://" + siteName),
			            "The website URL is not correct");
		}
Пример #13
0
		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));
		}