Search in sources :

Example 11 with SpecialVersionPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage 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 12 with SpecialVersionPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage in project selenium-tests by Wikia.

the class UserAvatar method clickOnAvatarOpensUserMenu.

@Test(groups = "UserAvatar_clickOnAvatarOpensUserMenu")
@Execute(asUser = User.STAFF)
public void clickOnAvatarOpensUserMenu() {
    new SpecialVersionPage().open();
    GlobalNavigation userAvatar = new GlobalNavigation();
    userAvatar.clickUserAvatar();
    Assertion.assertTrue(userAvatar.isUserMenuOpened());
}
Also used : SpecialVersionPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage) GlobalNavigation(com.wikia.webdriver.pageobjectsfactory.pageobject.globalnav.GlobalNavigation) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 13 with SpecialVersionPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage in project selenium-tests by Wikia.

the class UserAvatar method userCanEnterHisProfileFromUserMenu.

@Test(groups = "UserAvatar_userCanEnterHisProfileFromUserMenu")
@Execute(asUser = User.STAFF)
public void userCanEnterHisProfileFromUserMenu() {
    new SpecialVersionPage().open();
    GlobalNavigation userAvatar = new GlobalNavigation();
    userAvatar.clickUserAvatar().clickViewProfile();
    UserProfilePageObject profile = new UserProfilePageObject(driver);
    profile.verifyProfilePage(credentials.userNameStaff);
}
Also used : SpecialVersionPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage) UserProfilePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject) GlobalNavigation(com.wikia.webdriver.pageobjectsfactory.pageobject.globalnav.GlobalNavigation) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 14 with SpecialVersionPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage 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 SpecialVersionPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage 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

SpecialVersionPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVersionPage)18 Test (org.testng.annotations.Test)18 ChatPage (com.wikia.webdriver.pageobjectsfactory.pageobject.chatpageobject.ChatPage)16 Execute (com.wikia.webdriver.common.core.annotations.Execute)2 GlobalNavigation (com.wikia.webdriver.pageobjectsfactory.pageobject.globalnav.GlobalNavigation)2 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)1