Search in sources :

Example 16 with PostDetailsPage

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

the class LockingPostTests method discussionsModeratorOnDesktopCanAddReplyUnderUnlockedPostOnPostDetailsPage.

@Test(groups = { "discussions-locking-posts-desktop", "discussions-discussionsModeratorDesktopLocking" })
@Execute(asUser = User.DISCUSSIONS_MODERATOR)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void discussionsModeratorOnDesktopCanAddReplyUnderUnlockedPostOnPostDetailsPage() {
    final PostDetailsPage page = openPageWithPostUnlockedByStaff();
    final String text = addReplyOnDesktop(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)

Example 17 with PostDetailsPage

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

the class EditingPostTests method userOnMobileCanNotSeeThatPostWasEditedByAuthorOnPostDetailsPage.

@Test(groups = USER_MOBILE_TEST_GROUP)
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void userOnMobileCanNotSeeThatPostWasEditedByAuthorOnPostDetailsPage() {
    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)

Example 18 with PostDetailsPage

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

the class EditingPostTests method discussionsAdministratorOnMobileCanSeeThatPostWasEditedByAdministratorOnPostDetailsPage.

// Discussions Administrator on mobile
@Test(groups = DISCUSSIONS_ADMINISTRATOR_MOBILE_TEST_GROUP)
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
public void discussionsAdministratorOnMobileCanSeeThatPostWasEditedByAdministratorOnPostDetailsPage() {
    final PostEntity.Data data = updatePostAsStaffRemotely(createPostAsUserRemotely());
    final PostEntity post = new PostDetailsPage().open(data.getId()).getPost().findPostById(data.getId());
    Assertion.assertTrue(post.hasEditedBySection(), SHOULD_HAVE_EDITED_BY_SECTION_MESSAGE);
    Assertion.assertEquals(post.getEditedBySectionText(), EDITED_BY_QA_STAFF, SHOULD_HAVE_DETAILED_INFORMATION_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 19 with PostDetailsPage

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

the class EditingPostTests method discussionsAdministratorOnDesktopCanSeeThatPostWasEditedByAdministratorOnPostDetailsPage.

// Discussions Administrator on desktop
@Test(groups = DISCUSSIONS_ADMINISTRATOR_DESKTOP_TEST_GROUP)
@Execute(asUser = User.DISCUSSIONS_ADMINISTRATOR)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void discussionsAdministratorOnDesktopCanSeeThatPostWasEditedByAdministratorOnPostDetailsPage() {
    final PostEntity.Data data = updatePostAsStaffRemotely(createPostAsUserRemotely());
    final PostEntity post = new PostDetailsPage().open(data.getId()).getPost().findPostById(data.getId());
    Assertion.assertTrue(post.hasEditedBySection(), SHOULD_HAVE_EDITED_BY_SECTION_MESSAGE);
    Assertion.assertEquals(post.getEditedBySectionText(), EDITED_BY_QA_STAFF, SHOULD_HAVE_DETAILED_INFORMATION_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 20 with PostDetailsPage

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

the class EditingPostTests method userOnDesktopCanSeeThatPostWasEditedByAdministratorOnPostDetailsPage.

// User on desktop
@Test(groups = USER_DESKTOP_TEST_GROUP)
@Execute(asUser = User.USER)
@InBrowser(browser = Browser.FIREFOX, browserSize = DESKTOP_RESOLUTION)
public void userOnDesktopCanSeeThatPostWasEditedByAdministratorOnPostDetailsPage() {
    final PostEntity.Data data = updatePostAsStaffRemotely(createPostAsUserRemotely());
    final PostEntity post = new PostDetailsPage().open(data.getId()).getPost().findNewestPost();
    Assertion.assertTrue(post.hasEditedBySection(), SHOULD_HAVE_EDITED_BY_SECTION_MESSAGE);
    Assertion.assertEquals(post.getEditedBySectionText(), EDITED_BY_ADMINISTRATORS, EDITED_BY_ADMINISTRATORS_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