Search in sources :

Example 11 with ChatPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage in project selenium-tests by Wikia.

the class ChatTests method userCanSendMessageOnWallAndPrivate.

@Test
public void userCanSendMessageOnWallAndPrivate() {
    ChatPage chatUserThree = openChatForUser(userThree, userThreePassword);
    switchToWindow(1);
    new SpecialVersionPage().open();
    ChatPage chatUserFour = openChatForUser(userFour, userFourPassword);
    chatUserFour.writeOnChat(MESSAGE_ON_MAIN_CHAT);
    switchToWindow(0);
    Assertion.assertTrue(chatUserFour.isMessageOnChat(MESSAGE_ON_MAIN_CHAT), MESSAGE_ON_CHAT_NOT_DISPLAYED_ERROR);
    switchToWindow(1);
    chatUserFour.selectPrivateMessageToUser(userThree);
    Assertion.assertTrue(chatUserFour.isPrivateMessageHeaderDisplayed());
    chatUserFour.writeOnChat(MESSAGE_ON_PRIVATE_CHAT);
    switchToWindow(0);
    Assertion.assertTrue(chatUserThree.isPrivateMessageHeaderDisplayed(), "PRIVATE MESSAGE HEDER IS NOT DISPLAYED");
    Assertion.assertTrue(chatUserThree.isPrivateMessageNotificationDisplayed(), "PRIVATE MESSAGE NOTIFICATION ARE NOT DISPLAYED");
    chatUserThree.clickOnUserInPrivateMessageSection(userFour);
    Assertion.assertTrue(chatUserThree.isMessageOnChat(MESSAGE_ON_PRIVATE_CHAT), MESSAGE_ON_CHAT_NOT_DISPLAYED_ERROR);
}
Also used : ChatPage(com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage) SpecialVersionPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage) Test(org.testng.annotations.Test)

Example 12 with ChatPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage in project selenium-tests by Wikia.

the class ChatTests method bannedUserCanNotEnterTheChat.

@Test
public void bannedUserCanNotEnterTheChat() {
    ChatPage chatUserStaff = openChatForUser(userStaff, userStaffPassword);
    switchToWindow(1);
    SpecialVersionPage chatWindow = new SpecialVersionPage().open();
    ChatPage chatUserToBeBanned = openChatForUser(userToBeBanned, userToBeBannedPassword);
    switchToWindow(0);
    chatUserStaff.clickOnDifferentUser(userToBeBanned);
    chatUserStaff.banUser(userToBeBanned);
    switchToWindow(1);
    //there is a minimum time between user gets banned, and action to take effect
    try {
        Thread.sleep(5000);
        chatWindow.refreshPage();
        Assertion.assertTrue(chatUserToBeBanned.isPermissionsErrorTitleDisplayed(), "PERMISSION ERROR IS NOT DISPLAYED");
    } catch (InterruptedException e) {
        e.printStackTrace();
    } finally {
        switchToWindow(0);
        chatUserStaff.unBanUser(userToBeBanned);
    }
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    switchToWindow(1);
    chatWindow.refreshPage();
    Assertion.assertTrue(chatUserToBeBanned.isUserOnChat(), "USER IS NOT LOGGED IN TO CHAT");
}
Also used : ChatPage(com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage) SpecialVersionPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage) Test(org.testng.annotations.Test)

Example 13 with ChatPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage in project selenium-tests by Wikia.

the class ChatTests method messageAppearsWhenMaxLengthExceeded.

@Test
public void messageAppearsWhenMaxLengthExceeded() {
    ChatPage chatUserOne = openChatForUser(userOne, userOnePassword);
    chatUserOne.writeLongMessage(1000);
    Assertion.assertTrue(chatUserOne.isMessageTooLongWarningDisplayed(), "WARNING ABOUT TOO LONG MESSAGE NOT DISPLAYED");
}
Also used : ChatPage(com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage) Test(org.testng.annotations.Test)

Example 14 with ChatPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage in project selenium-tests by Wikia.

the class ChatTestsStaff method staffUserCanSendPrivateMessage.

@Test
public void staffUserCanSendPrivateMessage() {
    ChatPage chatUserOne = openChatForUser(credentials.userNameStaff, credentials.passwordStaff);
    switchToWindow(1);
    new SpecialVersionPage().open();
    ChatPage chatUserTwo = openChatForUser(credentials.userNameStaff2, credentials.passwordStaff2);
    chatUserTwo.writeOnChat(MESSAGE_ON_MAIN_CHAT);
    switchToWindow(0);
    Assertion.assertTrue(chatUserOne.isMessageOnChat(MESSAGE_ON_MAIN_CHAT), MESSAGE_ON_CHAT_NOT_DISPLAYED_ERROR);
    switchToWindow(1);
    chatUserTwo.selectPrivateMessageToUser(credentials.userNameStaff);
    Assertion.assertTrue(chatUserTwo.isPrivateMessageHeaderDisplayed());
    chatUserTwo.writeOnChat(MESSAGE_ON_PRIVATE_CHAT);
    switchToWindow(0);
    Assertion.assertTrue(chatUserOne.isPrivateMessageHeaderDisplayed(), "PRIVATE MESSAGE HEDER IS DISPLAYED");
    Assertion.assertTrue(chatUserOne.isPrivateMessageNotificationDisplayed(), "PRIVATE MESSAGE HEDER IS DISPLAYED");
    chatUserOne.clickOnUserInPrivateMessageSection(credentials.userNameStaff2);
    Assertion.assertTrue(chatUserOne.isMessageOnChat(MESSAGE_ON_PRIVATE_CHAT), "MESSAGE ON PRIVATE CHAT IS NOT DISPLAYED");
}
Also used : ChatPage(com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage) SpecialVersionPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage) Test(org.testng.annotations.Test)

Example 15 with ChatPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage in project selenium-tests by Wikia.

the class ChatTestsStaff method staffOptionsAreNotDisplayedOnOtherStaffUser.

@Test
public void staffOptionsAreNotDisplayedOnOtherStaffUser() {
    openChatForUser(credentials.userNameStaff, credentials.passwordStaff);
    switchToWindow(1);
    new SpecialVersionPage().open();
    ChatPage chatUserStaff2 = openChatForUser(credentials.userNameStaff2, credentials.passwordStaff2);
    chatUserStaff2.clickOnDifferentUser(credentials.userNameStaff);
    Assertion.assertFalse(chatUserStaff2.areStaffOptionsDisplayed(), "STAFF OPTIONS ARE DISPLAERD");
}
Also used : ChatPage(com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage) SpecialVersionPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage) Test(org.testng.annotations.Test)

Aggregations

ChatPage (com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage)19 Test (org.testng.annotations.Test)17 SpecialVersionPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage)16 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)2