Search in sources :

Example 11 with PostsListPage

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

the class ReportingPostTests method userOnDesktopCanNotSeeDeletedPostOnPostsListPage.

@Test(groups = "discussions-loggedInUsersDesktopReporting")
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCanNotSeeDeletedPostOnPostsListPage() {
    final PostEntity.Data data = createAndReportAndDeletePostRemotely();
    final PostsListPage page = openPostListPageAndWaitUntilLoaded();
    final PostEntity postEntity = page.getPost().findPostById(data.getId());
    assertNull(postEntity, NOT_VISIBLE_DELETED_POST_MESSAGE);
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) PostEntity(com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 12 with PostsListPage

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

the class ReportingPostTests method anonUserOnDesktopCanNotSeeReportedPostOnPostsListPage.

@Test(groups = "discussions-anonUserDesktopReporting")
@Execute(asUser = User.ANONYMOUS)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void anonUserOnDesktopCanNotSeeReportedPostOnPostsListPage() {
    createAndReportPostRemotelyAsFirstUser();
    final PostsListPage page = openPostListPageAndWaitUntilLoaded();
    assertFalse(postHasReportedIndicator(page), NO_REPORTED_INDICATOR_ON_POST_MESSAGE);
}
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 13 with PostsListPage

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

the class ReportingPostTests method userOnDesktopCanReportPostOnPostsListPage.

@Test(groups = "discussions-loggedInUsersDesktopReporting")
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCanReportPostOnPostsListPage() {
    final PostEntity.Data data = cretePostRemotelyAsFirstUser();
    final PostsListPage page = openPostListPageAndWaitUntilLoaded();
    final PostEntity postEntity = page.getPost().findPostById(data.getId());
    assertTrue(postCanBeReported(postEntity), CAN_REPORT_POST_MESSAGE);
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) PostEntity(com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 14 with PostsListPage

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

the class ReportingPostTests method userOnDesktopCanReportApprovedPostOnPostsListPage.

// Third user on desktop
@Test(groups = "discussions-loggedInUsersDesktopReporting")
@Execute(asUser = User.USER_3)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCanReportApprovedPostOnPostsListPage() {
    final PostEntity.Data data = createAndReportPostRemotelyAsFirstUser();
    reportPostRemotelyAsSecondUser(data);
    validatePostRemotelyAsDiscussionsModerator(data);
    final PostsListPage page = openPostListPageAndWaitUntilLoaded();
    final PostEntity postEntity = page.getPost().findPostById(data.getId());
    assertFalse(postEntity.isReported(), REPORTED_INDICATOR_NOT_VISIBLE_FOR_USER_MESSAGE);
    assertTrue(postCanBeReported(postEntity), CAN_REPORT_POST_MESSAGE);
}
Also used : PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) PostEntity(com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 15 with PostsListPage

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

the class SortingTests method userCanSwitchBetweenLatestAndTrendingInDropdown.

/**
   * TESTING METHODS SECTION
   */
private void userCanSwitchBetweenLatestAndTrendingInDropdown() {
    PostsListPage page = new PostsListPage().open();
    FiltersPopOver filtersPopOver = page.getFiltersPopOver();
    DiscussionsHeader discussionsHeader = page.getDiscussionsHeader();
    discussionsHeader.clickSortButtonOnMobile();
    Assertion.assertTrue(filtersPopOver.isSortListVisibleMobile());
    filtersPopOver.clickLatestLinkOnMobile();
    filtersPopOver.clickApplyButton();
    new Loading(driver).handleAsyncPageReload();
    discussionsHeader.clickSortButtonOnMobile();
    filtersPopOver.clickTrendingOptionInSortMenu();
    filtersPopOver.clickApplyButton();
    new Loading(driver).handleAsyncPageReload();
}
Also used : Loading(com.wikia.webdriver.elements.mercury.components.Loading) FiltersPopOver(com.wikia.webdriver.elements.mercury.components.discussions.mobile.FiltersPopOver) PostsListPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostsListPage) DiscussionsHeader(com.wikia.webdriver.elements.mercury.components.discussions.mobile.DiscussionsHeader)

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