Search in sources :

Example 31 with ArticleContent

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

the class CategoryPageTest method mercury_category_navigateToCategoryPageWithArticleAndWithMembersFromUrl.

@Test(groups = "mercury_category_navigateToCategoryPageWithArticleAndWithMembersFromUrl")
public void mercury_category_navigateToCategoryPageWithArticleAndWithMembersFromUrl() {
    final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
    ArticleContent articleContent = new ArticleContent();
    articleContent.push("some irrelevant content of category article", categoryName);
    articleContent.push(String.format("[[%s]]", categoryName), String.format("A-%s", categoryName));
    articleContent.push(String.format("[[%s]]", categoryName), String.format("B-%s", categoryName));
    articleContent.push(String.format("[[%s]]", categoryName), String.format("C-%s", categoryName));
    CategoryPage category = new CategoryPage().open(categoryName);
    Assert.assertFalse("".equals(category.getArticleContent()));
    Assert.assertTrue(category.categoryMembersContainerIsVisible());
    Assert.assertTrue(category.hasCategoryMembers());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) CategoryPage(com.wikia.webdriver.elements.mercury.pages.CategoryPage) Test(org.testng.annotations.Test)

Example 32 with ArticleContent

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

the class CategoryPageTest method mercury_category_testPagination.

@Test(groups = "mercury_category_testPagination")
public void mercury_category_testPagination() throws InterruptedException {
    // This test assumes that there are more than 200 articles created and with category like one below.
    // Staging env should have fixture of this articles to create them everytime it is rebuilded
    final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
    ArticleContent articleContent = new ArticleContent();
    articleContent.push("some irrelevant content of category article", categoryName);
    // execute this loop only once on staging and then create fixture
    //    for (int i = 0; i < 300; ++i) {
    //      articleContent.push(String.format("aa [[%s]]", categoryName), String.format("%d-%s", i, categoryName));
    //    }
    CategoryPage categoryPage = new CategoryPage().open(categoryName);
    Assert.assertTrue(categoryPage.hasCategoryMembers());
    Assert.assertTrue(categoryPage.nextButtonIsVisible());
    categoryPage.clickNextButton();
    Assert.assertTrue(categoryPage.hasCategoryMembers());
    Assert.assertTrue(categoryPage.previousButtonIsVisible());
    // Wait for scroll animation to be finished.
    // categoryPage.previousButtonIsVisible() scrolls to element but jQuery animation scrolls back to somewhere in the middle of a page.
    Thread.sleep(1000);
    categoryPage.clickPreviousButton();
    Assert.assertTrue(categoryPage.hasCategoryMembers());
    Assert.assertTrue(categoryPage.nextButtonIsVisible());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) CategoryPage(com.wikia.webdriver.elements.mercury.pages.CategoryPage) Test(org.testng.annotations.Test)

Example 33 with ArticleContent

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

the class CategoryPageTest method mercury_category_navigateToCategoryPageFromLinkInArticle.

@Test(groups = "mercury_category_navigateToCategoryPageWithArticleAndWithoutMembersFromLink")
public void mercury_category_navigateToCategoryPageFromLinkInArticle() {
    final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
    new ArticleContent().push(String.format("[[%s]]", categoryName));
    CategoryPage categoryPage = new ArticlePage().open().openCategoryPageFromCategoriesDropdown();
    Assert.assertTrue(categoryPage.hasCategoryMembers());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) CategoryPage(com.wikia.webdriver.elements.mercury.pages.CategoryPage) Test(org.testng.annotations.Test)

Example 34 with ArticleContent

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

the class VideosModuleTests method VideosModuleTest_004.

/**
   * Checks if the Videos Module is not showing any duplicate videos
   */
@Test(groups = { "VideosModule", "VideosModuleTest_004", "Media" })
public void VideosModuleTest_004() {
    new ArticleContent().push(PageContent.ARTICLE_TEXT);
    new ArticlePageObject().open();
    new VideosModuleComponentObject(driver).verifyNoDuplicates();
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VideosModuleComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.videosmodule.VideosModuleComponentObject) Test(org.testng.annotations.Test)

Example 35 with ArticleContent

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

the class CategoryPageTest method mercury_category_navigateToCategoryPageWithoutArticleAndWithMembersFromUrl.

@Test(groups = "mercury_category_navigateToCategoryPageWithoutArticleAndWithMembersFromUrl")
public void mercury_category_navigateToCategoryPageWithoutArticleAndWithMembersFromUrl() {
    final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
    ArticleContent articleContent = new ArticleContent();
    articleContent.push(String.format("[[%s]]", categoryName), String.format("A-%s", categoryName));
    articleContent.push(String.format("[[%s]]", categoryName), String.format("B-%s", categoryName));
    articleContent.push(String.format("[[%s]]", categoryName), String.format("C-%s", categoryName));
    CategoryPage category = new CategoryPage().open(categoryName);
    Assert.assertEquals("", category.getArticleContent());
    Assert.assertTrue(category.categoryMembersContainerIsVisible());
    Assert.assertTrue(category.hasCategoryMembers());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) CategoryPage(com.wikia.webdriver.elements.mercury.pages.CategoryPage) 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