Class NotificationsTrayPage


  • public class NotificationsTrayPage
    extends ViewPage
    Represents the user Notifications tab.
    Since:
    9.4RC1
    Version:
    $Id: 3f7560348a44f339f7b5f339e40864c660c1c91c $
    • Constructor Detail

      • NotificationsTrayPage

        public NotificationsTrayPage()
        Constructor.
    • 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 notifications
        wiki - the wiki on which to get notifications
        expectedUnread - 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 notifications
        wiki - the wiki on which to get notifications
        expectedUnread - the number of expected unread notifications to wait for
        timeout - 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 user
        password - 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