Search in sources :

Example 1 with SocialButtonsComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.social_buttons.SocialButtonsComponentObject in project selenium-tests by Wikia.

the class SocialButtonsTests method SocialButtons_001_differentLanguages.

/**
   * This tests executes for 11 users with different languages. Log in, open random article, compare
   * present social buttons to expected social buttons
   */
@Test(groups = { "SocialButtons", "SocialButtons_001" }, dataProvider = "SocialButtonsDataProvider")
public void SocialButtons_001_differentLanguages(String[] credentials, String[] expectedSocialNetworks) {
    new ArticleContent().push(PageContent.ARTICLE_TEXT);
    WikiBasePageObject base = new WikiBasePageObject();
    base.loginAs(credentials[0], credentials[1], wikiURL);
    new ArticlePageObject().open();
    SocialButtonsComponentObject buttons = new SocialButtonsComponentObject(driver);
    buttons.verifyShareButtonsPresent();
    String[] currentSocialNetworks = buttons.getShareButtonTitles();
    for (int i = 0; i < expectedSocialNetworks.length; i++) {
        String currentSocialNetwork = currentSocialNetworks[i];
        String expectedSocialNetwork = expectedSocialNetworks[i];
        Assertion.assertEquals(currentSocialNetwork, expectedSocialNetwork, "Expected network not found on its position. " + "Note that the order of social buttons is also important, " + "as defined in requirements. Missing network:" + expectedSocialNetwork);
    }
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SocialButtonsComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.social_buttons.SocialButtonsComponentObject) Test(org.testng.annotations.Test)

Aggregations

ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)1 SocialButtonsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.social_buttons.SocialButtonsComponentObject)1 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 Test (org.testng.annotations.Test)1