mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-04 20:28:49 +00:00
4bbaf77c2a
This is in preparation of adding more item models and widget types, and in preparation of switching the notification widget away from being a select widget. Change-Id: I518fb3d80f4f67d677c21ca5593638269acfa544
20 lines
646 B
Ruby
20 lines
646 B
Ruby
class Notifications
|
|
include PageObject
|
|
|
|
link(:badge)
|
|
link(:badge_unseen, css: '.mw-echo-unseen-notifications')
|
|
link(:mark_all_as_read, css: '.mw-echo-ui-notificationsWidget-markAllReadButton > a')
|
|
div(:popup, css: '.mw-echo-ui-notificationBadgeButtonPopupWidget-popup')
|
|
span(:title, css: '.oo-ui-popupWidget-head > .oo-ui-labelElement-label')
|
|
div(:notifications_container, css: '.mw-echo-ui-notificationsWidget')
|
|
|
|
def when_loaded
|
|
title_element.when_present
|
|
notifications_container_element.when_present
|
|
end
|
|
|
|
def num_unread_notifications
|
|
div_elements(css: '.mw-echo-ui-notificationItemWidget-unread').size
|
|
end
|
|
end
|