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)));
		}
示例#2
0
		public void LoginToSite()
		{
			XDocument doc = XDocument.Load(DataFileLocation);

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

			string testName = testSettings.Attribute("name").Value;

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

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

			OpenMainPageAndLoginAsHost();

			//Create a Page
			var blankPage = new BlankPage(_driver);
			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);
			blankPage.AddNewPage("page");

			//Delete Default HTML Module on page
			blankPage.OpenUsingUrl(_baseUrl,"page");
			var module = new Modules(_driver);
			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumber =
				module.WaitForElement(By.XPath(Modules.LocationDescription["ContentPane"].IdWhenOnPage + Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage + "/a")).GetAttribute("name");
			module.DeleteModule(moduleNumber);

			//Export new page as Default
			var pageExportPage = new PageExportPage(_driver);
			pageExportPage.OpenUsingControlPanel(_baseUrl + "/page");
			pageExportPage.ExportPage("Default", "NewDefault");

			//Create set of pages with New Default
			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.AddPagesInBulk(">" + "Page", "P1Modules", 65, AdminPageManagementPage.PageType.Web, "Home");

			//Create set of pages for Drag&Drop tests with New Default
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.AddPagesInBulk(">" + "Page", "P1ModulesDragDrop", 65, AdminPageManagementPage.PageType.Web, "Home");
			
			//Create a page with 4 HtmlModuleDictionary Modules on page
			blankPage.OpenUsingUrl(_baseUrl, "Home/P1Modules/Page61");
			module.OpenModulePanelUsingControlPanel();
			int i = 1;
			while (i < 5)
			{
				module.AddNewModuleUsingMenu(HtmlModuleDictionary.IdWhenOnBanner, HtmlModuleDictionary.IdWhenOnPage, "ContentPane");
				i++;
			}
			
			_logContent = LogContent(); 
		}
示例#3
0
		public void DeleteData()
		{
			VerifyLogs(_logContent);

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.DeletePage("P1Modules", AdminPageManagementPage.PageType.Web);

			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.DeletePage("P1ModulesDragDrop", AdminPageManagementPage.PageType.Web);

			var adminRecycleBinPage = new AdminRecycleBinPage(_driver);
			adminRecycleBinPage.OpenUsingButtons(_baseUrl);
			adminRecycleBinPage.EmptyRecycleBin();
		}
示例#4
0
		public void Test001_AddPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Page'");

			var blankPage = new BlankPage(_driver);

			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);

			blankPage.AddNewPage(_pageName);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the user redirected to newly created page: " + "http://" +
							_baseUrl.ToLower() + "/" + _pageName);
			Assert.That(blankPage.CurrentWindowUrl(), Is.StringStarting("http://" + _baseUrl.ToLower() + "/" + _pageName),
						"The page URL is not correct");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + " is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[@class= 'rtLI']//span[contains(text(), '" + _pageName + "')]")),
				"The page is not present in the list");
		}
示例#5
0
		public void Test004_DeletePage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete a Page'");

			BlankPage blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, _pageName);

			blankPage.DeletePage(_pageName);

			AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is NOT present in the list");
			Assert.IsFalse(adminPageManagementPage.ElementPresent(By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[@class= 'rtLI']//span[contains(text(), '" + _pageName + "')]")),
				"The page is present in the list");

			AdminRecycleBinPage adminRecycleBinPage = new AdminRecycleBinPage(_driver);
			adminRecycleBinPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in Recycle Bin");
			Assert.IsTrue(adminRecycleBinPage.ElementPresent(By.XPath(AdminRecycleBinPage.RecycleBinPageContainerOption + "[contains(text(), '" + _pageName + "')]")));
		}
示例#6
0
		public void Test001_AddWebPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Website Page'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.AddPage(_pageName, AdminPageManagementPage.PageType.Web, _addWebAfter);

			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addWebAfter +
					         " ']]//div/span[text() = '" + _pageName + " ']")),
				"The page is not present in the list");
		}
示例#7
0
		public void Test013_ImportPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Import a Page'");

			var pageImportPage = new PageImportPage(_driver);
			pageImportPage.OpenUsingControlPanel(_baseUrl);

			pageImportPage.ImportPage(_templateName, _importedPageName, _insertPageAfter);

			//Assert.That(pageImportPage.CurrentWindowUrl(), Is.EqualTo("http://" + _baseUrl.ToLower() + "/" + _importedPageName),
			//					"The page URL is not correct");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _importedPageName + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath("//li[div/span[text() = '" + _insertPageAfter + " ']]/following-sibling::li[div/span[text() = '" +
					         _importedPageName + " ']]")),
				"The page is not present in the list");
		}
