Class NotificationsTrayPage
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.BasePage
-
- org.xwiki.test.ui.po.ViewPage
-
- org.xwiki.platform.notifications.test.po.NotificationsTrayPage
-
public class NotificationsTrayPage extends ViewPage
Represents the user Notifications tab.- Since:
- 9.4RC1
- Version:
- $Id: 3f7560348a44f339f7b5f339e40864c660c1c91c $
-
-
Constructor Summary
Constructors Constructor Description NotificationsTrayPage()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areNotificationsAvailable()
Test if the text "No notification available!" is displayed in the notification tray.boolean
arePageAndChildrenWatched()
void
clearAllNotifications()
Click the button «Clear All» in the notification tray.String
getNotificationContent(int notificationNumber)
Get the content of a notification.String
getNotificationDescription(int notificationNumber)
Get the description of a notification.String
getNotificationPage(int notificationNumber)
Get the page concerned by a notification (if any).String
getNotificationRawContent(int notificationNumber)
Get the raw content of a notification.NotificationsRSS
getNotificationRSS(String username, String password)
org.openqa.selenium.WebElement
getNotificationsButton()
int
getNotificationsCount()
Get the number of available notifications.int
getNotificationsListCount()
Get the number of notifications displayed.String
getNotificationType(int notificationNumber)
Get the type of notification (bold text before notification content).int
getReadNotificationsCount()
Get the number of read notifications.int
getUnreadNotificationsCount()
Get the number of unread notifications.boolean
isMenuOpen()
boolean
isNotificationMenuVisible()
boolean
isPageOnlyWatched()
boolean
isWikiWatched()
void
markAsRead(int notificationNumber)
Mark a notification as read.void
setPageAndChildrenWatchedState(boolean watched)
Watch or unwatch the current "space".void
setPageOnlyWatchedState(boolean watched)
Watch or unwatch the current page.void
setWikiWatchedState(boolean watched)
Watch or unwatch the current wiki.void
showNotificationTray()
Ensure that the notifications tray is visible.static void
waitOnNotificationCount(String userId, String wiki, int expectedUnread)
Wait until the given number of unread notification is received.static void
waitOnNotificationCount(String userId, String wiki, int expectedUnread, int timeout)
Wait until the given number of unread notification is received.-
Methods inherited from class org.xwiki.test.ui.po.ViewPage
clickBreadcrumbLink, clickWantedLink, clickWantedLink, contentContainsElement, editSection, exists, getBreadcrumb, getBreadcrumbContent, getContent, getLastModifiedText, getPageBackgroundColor, getTitleColor, getTitleFontFamily, getTranslateButton, hasBreadcrumbContent, hasBreadcrumbContent, hasTranslateButton, isInlinePage, openCommentsDocExtraPane, openHistoryDocExtraPane, openInformationDocExtraPane, scrollToTop, useShortcutForDocExtraPane, useShortcutKeyForCommentPane, useShortcutKeyForHistoryPane, useShortcutKeyForInformationPane, waitForDocExtraPaneActive, waitUntilContent
-
Methods inherited from class org.xwiki.test.ui.po.BasePage
canDelete, clickAdminActionsSubMenuEntry, clickEditSubMenuEntry, clickLocale, clickMoreActionsSubMenuEntry, copy, createInlinePage, createPage, delete, deletePage, edit, editClass, editInline, editObjects, editRights, editWiki, editWYSIWYG, getCurrentUser, getDocumentTitle, getDrawerMenu, getEditURL, getErrorContent, getHTMLMetaDataValue, getLocales, getMetaDataValue, getPageTitle, getPageURL, getXWikiMessageContent, hasLeftPanel, hasLoginLink, hasNotificationsMenu, hasRenderingError, isAuthenticated, isForbidden, isNewDocument, isNotificationsMenuOpen, login, logout, register, reloadPage, rename, sendKeys, toggleActionMenu, toggleNotificationsMenu, useShortcutKeyForClassEditing, useShortcutKeyForEditing, useShortcutKeyForInlineEditing, useShortcutKeyForObjectEditing, useShortcutKeyForPageDeletion, useShortcutKeyForPageRenaming, useShortcutKeyForRightsEditing, useShortcutKeyForSourceViewer, useShortcutKeyForWikiEditing, useShortcutKeyForWysiwygEditing, validateWCAG, validateWCAG, validateWCAG, viewChildren, watchDocument, watchSpace, watchWiki
-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Method Detail
-
waitOnNotificationCount
public static void waitOnNotificationCount(String userId, String wiki, int expectedUnread)
Wait until the given number of unread notification is received. This method uses an AJAX request to the REST notification endpoint to compute how many unread notification the given user has on the given wiki, using user preferences.- Parameters:
userId
- the serialized user reference for which to get notificationswiki
- the wiki on which to get notificationsexpectedUnread
- the number of expected unread notifications to wait for- Since:
- 12.6
-
waitOnNotificationCount
public static void waitOnNotificationCount(String userId, String wiki, int expectedUnread, int timeout)
Wait until the given number of unread notification is received. This method uses an AJAX request to the REST notification endpoint to compute how many unread notification the given user has on the given wiki, using user preferences.- Parameters:
userId
- the serialized user reference for which to get notificationswiki
- the wiki on which to get notificationsexpectedUnread
- the number of expected unread notifications to wait fortimeout
- the time delay in seconds before stopping the notifications count- Since:
- 12.8RC1
-
isMenuOpen
public boolean isMenuOpen()
- Returns:
- either or not the notification menu is open
-
isNotificationMenuVisible
public boolean isNotificationMenuVisible()
- Returns:
true
only if the notification menu icon (small bell) is displayed.- Since:
- 12.6, 12.5.1
-
areNotificationsAvailable
public boolean areNotificationsAvailable()
Test if the text "No notification available!" is displayed in the notification tray.- Returns:
- true if the text is not displayed
-
getNotificationsCount
public int getNotificationsCount()
Get the number of available notifications.- Returns:
- Number of unread notifications, 0 if no notification available and MAX_INT if 20+ notifications
-
clearAllNotifications
public void clearAllNotifications()
Click the button «Clear All» in the notification tray.
-
showNotificationTray
public void showNotificationTray()
Ensure that the notifications tray is visible.
-
getUnreadNotificationsCount
public int getUnreadNotificationsCount()
Get the number of unread notifications.- Returns:
- number of unread notifications
-
getReadNotificationsCount
public int getReadNotificationsCount()
Get the number of read notifications.- Returns:
- number of read notifications
-
getNotificationsListCount
public int getNotificationsListCount()
Get the number of notifications displayed.- Returns:
- number of notifications
-
getNotificationType
public String getNotificationType(int notificationNumber)
Get the type of notification (bold text before notification content).- Parameters:
notificationNumber
- index of the notification in the list- Returns:
- notification type
-
getNotificationContent
public String getNotificationContent(int notificationNumber)
Get the content of a notification.- Parameters:
notificationNumber
- index of the notification in the list- Returns:
- notification content
-
getNotificationPage
public String getNotificationPage(int notificationNumber)
Get the page concerned by a notification (if any).- Parameters:
notificationNumber
- index of the notification in the list- Returns:
- notification page
-
getNotificationDescription
public String getNotificationDescription(int notificationNumber)
Get the description of a notification.- Parameters:
notificationNumber
- index of the notification in the list- Returns:
- notification description
-
getNotificationRawContent
public String getNotificationRawContent(int notificationNumber)
Get the raw content of a notification.- Parameters:
notificationNumber
- index of the notification in the list- Returns:
- the notification raw content
-
markAsRead
public void markAsRead(int notificationNumber)
Mark a notification as read.- Parameters:
notificationNumber
- index of the notification in the list
-
isPageOnlyWatched
public boolean isPageOnlyWatched()
- Returns:
- either or not the page is watched
- Since:
- 10.8RC1, 9.11.8
-
arePageAndChildrenWatched
public boolean arePageAndChildrenWatched()
- Returns:
- either or not the "space" is watched
- Since:
- 10.8RC1, 9.11.8
-
isWikiWatched
public boolean isWikiWatched()
- Returns:
- either or not the wiki is watched
- Since:
- 10.8RC1, 9.11.8
-
setPageOnlyWatchedState
public void setPageOnlyWatchedState(boolean watched) throws Exception
Watch or unwatch the current page.- Parameters:
watched
- the desired state- Throws:
Exception
- if the expected state cannot be set- Since:
- 10.8RC1, 9.11.8
-
setPageAndChildrenWatchedState
public void setPageAndChildrenWatchedState(boolean watched) throws Exception
Watch or unwatch the current "space".- Parameters:
watched
- the desired state- Throws:
Exception
- if the expected state cannot be set- Since:
- 10.8RC1, 9.11.8
-
setWikiWatchedState
public void setWikiWatchedState(boolean watched) throws Exception
Watch or unwatch the current wiki.- Parameters:
watched
- the desired state- Throws:
Exception
- if the expected state cannot be set- Since:
- 10.8RC1, 9.11.8
-
getNotificationRSS
public NotificationsRSS getNotificationRSS(String username, String password)
- Parameters:
username
- name of the current userpassword
- password of the current user- Returns:
- the rss feed
- Since:
- 11.5RC1, 11.4, 11.3.1
-
getNotificationsButton
public org.openqa.selenium.WebElement getNotificationsButton()
- Returns:
- The tray notification button.
- Since:
- 12.8RC1
-
-