Skip to content

Commit 8660228

Browse files
committed
Updated push notif page verify tests
1 parent ede8974 commit 8660228

File tree

3 files changed

+126
-38
lines changed

3 files changed

+126
-38
lines changed

Diff for: ui-tests/cypress/e2e/onboarding/onboarding.cy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const analyticsGeoCountriesPageHelpers = require('../../lib/dashboard/analytics/
2525
const analyticsGeoLanguagesPageHelpers = require('../../lib/dashboard/analytics/geo/languages/languages');
2626
const analyticsEventsOverviewPageHelpers = require('../../lib/dashboard/analytics/events/overview');
2727
const analyticsEventsPageHelpers = require('../../lib/dashboard/analytics/events/events');
28-
//const messagingPageHelpers = require('../../lib/dashboard/messaging/messaging');
28+
const messagingPageHelpers = require('../../lib/dashboard/messaging/messaging');
2929
const feedbackRatingsPageHelpers = require('../../lib/dashboard/feedback/ratings/ratings');
3030
const feedbackRatingWidgetsPageHelpers = require('../../lib/dashboard/feedback/ratings/widgets');
3131
const crashesPageHelpers = require('../../lib/dashboard/crashes/crashes');
@@ -202,7 +202,7 @@ describe('Complete Onboarding', () => {
202202
navigationHelpers.goToAnalyticsAllEvents();
203203
analyticsEventsPageHelpers.verifyEmptyPageElements();
204204
navigationHelpers.goToPushNotifications();
205-
//messagingPageHelpers.verifyEmptyPageElements(); //TODO: will be refactored
205+
messagingPageHelpers.verifyEmptyPageElements();
206206
navigationHelpers.goToFeedbackRatingsPage();
207207
feedbackRatingsPageHelpers.verifyEmptyPageElements();
208208
feedbackRatingsPageHelpers.clickRatingWidgetsTab();
@@ -370,7 +370,7 @@ describe('Complete Onboarding', () => {
370370
navigationHelpers.goToAnalyticsAllEvents();
371371
analyticsEventsPageHelpers.verifyFullDataPageElements();
372372
navigationHelpers.goToPushNotifications();
373-
//messagingPageHelpers.verifyFullDataPageElements(); //TODO: will be refactored
373+
messagingPageHelpers.verifyFullDataPageElements();
374374
navigationHelpers.goToFeedbackRatingsPage();
375375
feedbackRatingsPageHelpers.verifyFullDataPageElements();
376376
feedbackRatingsPageHelpers.clickRatingWidgetsTab();

Diff for: ui-tests/cypress/lib/dashboard/messaging/messaging.js

+77-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
messagingPageElements,
33
messagingMetricCardElements,
4+
messagingChartElements,
45
messagingDataTableElements
56
} from "../../../support/elements/dashboard/messaging/messaging";
67

@@ -19,6 +20,21 @@ const verifyStaticElementsOfPage = () => {
1920
elementText: 'New Message'
2021
});
2122

23+
cy.verifyElement({
24+
element: messagingPageElements.TAB_ONE_TIME_NOTIFICATIONS,
25+
elementText: "One-time Notifications",
26+
});
27+
28+
cy.verifyElement({
29+
element: messagingPageElements.TAB_AUTOMATED_NOTIFICATIONS,
30+
elementText: "Automated Notifications",
31+
});
32+
33+
cy.verifyElement({
34+
element: messagingPageElements.TAB_API_NOTIFICATIONS,
35+
elementText: "API Notifications",
36+
});
37+
2238
cy.verifyElement({
2339
labelElement: messagingMetricCardElements.TOTAL_APP_USERS_LABEL,
2440
labelText: "Total App Users"
@@ -40,13 +56,13 @@ const verifyStaticElementsOfPage = () => {
4056
element: messagingMetricCardElements.ENABLED_USERS_PERCENTAGE_PROGRESS_CIRCLE,
4157
});
4258

43-
cy.verifyElement({
44-
labelElement: messagingDataTableElements().RESULTS_FOR_LABEL,
45-
labelText: "Results for"
46-
});
59+
cy.clickElement(messagingPageElements.TAB_ONE_TIME_NOTIFICATIONS);
4760

4861
cy.verifyElement({
49-
element: messagingDataTableElements().RESULTS_FOR_COMBOBOX,
62+
labelElement: messagingChartElements.FILTER_PARAMETERS_SELECT_LABEL,
63+
labelText: "One-time notifications for",
64+
element: messagingChartElements.FILTER_PARAMETERS_SELECT,
65+
elementText: "All Platforms"
5066
});
5167

5268
cy.verifyElement({
@@ -68,7 +84,7 @@ const verifyStaticElementsOfPage = () => {
6884
cy.verifyElement({
6985
element: messagingDataTableElements().COLUMN_NAME_CAMPAIGN_NAME_LABEL,
7086
isElementVisible: false,
71-
elementText: "Campaign Name",
87+
elementText: "Notification name",
7288
});
7389

7490
cy.verifyElement({
@@ -111,6 +127,11 @@ const verifyStaticElementsOfPage = () => {
111127
cy.verifyElement({
112128
element: messagingDataTableElements().COLUMN_NAME_DATE_SENT_SCHEDULED_SORTABLE_ICON,
113129
});
130+
131+
cy.verifyElement({
132+
element: messagingDataTableElements().COLUMN_NAME_CREATED_LABEL,
133+
elementText: "Created",
134+
});
114135
};
115136

116137
const verifyEmptyPageElements = () => {
@@ -121,6 +142,10 @@ const verifyEmptyPageElements = () => {
121142
isEmpty: true,
122143
});
123144

145+
verifyGraphElements({
146+
isEmpty: true,
147+
});
148+
124149
verifyMessagingDataFromTable({
125150
isEmpty: true,
126151
});
@@ -134,11 +159,42 @@ const verifyFullDataPageElements = () => {
134159
isEmpty: false,
135160
});
136161

162+
// verifyGraphElements({ //TODO: Data is not being generated with the populator. Need to generate the data
163+
// isEmpty: false,
164+
// });
165+
137166
verifyMessagingDataFromTable({
138167
isEmpty: false,
139168
});
140169
};
141170

171+
const verifyGraphElements = ({
172+
isEmpty = false,
173+
}) => {
174+
175+
if (isEmpty) {
176+
cy.verifyElement({
177+
element: messagingChartElements.EMPTY_CHART_ICON,
178+
});
179+
180+
cy.verifyElement({
181+
labelElement: messagingChartElements.EMPTY_CHART_TITLE,
182+
labelText: "...hmm, seems empty here",
183+
});
184+
185+
cy.verifyElement({
186+
labelElement: messagingChartElements.EMPTY_CHART_SUBTITLE,
187+
labelText: "No data found",
188+
});
189+
190+
return;
191+
}
192+
193+
cy.verifyElement({
194+
element: messagingChartElements.ECHART,
195+
});
196+
};
197+
142198
const verifyMessagingMetricCard = ({
143199
isEmpty = false,
144200
totalAppUsersNumber = null,
@@ -195,6 +251,8 @@ const verifyMessagingDataFromTable = ({
195251
actionedPercentage = null,
196252
dateSent = null,
197253
dateScheduled = null,
254+
createdDate = null,
255+
createdTime = null,
198256
}) => {
199257

200258
if (isEmpty) {
@@ -276,11 +334,24 @@ const verifyMessagingDataFromTable = ({
276334
element: messagingDataTableElements(index).SCHEDULED,
277335
elementText: dateScheduled
278336
});
337+
338+
cy.verifyElement({
339+
shouldNot: !isEmpty,
340+
element: messagingDataTableElements(index).CREATED_DATE,
341+
elementText: createdDate
342+
});
343+
344+
cy.verifyElement({
345+
shouldNot: !isEmpty,
346+
element: messagingDataTableElements(index).CREATED_TIME,
347+
elementText: createdTime
348+
});
279349
};
280350

281351
module.exports = {
282352
verifyEmptyPageElements,
283353
verifyFullDataPageElements,
284354
verifyMessagingMetricCard,
355+
verifyGraphElements,
285356
verifyMessagingDataFromTable
286357
};
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,61 @@
11
export const messagingPageElements = {
22
PAGE_TITLE: 'header-title',
33
PAGE_TITLE_GUIDE_BUTTON: 'view-guide-button',
4-
CREATE_NEW_MESSAGE_BUTTON: 'create-new-messsage-button'
4+
CREATE_NEW_MESSAGE_BUTTON: 'create-new-messsage-button',
5+
6+
TAB_ONE_TIME_NOTIFICATIONS: 'tab-one-time-notifications-title',
7+
TAB_AUTOMATED_NOTIFICATIONS: 'tab-automated-notifications-title',
8+
TAB_API_NOTIFICATIONS: 'tab-api-notifications-title',
59
};
610

711
const messagingMetricCardElements = {
8-
TOTAL_APP_USERS_LABEL: 'metric-card-total-app-users-column-label',
9-
TOTAL_APP_USERS_NUMBER_LABEL: 'metric-card-total-app-users-column-number',
10-
NOTIFICATION_ENABLED_USERS_LABEL: 'metric-card-notification-enabled-users-column-label',
11-
NOTIFICATION_ENABLED_USERS_NUMBER_LABEL: 'metric-card-notification-enabled-users-column-number',
12-
ENABLED_USERS_PERCENTAGE_LABEL: 'metric-card-enabled-users-percentage-column-label',
13-
ENABLED_USERS_PERCENTAGE_NUMBER_LABEL: 'metric-card-enabled-users-percentage-column-number',
14-
ENABLED_USERS_PERCENTAGE_PROGRESS_CIRCLE: 'el-progress-metric-card-enabled-users-percentage-column',
15-
ENABLED_USERS_PERCENTAGE_PROGRESS_TOOLTIP: 'metric-card-enabled-users-percentage-column-tooltip',
12+
TOTAL_APP_USERS_LABEL: 'metric-card-messaging-total-app-users-column-label',
13+
TOTAL_APP_USERS_NUMBER_LABEL: 'metric-card-messaging-total-app-users-column-number',
14+
NOTIFICATION_ENABLED_USERS_LABEL: 'metric-card-messaging-notification-enabled-users-column-label',
15+
NOTIFICATION_ENABLED_USERS_NUMBER_LABEL: 'metric-card-messaging-notification-enabled-users-column-number',
16+
ENABLED_USERS_PERCENTAGE_LABEL: 'metric-card-messaging-enabled-users-percentage-column-label',
17+
ENABLED_USERS_PERCENTAGE_NUMBER_LABEL: 'metric-card-messaging-enabled-users-percentage-column-number',
18+
ENABLED_USERS_PERCENTAGE_PROGRESS_CIRCLE: 'el-progress-metric-card-messaging-enabled-users-percentage-column',
19+
ENABLED_USERS_PERCENTAGE_PROGRESS_TOOLTIP: 'metric-card-messaging-enabled-users-percentage-column-tooltip',
20+
};
21+
22+
const messagingChartElements = {
23+
FILTER_PARAMETERS_SELECT_LABEL: 'messaging-datatable-filter-label',
24+
FILTER_PARAMETERS_SELECT: 'select-test-id-select-input-pseudo-input-label',
25+
ECHART: '.echarts',
26+
27+
EMPTY_CHART_ICON: 'messaging-chart-empty-logo',
28+
EMPTY_CHART_TITLE: 'messaging-chart-empty-title',
29+
EMPTY_CHART_SUBTITLE: 'messaging-chart-empty-subtitle',
1630
};
1731

1832
const messagingDataTableElements = (index = 0) => ({
19-
EMPTY_TABLE_ICON: 'messaging-empty-logo',
20-
EMPTY_TABLE_TITLE: 'messaging-empty-title',
21-
EMPTY_TABLE_SUBTITLE: 'messaging-empty-subtitle',
33+
EMPTY_TABLE_ICON: 'messaging-datatable-empty-logo',
34+
EMPTY_TABLE_TITLE: 'messaging-datatable-empty-title',
35+
EMPTY_TABLE_SUBTITLE: 'messaging-datatable-empty-subtitle',
2236

23-
RESULTS_FOR_LABEL: 'push-notifications-result-for-label',
24-
RESULTS_FOR_COMBOBOX: 'push-notifications-result-for-combobox',
25-
FILTER_PARAMETERS_SELECT: 'cly-multi-select-test-id-pseudo-input-label',
26-
EDIT_COLUMNS_BUTTON: 'messaging-edit-columns-button',
37+
FILTER_PARAMETERS_SELECT: 'select-test-id-select-input',
38+
EDIT_COLUMNS_BUTTON: 'messaging-datatable-edit-columns-button',
2739

28-
EXPORT_AS_BUTTON: 'messaging-export-as-button',
29-
TABLE_SEARCH_INPUT: 'messaging-datatable-search-input',
40+
EXPORT_AS_BUTTON: 'messaging-datatable-export-as-button',
41+
TABLE_SEARCH_INPUT: 'messaging-datatable-datatable-search-input',
3042
TABLE_ROWS: '.el-table__row',
3143

32-
COLUMN_NAME_CAMPAIGN_NAME_LABEL: 'messaging-label-campaign-name',
33-
COLUMN_NAME_CAMPAIGN_NAME_SORTABLE_ICON: 'messaging-sortable-icon-campaign-name',
34-
COLUMN_NAME_STATUS_LABEL: 'messaging-label-status',
35-
COLUMN_NAME_STATUS_SORTABLE_ICON: 'messaging-sortable-icon-status',
36-
COLUMN_NAME_SENT_LABEL: 'messaging-label-sent',
37-
COLUMN_NAME_SENT_SORTABLE_ICON: 'messaging-sortable-icon-sent',
38-
COLUMN_NAME_ACTIONED_LABEL: 'messaging-label-actioned',
39-
COLUMN_NAME_ACTIONED_SORTABLE_ICON: 'messaging-sortable-icon-actioned',
40-
COLUMN_NAME_DATE_SENT_SCHEDULED_LABEL: 'messaging-label-date-sent/scheduled',
41-
COLUMN_NAME_DATE_SENT_SCHEDULED_SORTABLE_ICON: 'messaging-sortable-icon-date-sent/scheduled',
44+
COLUMN_NAME_CAMPAIGN_NAME_LABEL: 'messaging-datatable-label-notification-name',
45+
COLUMN_NAME_CAMPAIGN_NAME_SORTABLE_ICON: 'messaging-datatable-sortable-icon-notification-name',
46+
COLUMN_NAME_STATUS_LABEL: 'messaging-datatable-label-status',
47+
COLUMN_NAME_STATUS_SORTABLE_ICON: 'messaging-datatable-sortable-icon-status',
48+
COLUMN_NAME_SENT_LABEL: 'messaging-datatable-label-sent',
49+
COLUMN_NAME_SENT_SORTABLE_ICON: 'messaging-datatable-sortable-icon-sent',
50+
COLUMN_NAME_ACTIONED_LABEL: 'messaging-datatable-label-actioned',
51+
COLUMN_NAME_ACTIONED_SORTABLE_ICON: 'messaging-datatable-sortable-icon-actioned',
52+
COLUMN_NAME_DATE_SENT_SCHEDULED_LABEL: 'messaging-datatable-label-date-sent/scheduled',
53+
COLUMN_NAME_DATE_SENT_SCHEDULED_SORTABLE_ICON: 'messaging-datatable-sortable-icon-date-sent/scheduled',
54+
COLUMN_NAME_CREATED_LABEL: 'messaging-datatable-label-created',
55+
COLUMN_NAME_CREATED_SORTABLE_ICON: 'messaging-datatable-sortable-icon-created',
4256

4357
//Columns' Rows' Datas Elements
44-
CAMPAIGN_NAME: 'datatable-messaging-campaign-name-' + index,
58+
CAMPAIGN_NAME: 'datatable-messaging-notification-name-' + index,
4559
PLATFORM: 'datatable-messaging-platform-name-' + index,
4660
CAMPAIGN_NAME_BLINKER: 'datatable-messaging-blinker-' + index,
4761
CREATED_BY: 'datatable-messaging-created-by-' + index,
@@ -52,6 +66,8 @@ const messagingDataTableElements = (index = 0) => ({
5266
ACTIONED_PERCENTAGE: 'datatable-messaging-actioned-percentage-' + index,
5367
DATE_SENT: 'datatable-messaging-date-sent-' + index,
5468
SCHEDULED: 'datatable-messaging-scheduled-' + index,
69+
CREATED_DATE: 'datatable-messaging-created-date-' + index,
70+
CREATED_TIME: 'datatable-messaging-created-time-' + index,
5571

5672
//PAGINATION ELEMENTS
5773
ITEMS_PER_PAGE_LABEL: 'messaging-items-per-page-label',
@@ -69,5 +85,6 @@ const messagingDataTableElements = (index = 0) => ({
6985
module.exports = {
7086
messagingPageElements,
7187
messagingMetricCardElements,
88+
messagingChartElements,
7289
messagingDataTableElements
7390
};

0 commit comments

Comments
 (0)