Search in sources :

Example 46 with ArticleContent

use of com.wikia.webdriver.common.core.api.ArticleContent in project selenium-tests by Wikia.

the class PortableInfoboxTests method verifyExternalLinksRedirecting.

@Test(groups = { "PortableInfoboxTests", "PortableInfobox_001", "PortableInfoboxLinksTests" })
public void verifyExternalLinksRedirecting() {
    new TemplateContent().push(INFOBOX2_TEMPLATE, PageContent.INFOBOX_2);
    new ArticleContent().push(INFOBOX2_INVOCATION, PageContent.INFOBOX_2);
    PortableInfobox infobox = new PortableInfobox();
    infobox.open(PageContent.INFOBOX_2);
    String externalLinkName = infobox.getExternalLinkRedirectTitle(0);
    String externalUrl = infobox.clickExternalLinkWithIndex(0).waitForUrlToContain(externalLinkName).getCurrentUrl();
    Assertion.assertEquals(externalLinkName.toLowerCase(), externalUrl.toLowerCase());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) TemplateContent(com.wikia.webdriver.common.core.api.TemplateContent) PortableInfobox(com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox) Test(org.testng.annotations.Test)

Example 47 with ArticleContent

use of com.wikia.webdriver.common.core.api.ArticleContent in project selenium-tests by Wikia.

the class PortableInfoboxTests method verifyInfoboxCategoryLinks.

@Test(groups = { "PortableInfoboxTests", "PortableInfobox_002" })
public void verifyInfoboxCategoryLinks() {
    new TemplateContent().push(INFOBOX2_TEMPLATE, PageContent.INFOBOX_2);
    new ArticleContent().push(INFOBOX2_INVOCATION, PageContent.INFOBOX_2);
    PortableInfobox infobox = new PortableInfobox();
    infobox.open(PageContent.INFOBOX_2);
    String categoryLinkName = infobox.getCategoryLinkName();
    infobox.clickCategoryLink();
    String categoryPageTitle = new CategoryPageObject().getCategoryPageTitle();
    Assertion.assertTrue(categoryLinkName.contains(categoryPageTitle));
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) TemplateContent(com.wikia.webdriver.common.core.api.TemplateContent) CategoryPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.category.CategoryPageObject) PortableInfobox(com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox) Test(org.testng.annotations.Test)

Example 48 with ArticleContent

use of com.wikia.webdriver.common.core.api.ArticleContent 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)

Example 49 with ArticleContent

use of com.wikia.webdriver.common.core.api.ArticleContent in project selenium-tests by Wikia.

the class AllTagsTests method prepareTest.

@BeforeMethod(alwaysRun = true)
public void prepareTest() {
    driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS);
    widgets = new ArrayList<>();
    widgets.add(new PollsnackWidgetPageObject(driver));
    widgets.add(new SoundCloudWidgetPageObject(driver));
    widgets.add(new SpotifyWidgetPageObject(driver));
    widgets.add(new TwitterWidgetPageObject(driver));
    widgets.add(new VKWidgetPageObject(driver));
    widgets.add(new WeiboWidgetPageObject(driver));
    widgets.add(new GoogleFormWidgetPageObject(driver));
    widgets.add(new PolldaddyWidgetPageObject(driver));
    widgets.add(new PlaybuzzWidgetPageObject(driver));
    widgets.add(new ApesterWidgetPageObject(driver));
    String content = "";
    for (WidgetPageObject widget : widgets) {
        content += widget.getSingleTag();
    }
    ArticleContent articleContent = new ArticleContent();
    articleContent.clear(ARTICLE_NAME);
    articleContent.push(content, ARTICLE_NAME);
}
Also used : SoundCloudWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.SoundCloudWidgetPageObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) TwitterWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.TwitterWidgetPageObject) SpotifyWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.SpotifyWidgetPageObject) GoogleFormWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.GoogleFormWidgetPageObject) WidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.WidgetPageObject) WeiboWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.WeiboWidgetPageObject) ApesterWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.ApesterWidgetPageObject) VKWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.VKWidgetPageObject) PollsnackWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.PollsnackWidgetPageObject) SoundCloudWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.SoundCloudWidgetPageObject) PolldaddyWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.PolldaddyWidgetPageObject) PlaybuzzWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.PlaybuzzWidgetPageObject) TwitterWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.TwitterWidgetPageObject) SpotifyWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.SpotifyWidgetPageObject) PollsnackWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.PollsnackWidgetPageObject) GoogleFormWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.GoogleFormWidgetPageObject) ApesterWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.ApesterWidgetPageObject) WeiboWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.WeiboWidgetPageObject) PolldaddyWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.PolldaddyWidgetPageObject) VKWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.VKWidgetPageObject) PlaybuzzWidgetPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.widget.PlaybuzzWidgetPageObject) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 50 with ArticleContent

use of com.wikia.webdriver.common.core.api.ArticleContent in project selenium-tests by Wikia.

the class PortableInfoboxTests method verifyDivsWrappersAreNotIncluded.

@Test(groups = { "PortableInfoboxTests", "PortableInfobox_003" })
public void verifyDivsWrappersAreNotIncluded() {
    new TemplateContent().push(INFOBOX2_TEMPLATE, PageContent.INFOBOX_2);
    new ArticleContent().push(INFOBOX2_INVOCATION, PageContent.INFOBOX_2);
    PortableInfobox infobox = new PortableInfobox();
    infobox.open(PageContent.INFOBOX_2);
    Assertion.assertFalse(infobox.imageContainsDiv(0));
    Assertion.assertFalse(infobox.headerContainsDiv(0));
    Assertion.assertFalse(infobox.titleContainsDiv(0));
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) TemplateContent(com.wikia.webdriver.common.core.api.TemplateContent) PortableInfobox(com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox) Test(org.testng.annotations.Test)

Aggregations

ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)99 Test (org.testng.annotations.Test)94 Execute (com.wikia.webdriver.common.core.annotations.Execute)55 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)51 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)38 PortableInfobox (com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox)16 TemplateContent (com.wikia.webdriver.common.core.api.TemplateContent)15 VetOptionsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetOptionsComponentObject)15 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)11 ArticlePurger (com.wikia.webdriver.common.core.helpers.ArticlePurger)8 CategoryPage (com.wikia.webdriver.elements.mercury.pages.CategoryPage)6 AddPhotoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.addphoto.AddPhotoComponentObject)6 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)6 SourceEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject)6 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)6 PreviewEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.PreviewEditModePageObject)5 PhotoOptionsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject)4 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)3 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)3 PhotoAddComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoAddComponentObject)3