@Test(groups = "MercuryCuratedNavigationTest_001") public void MercuryCuratedNavigationTest_001_navigateThroughCategory() { init(); navigate.toPage(MercurySubpages.CC_MAIN_PAGE); curatedContent.clickOnCuratedContentElementByIndex(1); loading.handleAsyncPageReload(); curatedContent .isTitleVisible() .isLinkToMainPageVisible() .isSectionVisible() .isCuratedContentItemVisibleByIndex(1); String sectionTitle = curatedContent.getTitle(); String expectedUrlPath = MercuryPaths.ROOT_PATH_CATEGORY + sectionTitle; UrlChecker.isPathContainedInCurrentUrl(driver, expectedUrlPath); String previousUrl = driver.getCurrentUrl(); curatedContent.navigateToMainPage(); String nextUrl = driver.getCurrentUrl(); UrlChecker.isPathContainedInCurrentUrl(driver, MercuryPaths.ROOT_PATH); driver.navigate().back(); Assertion.assertEquals(driver.getCurrentUrl(), previousUrl); driver.navigate().forward(); Assertion.assertEquals(driver.getCurrentUrl(), nextUrl); }
@Test(groups = "MercuryCuratedNavigationTest_003") public void MercuryCuratedNavigationTest_003_navigateThroughNamespaces() { init(); navigate.toPage(MercurySubpages.CC_CATEGORY_ARTICLES); curatedContent.isArticleIconVisible().clickOnCuratedContentElementByIndex(0); loading.handleAsyncPageReload(); UrlChecker.isPathContainedInCurrentUrl(driver, MercuryPaths.ROOT_ARTICLE_PATH); navigate.toPage(MercurySubpages.CC_CATEGORY_BLOGS); curatedContent.isBlogIconVisible().clickOnCuratedContentElementByIndex(0); loading.handleAsyncPageReload(); UrlChecker.isPathContainedInCurrentUrl(driver, MercuryPaths.ROOT_ARTICLE_PATH); navigate.toPage(MercurySubpages.CC_CATEGORY_BLOGS); curatedContent.isImageIconVisible().clickOnCuratedContentElementByIndex(0); loading.handleAsyncPageReload(); UrlChecker.isPathContainedInCurrentUrl(driver, MercuryPaths.ROOT_ARTICLE_PATH); navigate.toPage(MercurySubpages.CC_CATEGORY_BLOGS); curatedContent.isVideoIconVisible().clickOnCuratedContentElementByIndex(0); loading.handleAsyncPageReload(); UrlChecker.isPathContainedInCurrentUrl(driver, MercuryPaths.ROOT_ARTICLE_PATH); }
@Test(groups = "MercuryCuratedNavigationTest_002") public void MercuryCuratedNavigationTest_002_navigateThroughSection() { init(); navigate.toPage(MercurySubpages.CC_MAIN_PAGE); curatedContent.clickOnCuratedContentElementByIndex(0); loading.handleAsyncPageReload(); curatedContent .isTitleVisible() .isLinkToMainPageVisible() .isSectionVisible() .isCuratedContentItemVisibleByIndex(1); UrlChecker.isPathContainedInCurrentUrl( driver, MercuryPaths.ROOT_PATH_SECTION + curatedContent.getTitle()); }