Skip to content

Commit d9d939b

Browse files
committed
Added incoming data logs verify full data page case
1 parent 8031071 commit d9d939b

File tree

4 files changed

+162
-34
lines changed

4 files changed

+162
-34
lines changed

plugins/logger/frontend/public/templates/logger.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<cly-section>
2121
<cly-datatable-n
2222
ref="requestLogTable"
23+
test-id="datatable-logs"
2324
:rows="logsData"
2425
:resizable="false"
2526
:force-loading="isLoading"
@@ -75,4 +76,4 @@
7576
</cly-datatable-n>
7677
</cly-section>
7778
</cly-main>
78-
</div>
79+
</div>

ui-tests/cypress/e2e/onboarding/onboarding.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ describe('Complete Onboarding', () => {
387387
dataPopulatorPageHelpers.verifyPageElementsOfDataPopulatorWithEnvironmentPage();
388388
dataPopulatorPageHelpers.clickTemplatesTab();
389389
dataPopulatorPageHelpers.verifyPageElementsOfTemplatesPage();
390+
navigationHelpers.goToIncomingDataLogsPage();
391+
//incomingDataLogsPageHelpers.verifyFullDataPageElements(); //TODO: Data is not being generated with the populator. Need to generate the data
390392
//TODO: Add the cases of the following pages
391-
//navigationHelpers.goToIncomingDataLogsPage();
392-
//incomingDataLogsPageHelpers.verifyFullDataPageElements();
393393
//navigationHelpers.goToSdkManagerPage();
394394
//sdkManagersPageHelpers.verifyFullDataPageElements();
395395
//sdkManagersPageHelpers.clickRequestStatsTab();
Lines changed: 114 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,151 @@
1-
import incomingDataLogsPageElements from "../../../../support/elements/dashboard/manage/logger/logger";
1+
import {
2+
loggerPageElements,
3+
logsDataTableElements
4+
} from "../../../../support/elements/dashboard/manage/logger/logger";
25

3-
const verifyStaticElementsOfPage = () => {
6+
const verifyStaticElementsOfPage = (isEnabled) => {
47
cy.verifyElement({
5-
labelElement: incomingDataLogsPageElements.PAGE_TITLE,
8+
labelElement: loggerPageElements.PAGE_TITLE,
69
labelText: "Incoming Data Logs",
7-
tooltipElement: incomingDataLogsPageElements.PAGE_TITLE_TOOLTIP,
10+
tooltipElement: loggerPageElements.PAGE_TITLE_TOOLTIP,
811
tooltipText: "Log requests made to the write API to review and debug incoming data"
912
});
1013

1114
cy.verifyElement({
12-
labelElement: incomingDataLogsPageElements.PAGE_SUB_TITLE,
15+
labelElement: loggerPageElements.PAGE_SUB_TITLE,
1316
labelText: "Only up to last 1000 incoming data logs are stored"
1417
});
1518

19+
if (isEnabled) {
20+
cy.verifyElement({
21+
labelElement: loggerPageElements.AUTO_REFRESH_IS_LABEL,
22+
labelText: "Auto-refresh is",
23+
element: loggerPageElements.ENABLED_LABEL,
24+
elementText: "Enabled",
25+
tooltipElement: loggerPageElements.AUTO_REFRESH_IS_ENABLED_TOOLTIP,
26+
tooltipText: "Automatically refresh can be adjusted through this switch",
27+
});
28+
29+
cy.verifyElement({
30+
element: loggerPageElements.STOP_AUTO_REFRESH_BUTTON,
31+
elementText: "Stop Auto-refresh",
32+
});
33+
} else {
34+
cy.verifyElement({
35+
element: loggerPageElements.ENABLE_AUTO_REFRESH_TOGGLE,
36+
labelElement: loggerPageElements.ENABLE_AUTO_REFRESH_LABEL,
37+
labelText: "Enable Auto-refresh",
38+
tooltipElement: loggerPageElements.ENABLE_AUTO_REFRESH_TOOLTIP,
39+
tooltipText: "Automatically refresh can be adjusted through this switch"
40+
});
41+
}
42+
1643
cy.verifyElement({
17-
element: incomingDataLogsPageElements.SELECT_FILTER_COMBOBOX,
44+
element: logsDataTableElements().SELECT_FILTER_COMBOBOX,
1845
});
1946

2047
cy.verifyElement({
21-
element: incomingDataLogsPageElements.EXPORT_AS_BUTTON,
48+
element: logsDataTableElements().EXPORT_AS_BUTTON,
2249
});
2350

2451
cy.verifyElement({
25-
element: incomingDataLogsPageElements.DATATABLE_SEARCH_INPUT,
52+
element: logsDataTableElements().DATATABLE_SEARCH_INPUT,
2653
});
27-
};
2854

29-
const verifyEmptyPageElements = () => {
55+
cy.verifyElement({
56+
labelElement: logsDataTableElements().COLUMN_NAME_REQUEST_RECEIVED_LABEL,
57+
labelText: "Request Received",
58+
});
3059

31-
verifyStaticElementsOfPage();
60+
cy.verifyElement({
61+
element: logsDataTableElements().COLUMN_NAME_REQUEST_RECEIVED_SORTABLE_ICON,
62+
});
3263

3364
cy.verifyElement({
34-
element: incomingDataLogsPageElements.ENABLE_AUTO_REFRESH_TOGGLE,
35-
labelElement: incomingDataLogsPageElements.ENABLE_AUTO_REFRESH_LABEL,
36-
labelText: "Enable Auto-refresh",
37-
tooltipElement: incomingDataLogsPageElements.ENABLE_AUTO_REFRESH_TOOLTIP,
38-
tooltipText: "Automatically refresh can be adjusted through this switch"
65+
labelElement: logsDataTableElements().COLUMN_NAME_DETAILS_LABEL,
66+
labelText: "Details",
3967
});
4068

4169
cy.verifyElement({
42-
element: incomingDataLogsPageElements.EMPTY_TABLE_ICON,
70+
element: logsDataTableElements().COLUMN_NAME_DETAILS_SORTABLE_ICON,
4371
});
4472

4573
cy.verifyElement({
46-
labelElement: incomingDataLogsPageElements.EMPTY_TABLE_TITLE,
47-
labelText: "...hmm, seems empty here",
74+
labelElement: logsDataTableElements().COLUMN_NAME_INFORMATION_LABEL,
75+
labelText: "Information",
4876
});
4977

5078
cy.verifyElement({
51-
labelElement: incomingDataLogsPageElements.EMPTY_TABLE_SUBTITLE,
52-
labelText: "No data found",
79+
element: logsDataTableElements().COLUMN_NAME_INFORMATION_SORTABLE_ICON,
80+
});
81+
}
82+
83+
const verifyEmptyPageElements = () => {
84+
85+
verifyStaticElementsOfPage(false);
86+
87+
verifyLogsDataTable({
88+
isEmpty: true
5389
});
5490
};
5591

92+
const verifyFullDataPageElements = () => {
93+
94+
verifyStaticElementsOfPage(false);
95+
96+
verifyLogsDataTable({
97+
isEmpty: false,
98+
shouldNotEqual: true,
99+
});
100+
};
101+
102+
const verifyLogsDataTable = ({
103+
index = 0,
104+
isEmpty = false,
105+
shouldNotEqual = false,
106+
requestReceived = null,
107+
details = null,
108+
information = null
109+
}) => {
110+
111+
if (isEmpty) {
112+
cy.verifyElement({
113+
element: logsDataTableElements().EMPTY_TABLE_ICON,
114+
});
115+
116+
cy.verifyElement({
117+
labelElement: logsDataTableElements().EMPTY_TABLE_TITLE,
118+
labelText: "...hmm, seems empty here",
119+
});
120+
121+
cy.verifyElement({
122+
labelElement: logsDataTableElements().EMPTY_TABLE_SUBTITLE,
123+
labelText: "No data found",
124+
});
125+
return;
126+
}
127+
128+
cy.verifyElement({
129+
shouldNot: shouldNotEqual,
130+
element: logsDataTableElements(index).REQUEST_RECEIVED,
131+
elementText: requestReceived,
132+
});
133+
134+
cy.verifyElement({
135+
shouldNot: shouldNotEqual,
136+
element: logsDataTableElements(index).DETAILS,
137+
elementText: details,
138+
});
139+
140+
cy.verifyElement({
141+
shouldNot: shouldNotEqual,
142+
element: logsDataTableElements(index).INFORMATION,
143+
elementText: information,
144+
});
145+
}
146+
56147
module.exports = {
57148
verifyEmptyPageElements,
149+
verifyFullDataPageElements,
150+
verifyLogsDataTable,
58151
};
Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
1-
export default {
1+
export const loggerPageElements = {
22
PAGE_TITLE: 'header-title',
33
PAGE_TITLE_TOOLTIP: 'header-title-tooltip',
44
PAGE_SUB_TITLE: 'manage-logger-subtitle',
55

66
AUTO_REFRESH_IS_LABEL: 'enable-auto-refresh-auto-refresh-toggle-is-label',
7-
ENABLED_LABEL: 'enable-auto-refresh-auto-refresh-toggle-enabled-label',
8-
AUTO_REFRESH_IS_ENABLED_TOOLTIP: 'enable-auto-refresh-auto-refresh-toggle-tooltip',
9-
STOP_AUTO_REFRESH_BUTTON: 'enable-auto-refresh-auto-refresh-toggle-button',
10-
ENABLE_AUTO_REFRESH_LABEL: 'enable-auto-refresh-auto-refresh-toggle-disabled-label',
7+
ENABLED_LABEL: 'enable-auto-refresh-auto-refresh-toggle-enabled-label',
8+
AUTO_REFRESH_IS_ENABLED_TOOLTIP: 'enable-auto-refresh-auto-refresh-toggle-tooltip',
9+
STOP_AUTO_REFRESH_BUTTON: 'enable-auto-refresh-auto-refresh-toggle-button',
10+
ENABLE_AUTO_REFRESH_LABEL:'enable-auto-refresh-auto-refresh-toggle-disabled-label',
1111
ENABLE_AUTO_REFRESH_TOOLTIP: 'enable-auto-refresh-auto-refresh-toggle-disabled-tooltip',
1212
ENABLE_AUTO_REFRESH_TOGGLE: 'enable-auto-refresh-auto-refresh-toggle-el-switch-core',
13+
};
1314

15+
const logsDataTableElements = (index = 0) => ({
1416
SELECT_FILTER_COMBOBOX: 'select-test-id-select-input',
15-
EXPORT_AS_BUTTON: 'cly-datatable-n-test-id-export-as-button',
16-
DATATABLE_SEARCH_INPUT: 'cly-datatable-n-test-id-datatable-search-input',
17-
EMPTY_TABLE_ICON: 'cly-datatable-n-test-id-empty-logo',
18-
EMPTY_TABLE_TITLE: 'cly-datatable-n-test-id-empty-title',
19-
EMPTY_TABLE_SUBTITLE: 'cly-datatable-n-test-id-empty-subtitle'
17+
EXPORT_AS_BUTTON: 'datatable-logs-export-as-button',
18+
DATATABLE_SEARCH_INPUT: 'datatable-logs-datatable-search-input',
19+
TABLE_ROWS: '.el-table__row',
20+
21+
EMPTY_TABLE_ICON: 'datatable-logs-empty-logo',
22+
EMPTY_TABLE_TITLE: 'datatable-logs-empty-title',
23+
EMPTY_TABLE_SUBTITLE: 'datatable-logs-empty-subtitle',
24+
25+
COLUMN_NAME_REQUEST_RECEIVED_LABEL: 'datatable-logs-label-request-received',
26+
COLUMN_NAME_REQUEST_RECEIVED_SORTABLE_ICON: 'datatable-logs-sortable-icon-request-received',
27+
COLUMN_NAME_DETAILS_LABEL: 'datatable-logs-label-details',
28+
COLUMN_NAME_DETAILS_SORTABLE_ICON: 'datatable-logs-sortable-icon-details',
29+
COLUMN_NAME_INFORMATION_LABEL: 'datatable-logs-label-information',
30+
COLUMN_NAME_INFORMATION_SORTABLE_ICON: 'datatable-logs-sortable-icon-information',
31+
32+
//Columns' Rows' Datas Elements
33+
//TODO: Data test id is missing, will be added later
34+
REQUEST_RECEIVED: 'datatable-logs-request-received-' + index,
35+
DETAILS: 'datatable-logs-details-' + index,
36+
INFORMATION: 'datatable-logs-information-' + index,
37+
38+
//PAGINATION ELEMENTS
39+
ITEMS_PER_PAGE_LABEL: 'report-manager-manually-created-items-per-page-label',
40+
PER_PAGE_COUNT_SELECT: 'report-manager-manually-created-items-per-page-count-select-input-pseudo-input-label',
41+
PER_PAGE_COUNT_SELECT_ICON: 'report-manager-manually-created-items-per-page-count-select-icon',
42+
PER_PAGE_COUNT_LABEL: 'report-manager-manually-created-items-per-page-count-select',
43+
PAGE_NUMBER_SELECT: 'report-manager-manually-created-page-number-select-input-pseudo-input-label',
44+
PAGE_NUMBER_SELECT_ICON: 'report-manager-manually-created-page-number-select-icon',
45+
FIRST_PAGE_ARROW_BUTTON: 'report-manager-manually-created-first-page-arrow-button',
46+
PREVIOUS_PAGE_ARROW_BUTTON: 'report-manager-manually-created-groups-previous-page-arrow-button',
47+
NEXT_PAGE_ARROW_BUTTON: 'report-manager-manually-created-next-page-arrow-button',
48+
LAST_PAGE_ARROW_BUTTON: 'report-manager-manually-created-views-last-page-arrow-button'
49+
});
50+
51+
module.exports = {
52+
loggerPageElements,
53+
logsDataTableElements
2054
};

0 commit comments

Comments
 (0)