1 import { PageHelper } from '../page-helper.po';
3 export class NotificationSidebarPageHelper extends PageHelper {
4 getNotificatinoIcon() {
5 return cy.get('cd-notifications a');
9 return cy.get('cd-notifications-sidebar');
13 return this.getSidebar().find('.card.tc_task');
17 return this.getSidebar().find('.card.tc_notification');
20 getClearNotficationsBtn() {
21 return this.getSidebar().find('button.btn-block');
25 return this.getSidebar().find('button.close');
29 this.getNotificatinoIcon().click();
30 this.getSidebar().should('be.visible');
33 clearNotifications() {
34 // It can happen that although notifications are cleared, by the time we check the notifications
35 // amount, another notification can appear, so we check it more than once (if needed).
36 this.getClearNotficationsBtn().click();
37 this.getNotifications()
38 .should('have.length.gte', 0)
40 if ($elems.length > 0) {
41 this.clearNotifications();