示例#8
0
		public void Test011_CopyPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Copy a Page'");
			var blankPage = new BlankPage(_driver);

			blankPage.OpenCopyPageFrameUsingControlPanel(_baseUrl);
			blankPage.CopyPage(_copiedPageName, _parentPageName, _copyFromPage);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the user redirected to newly created page: " + "http://" +
			                _baseUrl.ToLower() + "/" + _parentPageName + "/" + _copiedPageName);
			Assert.That(blankPage.CurrentWindowUrl(),
			            Is.EqualTo("http://" + _baseUrl.ToLower() + "/" + _parentPageName + "/" + _copiedPageName),
			            "The page URL is not correct");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT 3 new modules added.");
			Assert.That(blankPage.FindElements(By.XPath("//li[@class = 'actionMenuMove']")).Count, Is.EqualTo(3),
			            "The Modules are not added correctly");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _copiedPageName + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _parentPageName +
					         " ']]//div/span[text() = '" + _copiedPageName + " ']")),
				"The page is not present in the list");
		}
示例#9
0
		public void Test010_DeleteHostPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete a Page'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.DeletePage(_pageName, AdminPageManagementPage.PageType.Host);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is  NOT present in the list");
			Assert.IsFalse(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
					         " ']]//div/span[text() = '" + _pageName + " ']")),
				"The page " + _pageName + " is present in the list");
		}
示例#10
0
		public void Test008_EditHostPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit a Host Page'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.AddDescriptionToPage(_pageName, _pageDescription, AdminPageManagementPage.PageType.Host);

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, "Host/" + _addHostAfter + "/" + _pageName);
			blankPage.SelectMenuOption(ControlPanelIDs.ControlPanelEditPageOption, ControlPanelIDs.PageSettingsOption);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page description: " + _pageName1 + "is saved correctly");
			Assert.That(_pageDescription, Is.EqualTo(blankPage.WaitForElement(By.XPath(BlankPage.PageDescriptionTextBox)).Text),
			            "The page description is not added correctly");
		}
示例#11
0
		public void Test007_AddHostMultiplePages()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add new Host Pages'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.AddPages(_pageName1, _pageName2, _pageName3, _pageName4, AdminPageManagementPage.PageType.Host, _addHostAfter);

			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.RadioButtonSelect(By.XPath(AdminPageManagementPage.HostPagesRadioButton));
			adminPageManagementPage.WaitForElement(By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//span[text() = 'Host ']"));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName1 + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
					         " ']]//div/span[text() = '" + _pageName1 + " ']")),
				"The page " + _pageName1 + " is not present in the list");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName2 + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
					         " ']]//div/span[text() = '" + _pageName2 + " ']")),
				"The page " + _pageName2 + " is not present in the list");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName3 + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _pageName2 + " ']]//div/span[text() = '" +
					         _pageName3 + " ']")),
				"The page " + _pageName3 + " is not present in the list");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName4 + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _pageName2 + " ']]//div/span[text() = '" +
					         _pageName4 + " ']")),
				"The page " + _pageName4 + " is not present in the list");
		}
示例#12
0
		public void Test004_MoveWebPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Move a Page'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.MovePage(_pageName, _moveAfterWebPage, AdminPageManagementPage.PageType.Web);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is NOT present in the old location");
			Assert.IsFalse(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addWebAfter +
					         " ']]//div/span[text() = '" + _pageName + " ']")),
				"The page " + _pageName + " is present in the list after Page '" + _addWebAfter + "'");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the new location");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _moveAfterWebPage +
					         " ']]//div/span[text() = '" + _pageName + " ']")),
				"The page " + _pageName + " is not present in the list");
		}
示例#13
0
		public void Test006_AddHostPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Host Page'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.AddPage(_pageName, "Host", _addHostAfter);

			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.RadioButtonSelect(By.XPath(AdminPageManagementPage.HostPagesRadioButton));
			adminPageManagementPage.WaitForElement(By.XPath(AdminPageManagementPage.PageList + "//span[text() = 'Host ']"));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
					         " ']]//div/span[text() = '" + _pageName + " ']")),
				"The page is not present in the list");
		}