Search in sources :

Example 31 with PostDetailsPage

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

the class LockingPostTests method staffUserOnMobileCanNotAddReplyUnderLockedPostOnPostDetailsPage.

@Test(groups = { "discussions-locking-posts-mobile", "discussions-staffUserMobileLocking" })
@Execute(asUser = User.STAFF)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void staffUserOnMobileCanNotAddReplyUnderLockedPostOnPostDetailsPage() {
    PostDetailsPage page = openPageWithPostLockedByDiscussionsModerator();
    Assertion.assertTrue(page.getPost().findNewestPost().isLocked(), SHOULD_BE_LOCKED_MESSAGE);
    final String message = String.format(SHOULD_NOT_ADD_REPLY_MESSAGE, User.STAFF.name(), User.DISCUSSIONS_ADMINISTRATOR.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 32 with PostDetailsPage

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

the class CreatingReplyTests method replyEditorExpandsForUserOnDesktopOnPostDetailsPage.

// User on desktop
@Test(groups = DESKTOP)
@Execute(asUser = User.USER_2)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void replyEditorExpandsForUserOnDesktopOnPostDetailsPage() {
    final PostDetailsPage page = new PostDetailsPage().open(createPostAsUserRemotely().getId());
    final ReplyCreator replyCreator = page.getReplyCreatorDesktop();
    final int originalEditorHeight = replyCreator.getEditorHeight();
    replyCreator.click().clickGuidelinesReadButton();
    int expandedEditorHeight = replyCreator.getEditorHeight();
    Assertion.assertTrue(expandedEditorHeight > originalEditorHeight, "Reply editor should expand.");
    Assertion.assertFalse(replyCreator.isSubmitButtonActive(), SUBMIT_BUTTON_INACTIVE_MESSAGE);
}
Also used : ReplyCreator(com.wikia.webdriver.elements.mercury.components.discussions.common.ReplyCreator) 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 33 with PostDetailsPage

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

the class CreatingReplyTests method anonUserOnDesktopCanNotWriteNewReply.

// Anonymous on desktop
@Test(groups = DESKTOP)
@Execute(asUser = User.ANONYMOUS)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void anonUserOnDesktopCanNotWriteNewReply() {
    final PostDetailsPage page = new PostDetailsPage().open(createPostAsUserRemotely().getId());
    userOnDesktopMustBeLoggedInToUseReplyCreator(page.getReplyCreatorDesktop());
}
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 34 with PostDetailsPage

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

the class CreatingReplyTests method userOnMobileCanCreateReplyOnPostDetailsPage.

// User on mobile
@Test(groups = MOBILE)
@Execute(asUser = User.USER_2, onWikia = MercuryWikis.DISCUSSIONS_2)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void userOnMobileCanCreateReplyOnPostDetailsPage() {
    final PostDetailsPage page = new PostDetailsPage().open(createPostAsUserRemotely().getId());
    final ReplyCreator replyCreator = page.getReplyCreatorMobile();
    assertThatUserCanCreateReply(page, replyCreator);
}
Also used : ReplyCreator(com.wikia.webdriver.elements.mercury.components.discussions.common.ReplyCreator) 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 35 with PostDetailsPage

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

the class LockingPostTests method discussionsModeratorOnMobileCanAddReplyUnderUnlockedPostOnPostDetailsPage.

@Test(groups = { "discussions-locking-posts-mobile", "discussions-discussionsModeratorMobileLocking" })
@Execute(asUser = User.DISCUSSIONS_MODERATOR)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void discussionsModeratorOnMobileCanAddReplyUnderUnlockedPostOnPostDetailsPage() {
    final PostDetailsPage page = openPageWithPostUnlockedByStaff();
    final String text = addReplyOnMobile(page);
    final boolean actual = isReplyNotPresent(page, text);
    final String message = String.format(SHOULD_ADD_REPLY_MESSAGE, User.DISCUSSIONS_MODERATOR.name(), User.STAFF.name());
    Assertion.assertFalse(actual, 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)

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