2015-02-20 16:54:06 +00:00
|
|
|
# Page Object describing Headings, Flyouts, and Overlay in Echo
|
2014-08-04 23:07:37 +00:00
|
|
|
class ArticlePage
|
|
|
|
include PageObject
|
2014-09-22 22:00:35 +00:00
|
|
|
|
2015-02-09 20:47:34 +00:00
|
|
|
h1(:first_heading, id: 'firstHeading')
|
2014-08-13 23:11:38 +00:00
|
|
|
|
2015-09-25 21:17:54 +00:00
|
|
|
li(:notifications_alert, css: '#pt-notifications-alert')
|
|
|
|
li(:notifications_message, css: '#pt-notifications-message')
|
|
|
|
link(:notifications_badge_alert, css: '#pt-notifications-alert a')
|
|
|
|
link(:notifications_badge_message, css: '#pt-notifications-message a')
|
2015-09-29 12:59:05 +00:00
|
|
|
div(:popup_alert,
|
|
|
|
css: '#pt-notifications-alert .mw-echo-ui-notificationBadgeButtonPopupWidget-popup')
|
|
|
|
div(:popup_message,
|
|
|
|
css: '#pt-notifications-message .mw-echo-ui-notificationBadgeButtonPopupWidget-popup')
|
2015-09-25 21:17:54 +00:00
|
|
|
|
2015-09-29 00:07:37 +00:00
|
|
|
link(:notifications_badge_alert_unseen,
|
|
|
|
css: '#pt-notifications-alert a.mw-echo-unseen-notifications')
|
|
|
|
link(:notifications_badge_message_unseen,
|
|
|
|
css: '#pt-notifications-message a.mw-echo-unseen-notifications')
|
|
|
|
|
2015-09-25 21:17:54 +00:00
|
|
|
# Popup elements
|
|
|
|
button(:mark_all_read_button, css: '.mw-echo-ui-notificationsWidget-markAllReadButton')
|
|
|
|
def popup_title(popupElement)
|
2015-09-29 12:59:05 +00:00
|
|
|
popupElement.when_present.span_element(
|
|
|
|
css: '.oo-ui-popupWidget-head > .oo-ui-labelElement-label')
|
2015-09-25 21:17:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Notification elements
|
|
|
|
a(:notification_option, css: '.mw-echo-ui-notificationOptionWidget')
|
2015-09-29 00:07:37 +00:00
|
|
|
a(:notification_option_unread, css: '.mw-echo-ui-notificationOptionWidget-unread')
|
2015-09-25 21:17:54 +00:00
|
|
|
a(:notification_option_markRead, css: '.mw-echo-ui-notificationOptionWidget-markAsReadButton')
|
2015-09-29 00:07:37 +00:00
|
|
|
def num_unread_message_notifications
|
|
|
|
# Count the number of elements that are unseen notification divs
|
|
|
|
# Taken from http://stackoverflow.com/questions/6433084/how-to-get-the-number-of-elements-having-same-attribute-in-html-in-watir
|
|
|
|
browser.elements(
|
|
|
|
css: '.mw-echo-ui-notificationOptionWidget-unread.mw-echo-ui-notificationOptionWidget-message'
|
|
|
|
).size
|
|
|
|
end
|
2014-08-04 23:07:37 +00:00
|
|
|
end
|