Beispiel #1
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");
		}
		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");
		}
		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)));
		}
Beispiel #4
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");
		}
		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");
		}