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");
}
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());
}
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);
}
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");
}
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");
}
Aggregations