Example #1
0
			private void VerifyQuickSearch(BasePage currentPage)
			{
				currentPage.WaitAndType(By.XPath(BasePage.SearchBox), "awesome");
				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");
			}
Example #2
0
		private void VerifyStandardPageLayout(BasePage currentPage)
		{
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the error message is not present");
			Assert.IsFalse(currentPage.ElementPresent(By.XPath("//div[contains(@id, 'dnnSkinMessage') and contains(@class, 'dnnFormValidationSummary')]")),
						"The error message is present on the current page");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Box is present");
			Assert.IsTrue(currentPage.ElementPresent(By.XPath(BasePage.SearchBox)),
						"The Search Box is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present");
			Assert.IsTrue(currentPage.ElementPresent(By.XPath(BasePage.SearchButton)),
						"The Search Button is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present");
			Utilities.SoftAssert(() => StringAssert.Contains(BasePage.CopyrightText, currentPage.FindElement(By.Id(BasePage.CopyrightNotice)).Text,
				"Copyright notice is not present or contains wrong text message"));
		}
Example #3
0
			private void VerifySearchResults(BasePage currentPage)
			{
				currentPage.WaitAndType(By.XPath(BasePage.SearchBox), "awesome");
				currentPage.Click(By.XPath(BasePage.SearchButton));

				SearchPage 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("//span[contains(@id, '" + BasePage.PageTitle + "')]")).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");

				//Trace.WriteLine(BasePage.TraceLevelPage + "Total result number '" + searchPage.FindElement(By.XPath(SearchPage.ResultNumber)).Text);
				//StringAssert.AreEqualIgnoringCase(searchPage.FindElement(By.XPath(SearchPage.ResultNumber)).Text, "About 23 Results",
				//		"Result number is not correct");
			}
Example #4
0
		private void VerifyStandardPageLayout(BasePage currentPage)
		{
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the error message is not present");
			Assert.IsFalse(currentPage.ElementPresent(By.XPath("//div[contains(@id, 'UPPanel')]//div[contains(@id, 'dnnSkinMessage') and contains(@class, 'dnnFormValidationSummary')]")),
						"The error message is present on the current page");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Message Link or Message Link bubble-help is present");
			Utilities.SoftAssert(() => Assert.IsNotEmpty(currentPage.FindElement(By.Id(CorePacket.TheInstance.MessageLink)).GetAttribute("title"), 
				"The Message Link or Message Link bubble-help is missing."));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Notification Link or Notification Link bubble-help is present");
			Utilities.SoftAssert(() => Assert.IsNotEmpty(currentPage.FindElement(By.Id(BasePage.NotificationLink)).GetAttribute("title"), 
				"The Notification Link or Notification Link bubble-help is missing."));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Registered User Link or Registered User Link bubble-help is present");
			Utilities.SoftAssert(() => Assert.IsNotEmpty(currentPage.FindElement(By.Id(BasePage.RegisteredUserLink)).GetAttribute("title"), 
				"The Registered User Link or Registered User Link bubble-help is missing."));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The User Avatar or User Avatar bubble-help is present");
			Utilities.SoftAssert(() => Assert.IsNotEmpty(currentPage.FindElement(By.Id(BasePage.UserAvatar)).GetAttribute("title"), 
				"The User Avatar or User Avatar bubble-help is missing."));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Logout Link or Logout Link bubble-help is present");
			Utilities.SoftAssert(() => Assert.IsNotEmpty(currentPage.FindElement(By.Id(BasePage.LogoutLink)).GetAttribute("title"), 
				"The Logout Link or Logout Link bubble-help is missing."));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Box is present");
			Assert.IsTrue(currentPage.ElementPresent(By.XPath(BasePage.SearchBox)),
						"The Search Box is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present");
			Assert.IsTrue(currentPage.ElementPresent(By.XPath(BasePage.SearchButton)),
						"The Search Button is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present");
			Utilities.SoftAssert(() => StringAssert.Contains(BasePage.CopyrightText, currentPage.FindElement(By.Id(BasePage.CopyrightNotice)).Text,
				"Copyright notice is not present or contains wrong text message"));
		}