Exemplo n.º 1
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");
		}
Exemplo n.º 2
0
		public void Test002_AddWebMultiplePages()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add new Website Pages'");

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

			adminPageManagementPage.AddPages(_pageName1, _pageName2, _pageName3, _pageName4, AdminPageManagementPage.PageType.Web, _addWebAfter);

			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			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() = '" + _addWebAfter +
					         " ']]//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() = '" + _addWebAfter +
					         " ']]//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");
		}