Search in sources :

Example 1 with PostsListPage

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

the class CategoriesTests method changeCategoryMobile.

private void changeCategoryMobile() {
    CategoryPill.Data postCategory = setUp(MercuryWikis.DISCUSSIONS_MOBILE);
    final PostsListPage page = new PostsListPage().open(siteId);
    openPageAndSelectCategoryOnMobile(page, postCategory.getName());
    assertCategoryVisibleAndCleanUp(page, postCategory);
}
Also used : CategoryPill(com.wikia.webdriver.elements.mercury.components.discussions.common.category.CategoryPill) PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage)

Example 2 with PostsListPage

use of com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage 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 3 with PostsListPage

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

the class CreatingPostTests method userOnMobileCannotSavePostWithoutCategoryAndDescription.

/*
   * LOGGED-IN USERS ON MOBILE SECTION
   */
@Test(groups = MOBILE)
@Execute(asUser = User.USER, onWikia = MercuryWikis.DISCUSSIONS_2)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void userOnMobileCannotSavePostWithoutCategoryAndDescription() {
    PostsListPage page = new PostsListPage().open();
    PostsCreator postsCreator = page.getPostsCreatorMobile();
    assertThatPostWithoutSelectedCategoryAndDescriptionCannotBeAdded(postsCreator);
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 4 with PostsListPage

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

the class CreatingPostTests method userOnDesktopCannotAddPostWithoutTitle.

@Test(groups = DESKTOP)
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCannotAddPostWithoutTitle() throws MalformedURLException {
    String description = TextGenerator.createUniqueText();
    PostsListPage page = new PostsListPage().open();
    PostsCreator postsCreator = page.getPostsCreatorDesktop();
    fillPostCategoryWith(postsCreator, description);
    Assertion.assertFalse(postsCreator.isPostButtonActive());
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 5 with PostsListPage

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

the class CreatingPostTests method anonUserOnDesktopWhenScrollsDownThenSeesStickyEditor.

@Test(groups = DESKTOP)
@Execute(asUser = User.ANONYMOUS, onWikia = MercuryWikis.DISCUSSIONS_1)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void anonUserOnDesktopWhenScrollsDownThenSeesStickyEditor() {
    PostsListPage postsListPage = new PostsListPage().open();
    postsListPage.getPost().scrollToLoadMoreButton();
    PostsCreatorDesktop postsCreator = postsListPage.getPostsCreatorDesktop();
    Assertion.assertFalse(postsCreator.isExpanded());
    Assertion.assertTrue(postsCreator.isSticky());
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) PostsCreatorDesktop(com.wikia.webdriver.elements.mercury.components.discussions.desktop.PostsCreatorDesktop) 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