Search in sources :

Example 1 with CategoriesFieldset

use of com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnMobileCanNotEditGeneralCategory.

// Discussions Administrator on mobile
@Test(groups = { MOBILE })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR, onWikia = MercuryWikis.DISCUSSIONS_MOBILE)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void discussionsAdministratorOnMobileCanNotEditGeneralCategory() {
    CategoryPill.Data postCategory = setUp(MercuryWikis.DISCUSSIONS_MOBILE);
    final PostsListPage page = new PostsListPage().open(siteId);
    final CategoriesFieldset categoriesFieldset = page.getFiltersPopOver().click().getCategoriesFieldset();
    try {
        assertTrue(categoriesFieldset.canEdit(), SHOULD_EDIT_CATEGORIES_MESSAGE);
        assertFalse(categoriesFieldset.clickEdit().canEditGeneralCategory(), GENERAL_CATEGORY_SHOULD_BE_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) 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 2 with CategoriesFieldset

use of com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnMobileCanEditCategory.

@Test(groups = { MOBILE })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR, onWikia = MercuryWikis.DISCUSSIONS_MOBILE)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void discussionsAdministratorOnMobileCanEditCategory() {
    CategoryPill.Data editableCategory = setUp(MercuryWikis.DISCUSSIONS_MOBILE);
    final PostsListPage page = new PostsListPage().open(siteId);
    final String editedName = createUniqueCategoryName();
    CategoriesFieldset categoriesFieldset = page.getFiltersPopOver().click().getCategoriesFieldset().clickEdit().renameMobile(editableCategory.getName(), editedName).clickApproveButton();
    page.waitForPageReload();
    CategoryPill.Data editedCategory = categoriesFieldset.findCategoryOrElseThrow(editedName);
    try {
        assertTrue(categoriesFieldset.hasCategory(editedName), String.format(CATEGORY_SHOULD_BE_VISILBE_IN_LIST_MESSAGE, editedName));
        assertTrue(isCategoryIn(page.getPostsCreatorMobile(), editedName), String.format(CATEGORY_SHOULD_BE_VISIBLE_IN_CREATOR_MESSAGE, editedName));
    } 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 3 with CategoriesFieldset

use of com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnDesktopCanAddCategory.

@Test(groups = { DESKTOP })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void discussionsAdministratorOnDesktopCanAddCategory() {
    final PostsListPage page = new PostsListPage().open(siteId);
    final String categoryName = createUniqueCategoryName();
    final CategoriesFieldset categoriesFieldset = addCategory(page.getCategories(), categoryName);
    page.waitForPageReload();
    final CategoryPill.Data data = categoriesFieldset.findCategoryOrElseThrow(categoryName);
    try {
        assertTrue(categoriesFieldset.hasCategory(categoryName), String.format(CATEGORY_SHOULD_BE_VISILBE_IN_LIST_MESSAGE, categoryName));
        assertTrue(isCategoryIn(page.getPostsCreatorDesktop(), categoryName), String.format(CATEGORY_SHOULD_BE_VISIBLE_IN_CREATOR_MESSAGE, categoryName));
    } finally {
        removeCategoryRemotely(siteId, data);
    }
}
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 4 with CategoriesFieldset

use of com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset in project selenium-tests by Wikia.

the class CategoriesTests method discussionsAdministratorOnDesktopCanRemoveCategory.

@Test(groups = { DESKTOP })
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void discussionsAdministratorOnDesktopCanRemoveCategory() {
    CategoryPill.Data data = setUp();
    final String temporaryCategoryName = createUniqueCategoryName();
    final PostsListPage page = new PostsListPage().open(siteId);
    final CategoriesFieldset categoriesFieldset = page.getCategories();
    canRemoveCategories(page, temporaryCategoryName, categoriesFieldset, data);
}
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 5 with CategoriesFieldset

use of com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset 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)

Aggregations

Execute (com.wikia.webdriver.common.core.annotations.Execute)10 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)10 CategoriesFieldset (com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoriesFieldset)10 PostsListPage (com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage)10 Test (org.testng.annotations.Test)10 CategoryPill (com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoryPill)7