use of com.wikia.webdriver.elements.mercury.pages.ArticlePage in project selenium-tests by Wikia.
the class NavigationMercuryTests method mercury_navigation_scrollPositionPreservedAfterNavigatingBack.
@Test
public void mercury_navigation_scrollPositionPreservedAfterNavigatingBack() {
ArticlePage testPage = new ArticlePage().open("/ScrollPreserveTest");
Long firstPosition = testPage.scrollToLink(0, 200);
testPage.clickArticleLink(0);
driver.navigate().back();
Long secondPosition = new JavascriptActions().getCurrentPosition();
Assertion.assertEquals(firstPosition, secondPosition, "Scroll position should be preserved " + "after navigating back");
Assertion.assertTrue(firstPosition > 0 && secondPosition > 0, "Page shoudln't be scrolled " + "to top");
}
use of com.wikia.webdriver.elements.mercury.pages.ArticlePage in project selenium-tests by Wikia.
the class HeaderTest method mercury_header_heroImageIsSquare.
@Test(groups = "mercury_header_heroImageIsSquare")
public void mercury_header_heroImageIsSquare() {
Header header = new ArticlePage().open(MercurySubpages.INFOBOX_1).getHeader();
Assertion.assertTrue(header.isHeroImageSquare(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, HERO_IMAGE_MESSAGE, "square"));
}
use of com.wikia.webdriver.elements.mercury.pages.ArticlePage in project selenium-tests by Wikia.
the class HeaderTest method mercury_header_checkElementsVisibilityWithInfoboxAndWithoutHeroImage.
@Test(groups = "mercury_header_checkElementsVisibilityWithInfoboxAndWithoutHeroImage")
public void mercury_header_checkElementsVisibilityWithInfoboxAndWithoutHeroImage() {
Header header = new ArticlePage().open(MercurySubpages.INFOBOX_2).getHeader();
Assertion.assertTrue(header.isHeaderVisible(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, HEADER_MESSAGE, VISIBLE_MESSAGE));
Assertion.assertTrue(header.isPageTitleVisible(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, PAGE_TITLE_MESSAGE, VISIBLE_MESSAGE));
Assertion.assertFalse(header.isHeroImageVisible(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, HERO_IMAGE_MESSAGE, INVISIBLE_MESSAGE));
}
use of com.wikia.webdriver.elements.mercury.pages.ArticlePage in project selenium-tests by Wikia.
the class TopBarTests method mercury_topbar_switchBetweenSearchAndNavigation.
@Test(groups = "mercury_topbar_switchBetweenSearchAndNavigation")
public void mercury_topbar_switchBetweenSearchAndNavigation() {
TopBar topBar = new ArticlePage().open(MercurySubpages.MAIN_PAGE).getTopBar();
topBar.openSearch();
Assertion.assertTrue(topBar.isCloseIconVisible());
Assertion.assertTrue(topBar.isHamburgerIconVisible());
topBar.openNavigation();
Assertion.assertTrue(topBar.isCloseIconVisible());
Assertion.assertTrue(topBar.isSearchIconVisible());
}
use of com.wikia.webdriver.elements.mercury.pages.ArticlePage in project selenium-tests by Wikia.
the class TopBarTests method mercury_topbar_wikiaLogoRedirectsToFandomPage.
@Test(groups = "mercury_topbar_wikiaLogoRedirectsToFandomPage")
public void mercury_topbar_wikiaLogoRedirectsToFandomPage() {
TopBar topBar = new ArticlePage().open(MercurySubpages.MAIN_PAGE).getTopBar();
topBar.clickWikiaLogo();
Assertion.assertTrue(topBar.getCurrentUrl().contains("fandom.wikia.com"));
}
Aggregations