Search in sources :

Example 6 with TemplateContent

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

use of com.wikia.webdriver.common.core.api.TemplateContent 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 8 with TemplateContent

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

Example 9 with TemplateContent

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

the class PortableInfoboxTests method verifyRedlinksRedirecting.

@Test(groups = { "PortableInfoboxTests", "PortableInfobox_001" })
public void verifyRedlinksRedirecting() {
    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.assertTrue(infobox.clickRedLinkWithIndex(0).isCreateNewArticleModalVisible());
}
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 10 with TemplateContent

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

the class PortableInfoboxTests method infoboxImageOnCategoryPage.

@Test(groups = { "PortableInfoboxTests", "PortableInfobox_002" })
@Execute(asUser = User.USER)
public void infoboxImageOnCategoryPage() {
    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 imageName = infobox.getDataImageName();
    CategoryPageObject categoryPage = infobox.clickCategoryWithIndex(0);
    new ArticlePurger().purgeArticleAsLoggedUser();
    String categoryImageURL = categoryPage.getImageURLFromGallery(PageContent.INFOBOX_2);
    Assertion.assertTrue(categoryImageURL.contains(imageName));
}
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) ArticlePurger(com.wikia.webdriver.common.core.helpers.ArticlePurger) PortableInfobox(com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)15 TemplateContent (com.wikia.webdriver.common.core.api.TemplateContent)15 Test (org.testng.annotations.Test)15 PortableInfobox (com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox)14 ArticlePurger (com.wikia.webdriver.common.core.helpers.ArticlePurger)3 Execute (com.wikia.webdriver.common.core.annotations.Execute)2 CategoryPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.category.CategoryPageObject)2 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 SpecialWhatLinksHerePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialWhatLinksHerePageObject)1 SpecialThemeDesignerPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.themedesigner.SpecialThemeDesignerPageObject)1