Search in sources :

Example 36 with PostsListPage

use of com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnDesktopCanEditCategory.

@Test(groups = { DESKTOP })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void discussionsAdministratorOnDesktopCanEditCategory() {
    CategoryPill.Data editableCategory = setUp();
    final PostsListPage page = new PostsListPage().open(siteId);
    final String newCategoryName = createUniqueCategoryName();
    CategoriesFieldset categoriesFieldset = page.getCategories().renameDesktop(editableCategory.getName(), newCategoryName).clickApproveButton();
    page.waitForPageReload();
    CategoryPill.Data editedCategory = categoriesFieldset.findCategoryOrElseThrow(newCategoryName);
    try {
        assertTrue(categoriesFieldset.hasCategory(newCategoryName), String.format(CATEGORY_SHOULD_BE_VISILBE_IN_LIST_MESSAGE, newCategoryName));
        assertTrue(isCategoryIn(page.getPostsCreatorDesktop(), newCategoryName), String.format(CATEGORY_SHOULD_BE_VISIBLE_IN_CREATOR_MESSAGE, newCategoryName));
    } finally {
        cleanUp(editedCategory);
    }
}
Also used : CategoryPill(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoryPill) PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) CategoriesFieldset(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 37 with PostsListPage

use of com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnDesktopCanNotEditAllAndGeneralCategories.

// Discussions Administrator on desktop
@Test(groups = { DESKTOP })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void discussionsAdministratorOnDesktopCanNotEditAllAndGeneralCategories() {
    final PostsListPage page = new PostsListPage().open(siteId);
    final CategoriesFieldset categoriesFieldset = page.getCategories();
    categoriesFieldset.clickEdit();
    assertFalse(categoriesFieldset.canEditAllCategory(), ALL_CATEGORY_SHOULD_NOT_BE_EDITABLE_MESSAGE);
    assertFalse(categoriesFieldset.canEditGeneralCategory(), GENERAL_CATEGORY_SHOULD_BE_NOT_EDITABLE_MESSAGE);
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) CategoriesFieldset(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 38 with PostsListPage

use of com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnMobileCanNotAddMoreThanTenCategories.

@Test(groups = { MOBILE })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR, onWikia = MercuryWikis.DISCUSSIONS_MOBILE)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void discussionsAdministratorOnMobileCanNotAddMoreThanTenCategories() {
    deleteCategoriesMobile();
    ArrayList<CategoryPill.Data> categoriesAdded = setUp(MercuryWikis.DISCUSSIONS_MOBILE, MAX_NUMBER_OF_CATEGORIES - 1);
    final PostsListPage page = new PostsListPage().open(siteId);
    final String newCategoryName = createUniqueCategoryName();
    CategoriesFieldset categoriesFieldset = addCategory(page.getFiltersPopOver().click().getCategoriesFieldset(), newCategoryName);
    try {
        assertEquals(categoriesFieldset.getInfoMessageText(), CATEGORIES_LIMIT_REACHED_INFO_MESSAGE, INFOR_MESSAGE_SHOULD_APPEAR_MESSAGE);
    } finally {
        cleanUp(categoriesAdded);
    }
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) CategoriesFieldset(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 39 with PostsListPage

use of com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage in project selenium-tests by Wikia.

the class CategoriesTests method cannotEditCategoryMobile.

private void cannotEditCategoryMobile() {
    CategoryPill.Data postCategory = setUp(MercuryWikis.DISCUSSIONS_MOBILE);
    final PostsListPage page = new PostsListPage().open(siteId);
    try {
        assertFalse(canEditCategoriesOnMobile(page), CATEGORIES_NOT_EDITABLE_MESSAGE);
    } finally {
        cleanUp(postCategory);
    }
}
Also used : CategoryPill(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoryPill) PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage)

Example 40 with PostsListPage

use of com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnMobileCanAddCategory.

@Test(groups = { MOBILE })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR, onWikia = MercuryWikis.DISCUSSIONS_MOBILE)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void discussionsAdministratorOnMobileCanAddCategory() {
    final PostsListPage page = new PostsListPage().open(siteId);
    final String categoryName = createUniqueCategoryName();
    final CategoriesFieldset categoriesFieldset = addCategory(page.getFiltersPopOver().click().getCategoriesFieldset(), categoryName);
    page.waitForPageReload();
    CategoryPill.Data newCategory = categoriesFieldset.findCategoryOrElseThrow(categoryName);
    try {
        assertTrue(categoriesFieldset.hasCategory(categoryName), String.format(CATEGORY_SHOULD_BE_VISILBE_IN_LIST_MESSAGE, categoryName));
        assertTrue(isCategoryIn(page.getPostsCreatorMobile(), categoryName), String.format(CATEGORY_SHOULD_BE_VISIBLE_IN_CREATOR_MESSAGE, categoryName));
    } finally {
        cleanUp(newCategory);
    }
}
Also used : CategoryPill(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoryPill) PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) CategoriesFieldset(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Aggregations

PostsListPage (com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage)46 Execute (com.wikia.webdriver.common.core.annotations.Execute)26 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)26 Test (org.testng.annotations.Test)26 CategoryPill (com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoryPill)11 PostEntity (com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity)10 CategoriesFieldset (com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset)10 Loading (com.wikia.webdriver.elements.mercury.components.Loading)3 PostsCreatorDesktop (com.wikia.webdriver.elements.mercury.components.discussions.desktop.PostsCreatorDesktop)3 Post (com.wikia.webdriver.elements.mercury.components.discussions.common.Post)2 ErrorMessages (com.wikia.webdriver.elements.mercury.components.discussions.common.ErrorMessages)1 BackButtons (com.wikia.webdriver.elements.mercury.components.discussions.desktop.BackButtons)1 SortingFiltersOnDesktop (com.wikia.webdriver.elements.mercury.components.discussions.desktop.SortingFiltersOnDesktop)1 DiscussionsHeader (com.wikia.webdriver.elements.mercury.components.discussions.mobile.DiscussionsHeader)1 FiltersPopOver (com.wikia.webdriver.elements.mercury.components.discussions.mobile.FiltersPopOver)1 PostsCreatorMobile (com.wikia.webdriver.elements.mercury.components.discussions.mobile.PostsCreatorMobile)1 PageWithPosts (com.wikia.webdriver.elements.mercury.pages.discussions.PageWithPosts)1