mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/notification_steps.js
Ed Sanders a32999e641 build: Update eslint-config-wikimedia to 0.16.0
Change-Id: Icabf6e065ed5685207731262db72faf848a0a04d
2020-06-04 08:39:32 -07:00

35 lines
1.1 KiB
JavaScript

'use strict';
const ArticlePage = require( '../support/pages/article_page' );
const { iClickTheOverlayCloseButton, iSeeAnOverlay, iDoNotSeeAnOverlay } = require( './common_steps' );
const iHaveNoNotifications = () => {
ArticlePage.notifications_button_element.waitForVisible();
// This is somewhat hacky, but we don't want this test making use of
// Echo's APIs which may change
browser.execute( '$( function () { $( ".notification-count span" ).hide(); } );' );
};
const iClickOnTheNotificationIcon = () => {
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
ArticlePage.notifications_button_element.click();
};
const iShouldSeeTheNotificationsOverlay = () => {
iSeeAnOverlay();
};
const iClickTheNotificationsOverlayCloseButton = () => {
iClickTheOverlayCloseButton();
};
const iShouldNotSeeTheNotificationsOverlay = () => {
iDoNotSeeAnOverlay();
};
module.exports = {
iHaveNoNotifications, iClickOnTheNotificationIcon,
iShouldSeeTheNotificationsOverlay, iClickTheNotificationsOverlayCloseButton,
iShouldNotSeeTheNotificationsOverlay
};