// TOCT01 @Test(groups = {"MercuryTOCTest_001", "MercuryTOCTests", "Mercury"}) public void MercuryTOCTest_001_TOCPresence_ListRedirection() { TableOfContentPageObject toc = new TableOfContentPageObject(driver); toc.openMercuryArticleByName(wikiURL, MercurySubpages.TOC); Assertion.assertTrue(toc.isTOCDisplayed(), "TOC isn't displayed"); PageObjectLogging.log("TOC", "is displayed", true); boolean result = toc.isTOCUnderArticleName(); PageObjectLogging.log( "TOC position", "is under article name", "is not under article name", result); Assertion.assertFalse(toc.isTOCMenuVisible(), "TOC menu is expanded"); PageObjectLogging.log("TOC menu", "is collapsed", true); toc.clickOnTOC(); Assertion.assertTrue(toc.isTOCMenuVisible(), "TOC menu is collapsed"); PageObjectLogging.log("TOC menu", "is expanded", true); toc.clickOnTOCListElement(1); result = toc.isUserMovedToRightSection(1); PageObjectLogging.log("TOC redirection", "works", "does not work", result); result = toc.isH2PaddingTopMoreThan(1, H2_PADDING_TOP); PageObjectLogging.log("Header padding", "is correct", "is wrong", result); }
// TOCT02 @Test(groups = {"MercuryTOCTest_002", "MercuryTOCTests", "Mercury"}) public void MercuryTOCTest_002_NoH2NoTOC() { TableOfContentPageObject toc = new TableOfContentPageObject(driver); toc.openMercuryArticleByName(wikiURL, MercurySubpages.TOC_WITHOUT_H2); boolean result = !toc.isTOCDisplayed(); PageObjectLogging.log("TOC", "is hidden", "is displayed", result); }