Search in sources :

Example 1 with ArticlePageObject

use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.

the class MainPageTests method MercuryCuratedMainPageTest_001_CheckElementsVisibilityElementsOrderAndRootPath.

@Test(groups = "MercuryCuratedMainPageTest_001")
@Execute(onWikia = MercuryWikis.MERCURY_CC)
@RelatedIssue(issueID = "XW-1739", comment = "if this tests fails just edit any article on mercurycc.wikia.com and wait 24h")
public void MercuryCuratedMainPageTest_001_CheckElementsVisibilityElementsOrderAndRootPath() {
    init();
    navigate.toPage(MercurySubpages.CC_MAIN_PAGE);
    Assertion.assertTrue(new SkinHelper(driver).isSkin(Skin.MOBILE_WIKI));
    new ArticlePageObject(driver).isFooterVisible();
    boolean result = driver.getCurrentUrl().contains(ROOT_PATH);
    PageObjectLogging.log("Current URL", "is set on " + ROOT_PATH, "is not set on " + ROOT_PATH, result);
    result = curatedMainPage.isMobileTopLeaderboardVisible();
    PageObjectLogging.log(PageElements.TOP_LEADERBOARD.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isArticleTitleVisible();
    PageObjectLogging.log(PageElements.ARTICLE_TITLE.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isWikiaStatsContainerVisible();
    PageObjectLogging.log(PageElements.WIKIA_STATS.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    Assertion.assertTrue(curatedMainPage.isMainPagePadSlotInDOM());
    result = curatedMainPage.isFeaturedContentVisible();
    PageObjectLogging.log(PageElements.FEATURED_CONTENT.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isCuratedContentVisible();
    PageObjectLogging.log(PageElements.CURATED_CONTENT.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isMobileInContentVisible();
    PageObjectLogging.log(PageElements.IN_CONTENT.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isTrendingArticlesVisible();
    PageObjectLogging.log(PageElements.TRENDING_ARTICLES.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isMobilePrefooterVisible();
    PageObjectLogging.log(PageElements.PREFOOTER.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    result = curatedMainPage.isTrendingVideosVisible();
    PageObjectLogging.log(PageElements.TRENDING_VIDEOS.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
    int lastPosition = 0;
    String lastElement = "top";
    for (PageElements element : PageElements.values()) {
        int newPosition = curatedMainPage.getElementOffsetTop(element.className);
        result = lastPosition <= newPosition;
        PageObjectLogging.log(element.name, "is after " + lastElement, "is not after " + lastElement, result);
        lastPosition = newPosition;
        lastElement = element.name;
    }
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) SkinHelper(com.wikia.webdriver.common.skin.SkinHelper) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 2 with ArticlePageObject

use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.

the class LoginTestsOld method MercuryLoginTest_006_closeButtonWorksAndRedirectsProperly.

@Test(groups = { "MercuryLoginTest_006", "Mercury_LoginTests_001" })
public void MercuryLoginTest_006_closeButtonWorksAndRedirectsProperly() {
    ArticlePageObject homePage = new ArticlePageObject(driver);
    driver.get(wikiURL);
    String expectedHomePageTitle = homePage.getArticleTitle();
    LoginPageObject loginPageObject = new LoginPageObject(driver).get();
    loginPageObject.clickOnCloseButton();
    homePage.isFooterLogoVisible();
    Assertion.assertEquals(expectedHomePageTitle, homePage.getArticleTitle());
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) LoginPageObject(com.wikia.webdriver.elements.mercury.old.LoginPageObject) Test(org.testng.annotations.Test)

Example 3 with ArticlePageObject

use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.

the class ArticlePageTests method mercury_article_wikiaLogoTopContributorsSectionAndFooterElementsAreVisible.

@Test(groups = "mercury_article_wikiaLogoTopContributorsSectionAndFooterElementsAreVisible")
public void mercury_article_wikiaLogoTopContributorsSectionAndFooterElementsAreVisible() {
    init();
    ArticlePageObject articlePage = new ArticlePageObject(driver);
    navigate.toPage(MercurySubpages.MAIN_PAGE);
    boolean result = articlePage.isWikiaLogoVisible();
    PageObjectLogging.log("Wikia logo", "is visible", "is not visible", result);
    result = articlePage.isSearchButtonVisible();
    PageObjectLogging.log("Search button", "is visible", "is not visible", result);
    result = articlePage.isTopContributorsSectionVisible();
    PageObjectLogging.log("Top contributors section", "is visible", "is not visible", result);
    result = articlePage.isTopContributorsThumbVisible(0);
    PageObjectLogging.log("Top contributors thumb", "is visible", "is not visible", result);
    result = articlePage.isFooterVisible();
    PageObjectLogging.log("Global footer", "is visible", "is not visible", result);
    result = articlePage.isFooterLogoVisible();
    PageObjectLogging.log("Global footer logo", "is visible", "is not visible", result);
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Test(org.testng.annotations.Test)

Example 4 with ArticlePageObject

use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.

the class TOCTests method MercuryTOCTest_005_RedirectionToHeaderFromOtherPage.

@Test(groups = "MercuryTOCTest_005")
public void MercuryTOCTest_005_RedirectionToHeaderFromOtherPage() {
    init();
    navigate.toPage(MercurySubpages.TOC_WITHOUT_H2);
    new ArticlePageObject(driver).clickOnAnchorInContent(0);
    loading.handleAsyncPageReload();
    boolean result = toc.isUserMovedToSectionByIndex("2");
    PageObjectLogging.log("Redirection to header from other page", "works", "does not work", result);
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Test(org.testng.annotations.Test)

Example 5 with ArticlePageObject

use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.

the class TOCTests method MercuryTOCTest_004_RedirectionToHeaderFromCurrentPage.

@Test(groups = "MercuryTOCTest_004")
public void MercuryTOCTest_004_RedirectionToHeaderFromCurrentPage() {
    init();
    navigate.toPage(MercurySubpages.TOC);
    new ArticlePageObject(driver).clickOnAnchorInContent(0);
    boolean result = toc.isUserMovedToSectionByIndex("2");
    PageObjectLogging.log("Redirection to header from current page", "works", "does not work", result);
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Test(org.testng.annotations.Test)

Aggregations

ArticlePageObject (com.wikia.webdriver.elements.mercury.old.ArticlePageObject)9 Test (org.testng.annotations.Test)8 Execute (com.wikia.webdriver.common.core.annotations.Execute)1 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)1 SkinHelper (com.wikia.webdriver.common.skin.SkinHelper)1 Navigate (com.wikia.webdriver.elements.common.Navigate)1 Loading (com.wikia.webdriver.elements.mercury.components.Loading)1 LoginPageObject (com.wikia.webdriver.elements.mercury.old.LoginPageObject)1 CuratedContentPageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedContentPageObject)1