示例#1
0
		public void VerifyQuickSearch(BasePage currentPage)
		{
			currentPage.WaitAndType(By.XPath(ControlPanelIDs.SearchBox), "home");
			currentPage.WaitForElement(By.XPath("//ul[@class = 'searchSkinObjectPreview']"), 60);

			Assert.IsTrue(currentPage.ElementPresent(By.XPath("//li/a[@class = 'searchSkinObjectPreview_more']")),
			              "The link 'See More Results' is missing");

			Assert.That(currentPage.FindElements(By.XPath("//ul[@class = 'searchSkinObjectPreview']/li[@data-url]")).Count,
			            Is.AtLeast(1),
			            "At least one item is displayed");
		}
示例#2
0
		public void VerifySearchResults(BasePage currentPage)
		{
			currentPage.WaitAndType(By.XPath(ControlPanelIDs.SearchBox), "awesome");
			currentPage.Click(By.XPath(ControlPanelIDs.SearchButton));

			var searchPage = new SearchPage(_driver);
			searchPage.WaitForElement(By.XPath("//div[@class = 'dnnSearchResultContainer']"), 60);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Page Title for '" + searchPage.PageTitleLabel + "' page:");
			StringAssert.Contains(searchPage.PageTitleLabel,
			                      searchPage.WaitForElement(By.XPath(ControlPanelIDs.PageTitleID)).Text,
			                      "The wrong page is opened or The title of " + searchPage.PageTitleLabel + " page is changed");

			Assert.That(searchPage.FindElements(By.XPath(SearchPage.ResultsList)).Count, Is.AtLeast(1),
			            "At least one item is displayed");

			StringAssert.AreNotEqualIgnoringCase(searchPage.FindElement(By.XPath(SearchPage.TitleOfFirstFoundElement)).Text,
			                                     "No Results Found",
			                                     "'No Results Found' record is displayed");

			//StringAssert.AreEqualIgnoringCase(searchPage.FindElement(By.XPath(SearchPage.ResultNumber)).Text, "About 23 Results",
			//	                                "Result number is not correct");
		}