Search in sources :

Example 11 with ForumPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage in project selenium-tests by Wikia.

the class ForumNotificationsTests method userIsNotifiedWhenRegularAndStaffUsersReplyToHerDiscussion.

@Test(groups = { "ForumNotificationsTests_004", "ForumNotificationsTests", "NotificationsTests" }, dependsOnMethods = { "forumNotificationsTests_003_userCLeavesReply", "forumNotificationsTests_002_userBLeavesReply", "forumNotificationsTests_001_userAStartsDiscussion" })
@Execute(asUser = User.USER)
public void userIsNotifiedWhenRegularAndStaffUsersReplyToHerDiscussion() {
    ForumPage forumMainPage = new ForumPage();
    NotificationsComponentObject notifications = new NotificationsComponentObject(driver);
    forumMainPage.openForumMainPage(wikiURL);
    notifications.showNotifications();
    String anchoredLink = null;
    try {
        anchoredLink = notifications.getNotificationLink(User.STAFF.getUserName() + " and " + User.USER_2.getUserName() + " replied to your thread on the " + URLDecoder.decode(forumBoardTitle, "UTF-8").replace("_", " "));
    } catch (UnsupportedEncodingException e) {
        PageObjectLogging.logError("Could not decode forum board name", e);
    }
    String anchor = anchoredLink.substring(anchoredLink.indexOf("#"));
    Assertion.assertEquals(anchor, "#2");
}
Also used : UnsupportedEncodingException(java.io.UnsupportedEncodingException) ForumPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage) NotificationsComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.global_navitagtion.NotificationsComponentObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 12 with ForumPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage in project selenium-tests by Wikia.

the class ForumAnonTests method anonymousUserCanReplyToThreadOnForum.

@Test(groups = { "ForumAnonTests_002" })
public void anonymousUserCanReplyToThreadOnForum() {
    ForumPage forumMainPage = new ForumPage();
    String title = String.format(PageContent.FORUM_TITLE_PREFIX, forumMainPage.getTimeStamp());
    String message = String.format(PageContent.FORUM_MESSAGE, forumMainPage.getTimeStamp());
    forumMainPage.openForumMainPage(wikiURL);
    ForumBoardPage forumBoard = forumMainPage.openForumBoard();
    ForumThreadPageObject forumThread = forumBoard.startDiscussion(title, message, false);
    forumThread.verifyDiscussionTitleAndMessage(title, message);
    forumThread.reply(message);
    forumThread.verifyReplyMessage(1, message);
}
Also used : ForumThreadPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumThreadPageObject) ForumBoardPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumBoardPage) ForumPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage) Test(org.testng.annotations.Test)

Example 13 with ForumPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage in project selenium-tests by Wikia.

the class ForumEditModeTests method adminUserCanCreateNewBoard.

@Test(dataProvider = "getForumName", groups = { "ForumEditModeTests_002" })
@Execute(asUser = User.USER_ADMIN_FORUM)
public void adminUserCanCreateNewBoard(String name) {
    ForumPage forumMainPage = new ForumPage();
    forumMainPage.openForumMainPage(wikiURL);
    ForumManageBoardsPageObject manageForum = forumMainPage.clickManageBoardsButton();
    title = name + manageForum.getTimeStamp();
    description = PageContent.FORUM_DESCRIPTION_PREFIX + manageForum.getTimeStamp();
    manageForum.createNewBoard(title, description);
    manageForum.verifyBoardCreated(title, description);
    manageForum.verifyForumExists(title, wikiURL);
}
Also used : ForumManageBoardsPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumManageBoardsPageObject) ForumPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 14 with ForumPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage in project selenium-tests by Wikia.

the class ForumThreadTests method threadHistoryPageContainsTableAndCells.

@Execute(asUser = User.STAFF)
@Test(groups = { "ForumThreadTests_004" })
public void threadHistoryPageContainsTableAndCells() {
    ForumPage forumMainPage = new ForumPage();
    String title = String.format(PageContent.FORUM_TITLE_PREFIX, forumMainPage.getTimeStamp());
    String message = String.format(PageContent.FORUM_MESSAGE, forumMainPage.getTimeStamp());
    forumMainPage.openForumMainPage(wikiURL);
    ForumBoardPage forumBoard = forumMainPage.openForumBoard();
    ForumThreadPageObject forumThread = forumBoard.startDiscussion(title, message, false);
    forumThread.verifyDiscussionTitleAndMessage(title, message);
    ForumHistoryPageObject forumHistory = forumThread.openHistory();
    forumHistory.verifyImportandPageElements();
}
Also used : ForumHistoryPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumHistoryPageObject) ForumThreadPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumThreadPageObject) ForumBoardPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumBoardPage) ForumPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 15 with ForumPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage in project selenium-tests by Wikia.

the class ForumThreadTests method staffUserCanRemoveThreadAndUndoRemoval.

@Execute(asUser = User.STAFF)
@Test(groups = { "ForumThreadTests_002", "Forum" })
public void staffUserCanRemoveThreadAndUndoRemoval() {
    ForumPage forumMainPage = new ForumPage();
    String title = String.format(PageContent.FORUM_TITLE_PREFIX, forumMainPage.getTimeStamp());
    String message = String.format(PageContent.FORUM_MESSAGE, forumMainPage.getTimeStamp());
    forumMainPage.openForumMainPage(wikiURL);
    ForumBoardPage forumBoard = forumMainPage.openForumBoard();
    ForumThreadPageObject forumThread = forumBoard.startDiscussion(title, message, false);
    forumThread.verifyDiscussionTitleAndMessage(title, message);
    forumThread.removeThread("QA reason");
    forumThread.verifyThreadRemoved();
    forumThread.undoRemove();
    forumThread.verifyDiscussionTitleAndMessage(title, message);
}
Also used : ForumThreadPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumThreadPageObject) ForumBoardPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumBoardPage) ForumPage(com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

ForumPage (com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumPage)20 Test (org.testng.annotations.Test)20 Execute (com.wikia.webdriver.common.core.annotations.Execute)18 ForumBoardPage (com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumBoardPage)14 ForumThreadPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumThreadPageObject)10 ForumManageBoardsPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumManageBoardsPageObject)4 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)1 NotificationsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.global_navitagtion.NotificationsComponentObject)1 ForumHistoryPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.forumpageobject.ForumHistoryPageObject)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1