Class ChatWindow
java.lang.Object
com.onenetwork.platform.tools.test.ui.components.Component
com.onenetwork.platform.tools.test.ui.components.Container
com.onenetwork.platform.tools.test.ui.components.Window
com.onenetwork.platform.tools.test.ui.components.ChatWindow
public class ChatWindow extends Window
Represents a window that contains all of the Chat Containers.
There is only a single instance of ChatWindow per CommandCenter.
-
Field Summary
Fields Modifier and Type Field Description protected static PlatformLogger
LOG
-
Constructor Summary
Constructors Constructor Description ChatWindow(UIContext context, org.openqa.selenium.WebElement element)
ChatWindow. -
Method Summary
Modifier and Type Method Description void
clickOnAFriend(java.lang.String friendDisplayName)
Iff the friend exists, clicks on the Friend with the given display name.void
clickOnContextMenuItem(java.lang.String itemName)
Clicks on a context menu item.void
closeActiveTab()
Closes active tab of the ChatContainer TabPaneljava.lang.String
getActiveTabTitle()
Returns the title of the ChatContainer's active tab.TabPanel
getChatPanel()
Returns the Chat TabPanel which contains Notification and Chat panels.java.lang.String
getFriendStatus(java.lang.String friendDisplayName)
Returns friend's status Status can be one of the following: online offline request-for-me request-for-them blocked nonejava.util.Map<java.lang.String,java.lang.String>
getListOfFriends()
Returns list of Friends with their status.java.util.Map<java.lang.String,java.lang.String>
getListOfUsers()
Returns list of Users(from Find list) with their status.int
getMessageBoxCount(Container container, boolean includeHistory)
Returns the total number of MessageBoxes within the container.java.util.List<MessageBox>
getMessageBoxes(Container container, boolean includeHistory)
Returns list of MessageBoxes within the container.TextAreaField
getMessageTypeField(Container container)
Returns the text area to type messages into.TabPanel
getNavigationPanel()
Returns the Navigation TabPanel which contains Friends and Find lists.TextField
getSearchForFindList()
Returns the Search textfield of the Find list.TextField
getSearchForFriendsList()
Returns the Search textfield of the Friends list.org.openqa.selenium.WebElement
getShowHistoryLink(Container container)
Returns clickable Show History link iff it exits.org.openqa.selenium.WebElement
getShowHistoryText(Container container)
Returns the span element which replaces show history link with an informational message.org.openqa.selenium.WebElement
getShowMoreLink()
Opens the Find tab and returns Show More link.org.openqa.selenium.WebElement
getTabNotifierCounter(java.lang.String tabTitle)
Finds the tab with the given title and returns it's notifier counter.java.lang.String
getUserStatus(java.lang.String userDisplayName)
Returns friend's status Status can be one of the following: online offline request-for-me request-for-them blocked nonevoid
rightClickOnAFriend(java.lang.String friendDisplayName)
Right clicks on a friend and opens context menu.void
rightClickOnAuser(java.lang.String userDisplayName)
Right clicks on a user and opens context menu.Methods inherited from class com.onenetwork.platform.tools.test.ui.components.Window
close, getWindowMessage, getWindowType, hide
Methods inherited from class com.onenetwork.platform.tools.test.ui.components.Container
clickAction, clickAction, clickMenuItem, clickOneLogo, createFieldFromLabel, findXTypeFromInput, getActions, getActions, getButton, getCC1InnerTab, getComponent, getDashboard, getFieldByLabel, getFieldByLabelCC15, getFieldByLabelFlux, getFieldByLabelNew, getFieldByMultiLineLabel, getFieldByName, getFieldError, getFilterOverlayPanel, getFormPanel, getGrid, getGridByClass, getGrids, getLink, getMenu, getMessagePanel, getMessagePanelFlux, getNotificationCollaboration, getProbelmDetail, getProblemList, getReadOnlyFieldByLabelCC15, getReport, getReports, getSearchContext, getSearchPageContext, getTabPanel, getTabPanelByClass, getTemplateDisplay, getTreePanel, getWindow, getWindows, getXTypeFromFormItem, getXTypeFromId, getXTypeFromLabel, isRequired, switchDriver, waitForSuccessMessage
Methods inherited from class com.onenetwork.platform.tools.test.ui.components.Component
getEl, getId, isDisplayed, isRequired
-
Field Details
-
Constructor Details
-
ChatWindow
ChatWindow. There will be only one ChatWindow per CommandCenter.- Parameters:
context
-element
-
-
-
Method Details
-
getChatPanel
Returns the Chat TabPanel which contains Notification and Chat panels.- Returns:
- the Chat TabPanel which contains Notification and Chat panels.
-
getNavigationPanel
Returns the Navigation TabPanel which contains Friends and Find lists.- Returns:
- the Navigation TabPanel which contains Friends and Find lists.
-
getSearchForFindList
Returns the Search textfield of the Find list.- Returns:
- search textfield of the Find list.
-
getSearchForFriendsList
Returns the Search textfield of the Friends list.- Returns:
- search textfield of the Friends list.
-
getActiveTabTitle
public java.lang.String getActiveTabTitle()Returns the title of the ChatContainer's active tab.- Returns:
- title of the ChatContainer's active tab.
-
getTabNotifierCounter
public org.openqa.selenium.WebElement getTabNotifierCounter(java.lang.String tabTitle)Finds the tab with the given title and returns it's notifier counter.- Parameters:
tabTitle
-- Returns:
- NotifierCounter of the tab or null iff it does not exist.
-
closeActiveTab
public void closeActiveTab()Closes active tab of the ChatContainer TabPanel -
getShowHistoryLink
Returns clickable Show History link iff it exits.- Parameters:
container
- - Notifications or individual Chat container- Returns:
- show history link or null iff it does not exist.
-
getShowHistoryText
Returns the span element which replaces show history link with an informational message. Such as "No More Messages"- Parameters:
container
- - Notifications or individual Chat container- Returns:
- show history span text or null iff it does not exist.
-
getMessageBoxes
Returns list of MessageBoxes within the container. If includeHistory is false, messages from previous sessions are ignored.- Parameters:
container
-includeHistory
- - set to false if history messages should not be returned- Returns:
- List of MessageBoxes as WebElements
-
getMessageBoxCount
Returns the total number of MessageBoxes within the container. If includeHistory is false, messages from previous sessions are ignored.- Parameters:
container
-includeHistory
- - set to false if history messages should not be returned- Returns:
- total number of MessageBoxes
-
getMessageTypeField
Returns the text area to type messages into.- Parameters:
container
- - open tab in the chat tabpanel- Returns:
-
getListOfUsers
public java.util.Map<java.lang.String,java.lang.String> getListOfUsers()Returns list of Users(from Find list) with their status. Status can be one of the following: online offline request-for-me request-for-them blocked none- Returns:
- Alphabetically Ordered Map of User's DisplayName -> status
-
getListOfFriends
public java.util.Map<java.lang.String,java.lang.String> getListOfFriends()Returns list of Friends with their status. Status can be one of the following: online offline request-for-me request-for-them blocked none- Returns:
- Alphabetically Ordered Map of Friend's DisplayName -> status
-
getUserStatus
public java.lang.String getUserStatus(java.lang.String userDisplayName)Returns friend's status Status can be one of the following: online offline request-for-me request-for-them blocked none- Parameters:
userDisplayName
-- Returns:
- user's status or null if the user can not be found.
-
getFriendStatus
public java.lang.String getFriendStatus(java.lang.String friendDisplayName)Returns friend's status Status can be one of the following: online offline request-for-me request-for-them blocked none- Parameters:
friendDisplayName
-- Returns:
- friend's status or null if the friend can not be found.
-
getShowMoreLink
public org.openqa.selenium.WebElement getShowMoreLink()Opens the Find tab and returns Show More link.- Returns:
- "Show More" link as WebElement
-
clickOnAFriend
public void clickOnAFriend(java.lang.String friendDisplayName)Iff the friend exists, clicks on the Friend with the given display name. Iff the friend does not exist, skips.- Parameters:
friendDisplayName
- - full display name of the user including enterprise name
-
rightClickOnAuser
public void rightClickOnAuser(java.lang.String userDisplayName)Right clicks on a user and opens context menu.- Parameters:
userDisplayName
- - display name of the user
-
rightClickOnAFriend
public void rightClickOnAFriend(java.lang.String friendDisplayName)Right clicks on a friend and opens context menu.- Parameters:
friendDisplayName
- - display name of the friend
-
clickOnContextMenuItem
public void clickOnContextMenuItem(java.lang.String itemName)Clicks on a context menu item. Make sure context menu is open before calling this method.- Parameters:
itemName
- - name of the context menu item
-