Search in sources :

Example 36 with PostDetailsPage

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

the class LockingPostTests method staffUserOnMobileCanAddReplyUnderUnlockedPostOnPostDetailsPage.

@Test(groups = { "discussions-locking-posts-mobile", "discussions-staffUserMobileLocking" })
@Execute(asUser = User.STAFF)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void staffUserOnMobileCanAddReplyUnderUnlockedPostOnPostDetailsPage() {
    PostEntity.Data data = DiscussionsOperations.using(User.USER, driver).createPostWithUniqueData();
    DiscussionsOperations.using(User.DISCUSSIONS_ADMINISTRATOR, 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.STAFF.name(), User.DISCUSSIONS_ADMINISTRATOR.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 37 with PostDetailsPage

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

the class LockingPostTests method staffUserOnDesktopCanAddReplyUnderUnlockedPostOnPostDetailsPage.

@Test(groups = { "discussions-locking-posts-desktop", "discussions-staffUserDesktopLocking" })
@Execute(asUser = User.STAFF)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void staffUserOnDesktopCanAddReplyUnderUnlockedPostOnPostDetailsPage() {
    PostEntity.Data data = DiscussionsOperations.using(User.USER, driver).createPostWithUniqueData();
    DiscussionsOperations.using(User.DISCUSSIONS_ADMINISTRATOR, driver).lockPost(data).unlockPost(data);
    PostDetailsPage page = new PostDetailsPage().open(data.getId());
    final String text = addReplyOnDesktop(page);
    boolean actual = isReplyNotPresent(page, text);
    final String message = String.format(SHOULD_ADD_REPLY_MESSAGE, User.STAFF.name(), User.DISCUSSIONS_ADMINISTRATOR.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 38 with PostDetailsPage

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

the class LockingPostTests method lockPostAsDiscussionsModeratorAndOpenPostDetailsPage.

private PostDetailsPage lockPostAsDiscussionsModeratorAndOpenPostDetailsPage() {
    PostEntity.Data data = DiscussionsOperations.using(User.USER, driver).createPostWithUniqueData();
    DiscussionsOperations.using(User.DISCUSSIONS_MODERATOR, driver).lockPost(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 39 with PostDetailsPage

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

the class LockingPostTests method openPageWithPostLockedByDiscussionsModerator.

private PostDetailsPage openPageWithPostLockedByDiscussionsModerator() {
    PostEntity.Data data = DiscussionsOperations.using(User.USER, driver).createPostWithUniqueData();
    DiscussionsOperations.using(User.DISCUSSIONS_ADMINISTRATOR, driver).lockPost(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 40 with PostDetailsPage

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

the class LockingPostTests method unlockPost.

private PostEntity unlockPost(final PostEntity.Data data) {
    PostDetailsPage page = new PostDetailsPage().open(data.getId());
    final PostEntity postEntity = page.getPost().findNewestPost();
    postEntity.clickMoreOptions().clickUnlockPostOption();
    return postEntity;
}
Also used : PostDetailsPage(com.wikia.webdriver.elements.mercury.pages.discussions.PostDetailsPage) PostEntity(com.wikia.webdriver.elements.mercury.components.discussions.common.PostEntity)

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