2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-04-08 21:11:33 +00:00
|
|
|
const ArticlePage = require( '../support/pages/article_page' );
|
|
|
|
const { iClickTheOverlayCloseButton, iSeeAnOverlay, iDoNotSeeAnOverlay } = require( './common_steps' );
|
|
|
|
|
|
|
|
const iHaveNoNotifications = () => {
|
2020-06-15 14:54:05 +00:00
|
|
|
ArticlePage.notifications_button_element.waitForDisplayed();
|
2019-04-08 21:11:33 +00:00
|
|
|
// This is somewhat hacky, but we don't want this test making use of
|
|
|
|
// Echo's APIs which may change
|
2024-06-03 12:06:43 +00:00
|
|
|
browser.execute( '$( () => { $( ".notification-count span" ).hide(); } );' );
|
2019-04-08 21:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iClickOnTheNotificationIcon = () => {
|
2019-07-02 21:10:10 +00:00
|
|
|
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
2022-02-03 20:18:02 +00:00
|
|
|
ArticlePage.notifications_button_element.waitForDisplayed();
|
2019-04-08 21:11:33 +00:00
|
|
|
ArticlePage.notifications_button_element.click();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iShouldSeeTheNotificationsOverlay = () => {
|
|
|
|
iSeeAnOverlay();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iClickTheNotificationsOverlayCloseButton = () => {
|
|
|
|
iClickTheOverlayCloseButton();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iShouldNotSeeTheNotificationsOverlay = () => {
|
|
|
|
iDoNotSeeAnOverlay();
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
iHaveNoNotifications, iClickOnTheNotificationIcon,
|
|
|
|
iShouldSeeTheNotificationsOverlay, iClickTheNotificationsOverlayCloseButton,
|
|
|
|
iShouldNotSeeTheNotificationsOverlay
|
|
|
|
};
|