Search in sources :

Example 16 with ChatPage

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

the class ChatTests method verifySwitchingBetweenMainAndPrivateSections.

@Test
public void verifySwitchingBetweenMainAndPrivateSections() {
    ChatPage chatUserOne = openChatForUser(userOne, userOnePassword);
    switchToWindow(1);
    new SpecialVersionPage().open();
    ChatPage chatUserTwo = openChatForUser(userTwo, userTwoPassword);
    chatUserTwo.writeOnChat(MESSAGE_ON_MAIN_CHAT);
    switchToWindow(0);
    Assertion.assertTrue(chatUserOne.isMessageOnChat(MESSAGE_ON_MAIN_CHAT), MESSAGE_ON_CHAT_NOT_DISPLAYED_ERROR);
    chatUserOne.selectPrivateMessageToUser(userTwo);
    Assertion.assertTrue(chatUserOne.isUserInPrivateSectionDisplayed(userTwo), USER_IN_PRIVATE_SECTION_NOT_DISPLAYED_ERROR);
    Assertion.assertTrue(chatUserOne.isPrivateChatOpen(), "PRIVATE CHAT IS NOT OPENED");
    chatUserOne.clickOnMainChat();
    Assertion.assertTrue(chatUserOne.isMessageOnChat(MESSAGE_ON_MAIN_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 17 with ChatPage

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

the class ChatTests method openChatForUser.

private ChatPage openChatForUser(String userName, String password) {
    WikiBasePageObject base = new WikiBasePageObject();
    base.loginAs(userName, password, wikiURL);
    return new ChatPage().open();
}
Also used : ChatPage(com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)

Example 18 with ChatPage

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

the class ChatTests method blockedUserCanNotCreatePrivateMessage.

@Test
public void blockedUserCanNotCreatePrivateMessage() {
    ChatPage chatUserOne = openChatForUser(userOne, userOnePassword);
    switchToWindow(1);
    new SpecialVersionPage().open();
    ChatPage chatUserFive = openChatForUser(userFive, userFivePassword);
    switchToWindow(0);
    chatUserOne.clickOnDifferentUser(userFive);
    chatUserOne.selectPrivateMessageToUser(userFive);
    Assertion.assertTrue(chatUserOne.isUserInPrivateSectionDisplayed(userFive));
    chatUserOne.clickOnUserInPrivateMessageSection(userFive);
    chatUserOne.blockPrivateMessageFromUser(userFive);
    switchToWindow(1);
    chatUserFive.refreshPage();
    chatUserFive.clickOnDifferentUser(userOne);
    Assertion.assertFalse(chatUserFive.isPrivateMessageButtonDisplayed(), "PRIVATE MESSAGE BUTTON IS DISPLAYED");
    switchToWindow(0);
    chatUserOne.allowPrivateMessageFromUser(userFive);
    Assertion.assertTrue(chatUserOne.isUserInPrivateSectionDisplayed(userFive), USER_IN_PRIVATE_SECTION_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 19 with ChatPage

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

the class ChatTests method userCanBeKickedOutFromChat.

@Test
public void userCanBeKickedOutFromChat() {
    ChatPage chatUserOne = openChatForUser(userOne, userOnePassword);
    switchToWindow(1);
    new SpecialVersionPage().open();
    ChatPage chatStaffUser = openChatForUser(userStaff, userStaffPassword);
    chatStaffUser.clickOnDifferentUser(userOne);
    chatStaffUser.clickOnUserOptionsKickButton();
    switchToWindow(0);
    Assertion.assertTrue(chatUserOne.isUserKickedFromChat(), "USER IS NOT KICKED FROM CHAT");
}
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