Search in sources :

Example 21 with ArticlePage

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");
}
Also used : JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 22 with ArticlePage

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"));
}
Also used : Header(com.wikia.webdriver.elements.mercury.components.Header) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 23 with ArticlePage

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));
}
Also used : Header(com.wikia.webdriver.elements.mercury.components.Header) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 24 with ArticlePage

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());
}
Also used : TopBar(com.wikia.webdriver.elements.mercury.components.TopBar) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 25 with ArticlePage

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"));
}
Also used : TopBar(com.wikia.webdriver.elements.mercury.components.TopBar) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Aggregations

ArticlePage (com.wikia.webdriver.elements.mercury.pages.ArticlePage)25 Test (org.testng.annotations.Test)25 Header (com.wikia.webdriver.elements.mercury.components.Header)6 TopBar (com.wikia.webdriver.elements.mercury.components.TopBar)4 SignInPage (com.wikia.webdriver.pageobjectsfactory.pageobject.auth.signin.SignInPage)4 Execute (com.wikia.webdriver.common.core.annotations.Execute)3 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)3 EditorHomePageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.EditorHomePageObject)3 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 JavascriptActions (com.wikia.webdriver.common.core.elemnt.JavascriptActions)2 CuratedMainPagePageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedMainPagePageObject)2 CategoryPage (com.wikia.webdriver.elements.mercury.pages.CategoryPage)2 SkinHelper (com.wikia.webdriver.common.skin.SkinHelper)1 CuratedContentPageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedContentPageObject)1 SearchResultsPage (com.wikia.webdriver.elements.mercury.pages.SearchResultsPage)1 GuidelinesPage (com.wikia.webdriver.elements.mercury.pages.discussions.GuidelinesPage)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1