Ejemplo n.º 1
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");
		}
Ejemplo n.º 2
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");
		}