Search in sources :

Example 26 with PostDetailsPage

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

the class LockingPostTests method openPageWithPostUnlockedByStaff.

private PostDetailsPage openPageWithPostUnlockedByStaff() {
    PostEntity.Data data = DiscussionsOperations.using(User.USER, driver).createPostWithUniqueData();
    DiscussionsOperations.using(User.STAFF, driver).lockPost(data).unlockPost(data);
    return new PostDetailsPage().open(data.getId());
}
Also used : PostDetailsPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage) PostEntity(com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity)

Example 27 with PostDetailsPage

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

the class LockingPostTests method userOnDesktopCanNotAddReplyUnderLockedPostOnPostDetailsPage.

// User on desktop
@Test(groups = { "discussions-locking-posts-desktop", "discussions-userDesktopLocking" })
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCanNotAddReplyUnderLockedPostOnPostDetailsPage() {
    PostDetailsPage page = lockPostAsDiscussionsModeratorAndOpenPostDetailsPage();
    Assertion.assertTrue(page.getPost().findNewestPost().isLocked(), SHOULD_BE_LOCKED_MESSAGE);
    final String message = String.format(SHOULD_NOT_ADD_REPLY_MESSAGE, User.USER.name(), User.DISCUSSIONS_MODERATOR.name());
    Assertion.assertFalse(page.getReplyCreatorDesktop().isPresent(), message);
}
Also used : PostDetailsPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 28 with PostDetailsPage

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

the class LockingPostTests method userOnMobileCanAddReplyUnderUnlockedPostOnPostDetailsPage.

@Test(groups = { "discussions-locking-posts-mobile", "discussions-userMobileLocking" })
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void userOnMobileCanAddReplyUnderUnlockedPostOnPostDetailsPage() {
    PostEntity.Data data = DiscussionsOperations.using(User.USER, driver).createPostWithUniqueData();
    DiscussionsOperations.using(User.DISCUSSIONS_MODERATOR, driver).lockPost(data).unlockPost(data);
    PostDetailsPage page = new PostDetailsPage().open(data.getId());
    final String text = addReplyOnMobile(page);
    boolean actual = isReplyNotPresent(page, text);
    final String message = String.format(SHOULD_ADD_REPLY_MESSAGE, User.USER.name(), User.DISCUSSIONS_MODERATOR.name());
    Assertion.assertFalse(actual, message);
}
Also used : PostDetailsPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage) 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 29 with PostDetailsPage

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

the class LockingPostTests method userOnMobileCanNotAddReplyUnderLockedPostOnPostDetailsPage.

// User on mobile
@Test(groups = { "discussions-locking-posts-mobile", "discussions-userMobileLocking" })
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void userOnMobileCanNotAddReplyUnderLockedPostOnPostDetailsPage() {
    PostDetailsPage page = lockPostAsDiscussionsModeratorAndOpenPostDetailsPage();
    Assertion.assertTrue(page.getPost().findNewestPost().isLocked(), SHOULD_BE_LOCKED_MESSAGE);
    final String message = String.format(SHOULD_NOT_ADD_REPLY_MESSAGE, User.USER.name(), User.DISCUSSIONS_MODERATOR.name());
    Assertion.assertFalse(page.getReplyCreatorMobile().isPresent(), message);
}
Also used : PostDetailsPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 30 with PostDetailsPage

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

the class EditingPostTests method userOnDesktopCanNotSeeThatPostWasEditedByAuthorOnPostDetailsPage.

@Test(groups = USER_DESKTOP_TEST_GROUP)
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCanNotSeeThatPostWasEditedByAuthorOnPostDetailsPage() {
    final PostEntity.Data data = updatePostAsStaffRemotely(createPostAsStaffRemotely());
    final PostEntity post = new PostDetailsPage().open(data.getId()).getPost().findNewestPost();
    Assertion.assertFalse(post.hasEditedBySection(), SAME_PERSON_MESSAGE);
}
Also used : PostDetailsPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage) 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)

Aggregations

PostDetailsPage (com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage)55 Execute (com.wikia.webdriver.common.core.annotations.Execute)35 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)35 Test (org.testng.annotations.Test)35 PostEntity (com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity)29 ReplyCreator (com.wikia.webdriver.elements.mercury.components.discussions.common.ReplyCreator)5 Reply (com.wikia.webdriver.elements.mercury.components.discussions.common.Reply)3 ErrorMessages (com.wikia.webdriver.elements.mercury.components.discussions.common.ErrorMessages)2 Post (com.wikia.webdriver.elements.mercury.components.discussions.common.Post)1 Replies (com.wikia.webdriver.elements.mercury.components.discussions.common.Replies)1 PageWithPosts (com.wikia.webdriver.elements.mercury.pages.discussions.PageWithPosts)1