public void VerifyStandardPageLayout(BasePage currentPage) { StringAssert.Contains(currentPage.PageTitleLabel.ToUpper(), currentPage.WaitForElement(By.XPath(ControlPanelIDs.PageTitleID)). Text.ToUpper(), "The wrong page is opened"); 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 error popup is not present"); Assert.IsFalse( currentPage.ElementPresent( By.XPath( "//div[contains(@class, 'dnnFormPopup') and contains(@style, 'display: block;')]//span[contains(text(), 'Error')]")), "The error popup 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.XPath(ControlPanelIDs.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.XPath(ControlPanelIDs.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.XPath(ControlPanelIDs.RegisterLink)).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(ControlPanelIDs.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.XPath(ControlPanelIDs.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(ControlPanelIDs.SearchBox)), "The Search Box is missing."); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present"); Assert.IsTrue(currentPage.ElementPresent(By.XPath(ControlPanelIDs.SearchButton)), "The Search Button is missing."); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present"); Utilities.SoftAssert( () => StringAssert.Contains(ControlPanelIDs.CopyrightText, currentPage.FindElement(By.Id(ControlPanelIDs.CopyrightNotice)).Text, "Copyright notice is not present or contains wrong text message")); }
public void VerifyStandardPageLayout(BasePage currentPage) { StringAssert.Contains(currentPage.PageTitleLabel.ToUpper(), currentPage.WaitForElement(By.XPath(ControlPanelIDs.PageTitleID)). Text.ToUpper(), "The wrong page is opened"); 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 error popup is not present"); Assert.IsFalse( currentPage.ElementPresent( By.XPath( "//div[contains(@class, 'dnnFormPopup') and contains(@style, 'display: block;')]//span[contains(text(), 'Error')]")), "The error popup is present on the current page"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present"); Utilities.SoftAssert( () => StringAssert.Contains(ControlPanelIDs.CopyrightText, currentPage.FindElement(By.Id(ControlPanelIDs.CopyrightNotice)).Text, "Copyright notice is not present or contains wrong text message")); }