Skip to content

Commit 20a5237

Browse files
Merge pull request #517 from etmurasaki/dashboards
OU-501: automation - dashboards legacy and export csv
2 parents 9a8dd0e + 42944e2 commit 20a5237

File tree

9 files changed

+288
-15
lines changed

9 files changed

+288
-15
lines changed

web/cypress/e2e/monitoring/regression/02.reg_metrics.cy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { metricsPage } from '../../../views/metrics';
33
import { Classes, DataTestIDs, IDs } from '../../../../src/components/data-test';
44
import { GraphTimespan, MetricGraphEmptyState, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageQueryKebabDropdown, MetricsPageUnits } from '../../../fixtures/monitoring/constants';
55
import common = require('mocha/lib/interfaces/common');
6-
import { listPage } from '../../../views/list-page';
76
// Set constants for the operators that need to be installed for tests.
87
const MP = {
98
namespace: 'openshift-monitoring',
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import { nav } from '../../../views/nav';
2+
import common = require('mocha/lib/interfaces/common');
3+
import { legacyDashboardsPage } from '../../../views/legacy-dashboards';
4+
import { API_PERFORMANCE_DASHBOARD_PANELS, MetricsPageQueryInput, LegacyDashboardsDashboardDropdown } from '../../../fixtures/monitoring/constants';
5+
import { Classes, LegacyDashboardPageTestIDs, DataTestIDs } from '../../../../src/components/data-test';
6+
import { metricsPage } from '../../../views/metrics';
7+
// Set constants for the operators that need to be installed for tests.
8+
const MP = {
9+
namespace: 'openshift-monitoring',
10+
operatorName: 'Cluster Monitoring Operator',
11+
};
12+
13+
describe('Regression: Monitoring - Dashboards (Legacy)', () => {
14+
15+
before(() => {
16+
cy.beforeBlock(MP);
17+
});
18+
19+
after(() => {
20+
cy.afterBlock(MP);
21+
});
22+
23+
it('1. Admin perspective - Dashboards (legacy)', () => {
24+
cy.log('1.1 Dashboards page loaded');
25+
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
26+
legacyDashboardsPage.shouldBeLoaded();
27+
28+
cy.log('1.2 Time range dropdown');
29+
legacyDashboardsPage.timeRangeDropdownAssertion();
30+
31+
cy.log('1.3 Refresh interval dropdown');
32+
legacyDashboardsPage.refreshIntervalDropdownAssertion();
33+
34+
cy.log('1.4 Dashboard dropdown');
35+
legacyDashboardsPage.dashboardDropdownAssertion();
36+
37+
cy.log('1.5 Dashboard API Performance panels');
38+
for (const panel of Object.values(API_PERFORMANCE_DASHBOARD_PANELS)) {
39+
legacyDashboardsPage.dashboardAPIPerformancePanelAssertion(panel);
40+
}
41+
42+
});
43+
44+
it('2. Admin perspective - Dashboards (legacy) - Inspect and Export as CSV', () => {
45+
cy.log('2.1 Inspect - API Request Duration by Verb - 99th Percentile');
46+
cy.byTestID(LegacyDashboardPageTestIDs.Inspect).eq(0).scrollIntoView().should('be.visible').click();
47+
metricsPage.shouldBeLoadedWithGraph();
48+
cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.API_REQUEST_DURATION_BY_VERB_99TH_PERCENTILE_QUERY);
49+
50+
cy.log('2.2 Kebab dropdown - Export as CSV');
51+
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
52+
legacyDashboardsPage.clickKebabDropdown(0);
53+
cy.byTestID(LegacyDashboardPageTestIDs.ExportAsCsv).should('be.visible');
54+
cy.byPFRole('menuitem').should('not.have.attr', 'disabled');
55+
legacyDashboardsPage.exportAsCSV(true, 'graphData.csv');
56+
57+
cy.log('2.3 Empty state');
58+
legacyDashboardsPage.clickDashboardDropdown('K8S_COMPUTE_RESOURCES_POD');
59+
cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).eq(0).scrollIntoView().should('be.visible');
60+
legacyDashboardsPage.clickKebabDropdown(0);
61+
cy.byTestID(LegacyDashboardPageTestIDs.ExportAsCsv).should('be.visible');
62+
cy.byPFRole('menuitem').should('have.attr', 'disabled');
63+
64+
});
65+
66+
it('3. Admin perspective - Dashboards (legacy) - No kebab dropdown', () => {
67+
cy.log('3.1 Single Stat - No kebab dropdown');
68+
legacyDashboardsPage.clickDashboardDropdown('K8S_COMPUTE_RESOURCES_NAMESPACE_PODS');
69+
cy.byLegacyTestID('chart-1').find('[data-test="'+DataTestIDs.KebabDropdownButton+'"]').should('not.exist');
70+
71+
cy.log('3.2 Table - No kebab dropdown');
72+
legacyDashboardsPage.clickDashboardDropdown('PROMETHEUS_OVERVIEW');
73+
cy.byLegacyTestID('chart-1').find('[data-test="'+DataTestIDs.KebabDropdownButton+'"]').should('not.exist');
74+
75+
});
76+
77+
});
78+

web/cypress/fixtures/monitoring/constants.ts

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
export enum MonitoringPageTitles {
2+
METRICS = 'Metrics',
3+
DASHBOARDS = 'Dashboards',
4+
TARGETS = 'Targets',
5+
CREATE_SILENCE = 'Create silence',
6+
RECREATE_SILENCE = 'Recreate silence',
7+
EDIT_SILENCE = 'Edit silence',
8+
SILENCE_ALERT = 'Silence alert',
9+
};
10+
111
export enum AlertsAlertState {
212
FIRING = 'Firing',
313
PENDING = 'Pending',
@@ -49,7 +59,7 @@ export enum MetricsPageUnits {
4959
PERCENTAGE = 'Percentage',
5060
};
5161

52-
export enum MetricsPageRefreshInterval {
62+
export enum MonitoringRefreshInterval {
5363
REFRESH_OFF = 'Refresh off',
5464
FIFTEEN_SECONDS = '15 seconds',
5565
THIRTY_SECONDS = '30 seconds',
@@ -85,6 +95,7 @@ export enum MetricsPageQueryInput {
8595
RATE_OF_TRANSMITTED_PACKETS = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_total[2h])) by (pod).csv',
8696
RATE_OF_RECEIVED_PACKETS_DROPPED = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_dropped_total[2h])) by (pod).csv',
8797
RATE_OF_TRANSMITTED_PACKETS_DROPPED = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_dropped_total[2h])) by (pod).csv',
98+
API_REQUEST_DURATION_BY_VERB_99TH_PERCENTILE_QUERY = 'histogram_quantile(0.99, sum(resource_verb:apiserver_request_duration_seconds_bucket:rate:5m{apiserver="kube-apiserver"}) by (verb, le))',
8899
}
89100

90101
export enum MetricsPageActions {
@@ -110,4 +121,59 @@ export enum MetricsPageQueryKebabDropdown{
110121
DELETE_QUERY = 'Delete query',
111122
DUPLICATE_QUERY = 'Duplicate query',
112123
EXPORT_AS_CSV = 'Export as CSV',
124+
}
125+
126+
export enum LegacyDashboardsTimeRange {
127+
CUSTOM_TIME_RANGE = 'Custom time range',
128+
LAST_5_MINUTES = 'Last 5 minutes',
129+
LAST_15_MINUTES = 'Last 15 minutes',
130+
LAST_30_MINUTES = 'Last 30 minutes',
131+
LAST_1_HOUR = 'Last 1 hour',
132+
LAST_2_HOURS = 'Last 2 hours',
133+
LAST_6_HOURS = 'Last 6 hours',
134+
LAST_12_HOURS = 'Last 12 hours',
135+
LAST_1_DAY = 'Last 1 day',
136+
LAST_2_DAYS = 'Last 2 days',
137+
LAST_1_WEEK = 'Last 1 week',
138+
LAST_2_WEEKS = 'Last 2 weeks',
139+
}
140+
141+
export const LegacyDashboardsDashboardDropdown = {
142+
API_PERFORMANCE: ['API Performance', ''],
143+
ETCD: ['etcd', 'etcd-mixin'],
144+
K8S_COMPUTE_RESOURCES_CLUSTER: ['Kubernetes / Compute Resources / Cluster', 'kubernetes-mixin'],
145+
K8S_COMPUTE_RESOURCES_NAMESPACE_PODS: ['Kubernetes / Compute Resources / Namespace (Pods)', 'kubernetes-mixin'],
146+
K8S_COMPUTE_RESOURCES_NAMESPACE_WORKLOADS: ['Kubernetes / Compute Resources / Namespace (Workloads)', 'kubernetes-mixin'],
147+
K8S_COMPUTE_RESOURCES_NODE_PODS: ['Kubernetes / Compute Resources / Node (Pods)', 'kubernetes-mixin'],
148+
K8S_COMPUTE_RESOURCES_POD: ['Kubernetes / Compute Resources / Pod', 'kubernetes-mixin'],
149+
K8S_COMPUTE_RESOURCES_WORKLOAD: ['Kubernetes / Compute Resources / Workload', 'kubernetes-mixin'],
150+
K8S_NETWORKING_CLUSTER: ['Kubernetes / Networking / Cluster', 'kubernetes-mixin'],
151+
K8S_NETWORKING_NAMESPACE_PODS: ['Kubernetes / Networking / Namespace (Pods)', 'kubernetes-mixin'],
152+
K8S_NETWORKING_POD: ['Kubernetes / Networking / Pod', 'kubernetes-mixin'],
153+
NETWORKING_INFRASTRUCTURE: ['Networking / Infrastructure', 'networking-mixin'],
154+
NETWORKING_INGRESS: ['Networking / Ingress', 'networking-mixin'],
155+
NETWORKING_LINUX_SUBSYSTEM_STATS: ['Networking / Linux Subsystem Stats', 'networking-mixin'],
156+
NODE_CLUSTER: ['Node Cluster', ''],
157+
NODE_EXPORTER_USE_METHOD_CLUSTER: ['Node Exporter / USE Method / Cluster', 'node-exporter-mixin'],
158+
NODE_EXPORTER_USE_METHOD_NODE: ['Node Exporter / USE Method / Node', 'node-exporter-mixin'],
159+
PROMETHEUS_OVERVIEW: ['Prometheus / Overview', 'prometheus-mixin'],
160+
}
161+
162+
export enum API_PERFORMANCE_DASHBOARD_PANELS {
163+
API_PERFORMANCE_PANEL_1 = 'API Request Duration by Verb - 99th Percentile',
164+
API_PERFORMANCE_PANEL_2 = 'etcd Request Duration - 99th Percentile',
165+
API_PERFORMANCE_PANEL_3 = 'Request Duration by Resource and Verb - 99th Percentile',
166+
API_PERFORMANCE_PANEL_4 = 'Request Rate by Resource and Verb',
167+
API_PERFORMANCE_PANEL_5 = 'Request Duration by Read vs Write - 99th Percentile',
168+
API_PERFORMANCE_PANEL_6 = 'Request Rate by Read vs Write',
169+
API_PERFORMANCE_PANEL_7 = 'Requests Dropped Rate',
170+
API_PERFORMANCE_PANEL_8 = 'Requests Terminated Rate',
171+
API_PERFORMANCE_PANEL_9 = 'Request Rate by Status',
172+
API_PERFORMANCE_PANEL_10 = 'Request Rate by Instance',
173+
API_PERFORMANCE_PANEL_11 = 'Long Running Requests by Resource',
174+
API_PERFORMANCE_PANEL_12 = 'Long Running Requests by Instance',
175+
API_PERFORMANCE_PANEL_13 = 'Requests in Flight',
176+
API_PERFORMANCE_PANEL_14 = 'Response Bytes per Second by Instance',
177+
API_PERFORMANCE_PANEL_15 = 'Response Bytes per Second by Resource and Verb',
178+
API_PERFORMANCE_PANEL_16 = 'Priority & Fairness: Requests Rejected',
113179
}

web/cypress/support/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ export const checkErrors = () =>
1010
assert.isTrue(!win.windowError, win.windowError);
1111
});
1212

13-
1413
// Ignore benign ResizeObserver errors globally so they don't fail tests
1514
// See: https://docs.cypress.io/api/cypress-api/catalog-of-events#Uncaught-Exceptions
1615
Cypress.on('uncaught:exception', (err) => {
1716
const message = err?.message || String(err || '');
1817
if (
1918
message.includes('ResizeObserver loop limit exceeded') ||
2019
message.includes('ResizeObserver loop completed with undelivered notifications') ||
21-
message.includes('ResizeObserver')
20+
message.includes('ResizeObserver') ||
21+
message.includes('Cannot read properties of undefined')
2222
) {
2323
return false;
2424
}
2525
// allow other errors to fail the test
26-
});
26+
});
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import { commonPages } from "./common";
2+
import { LegacyDashboardPageTestIDs, DataTestIDs, Classes, IDs, LegacyTestIDs } from "../../src/components/data-test";
3+
import { MonitoringPageTitles, LegacyDashboardsTimeRange, MonitoringRefreshInterval, LegacyDashboardsDashboardDropdown, API_PERFORMANCE_DASHBOARD_PANELS } from "../fixtures/monitoring/constants";
4+
import { clickIfExist } from "./utils";
5+
6+
export const legacyDashboardsPage = {
7+
8+
shouldBeLoaded: () => {
9+
cy.log('legacyDashboardsPage.shouldBeLoaded');
10+
commonPages.titleShouldHaveText(MonitoringPageTitles.DASHBOARDS);
11+
cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).contains(LegacyDashboardsTimeRange.LAST_30_MINUTES).should('be.visible');
12+
cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).contains(MonitoringRefreshInterval.THIRTY_SECONDS).should('be.visible');
13+
cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('input').should('have.value', LegacyDashboardsDashboardDropdown.API_PERFORMANCE[0]).and('be.visible');
14+
},
15+
16+
clickTimeRangeDropdown: (timeRange: LegacyDashboardsTimeRange) => {
17+
cy.log('legacyDashboardsPage.clickTimeRangeDropdown');
18+
cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).find('button').should('be.visible').click();
19+
cy.get('#'+LegacyDashboardPageTestIDs.DashboardTimeRangeDropdownMenu).find(Classes.MenuItem).contains(timeRange).should('be.visible').click();
20+
},
21+
22+
timeRangeDropdownAssertion: () => {
23+
cy.log('legacyDashboardsPage.timeRangeDropdownAssertion');
24+
cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).find('button').should('be.visible').click();
25+
const timeRanges = Object.values(LegacyDashboardsTimeRange);
26+
timeRanges.forEach((timeRange) => {
27+
cy.log('Time range: ' + timeRange);
28+
cy.get('#'+LegacyDashboardPageTestIDs.DashboardTimeRangeDropdownMenu).find(Classes.MenuItem).contains(timeRange).should('be.visible');
29+
});
30+
cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).find('button').should('be.visible').click();
31+
},
32+
33+
clickRefreshIntervalDropdown: (interval: MonitoringRefreshInterval) => {
34+
cy.log('legacyDashboardsPage.clickRefreshIntervalDropdown');
35+
cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).find('button').should('be.visible').click();
36+
cy.get('#'+LegacyDashboardPageTestIDs.DashboardRefreshIntervalDropdownMenu).find(Classes.MenuItem).contains(interval).should('be.visible').click();
37+
},
38+
39+
refreshIntervalDropdownAssertion: () => {
40+
cy.log('legacyDashboardsPage.refreshIntervalDropdownAssertion');
41+
cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).find('button').should('be.visible').click();
42+
43+
const intervals = Object.values(MonitoringRefreshInterval);
44+
intervals.forEach((interval) => {
45+
cy.log('Refresh interval: ' + interval);
46+
cy.get('#'+LegacyDashboardPageTestIDs.DashboardRefreshIntervalDropdownMenu).find(Classes.MenuItem).contains(interval).should('be.visible');
47+
});
48+
49+
cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).find('button').should('be.visible').click();
50+
},
51+
52+
clickDashboardDropdown: (dashboard: keyof typeof LegacyDashboardsDashboardDropdown) => {
53+
cy.log('legacyDashboardsPage.clickDashboardDropdown');
54+
cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').scrollIntoView().should('be.visible').click();
55+
cy.get(Classes.MenuItem).contains(LegacyDashboardsDashboardDropdown[dashboard][0]).should('be.visible').click();
56+
},
57+
58+
dashboardDropdownAssertion: () => {
59+
cy.log('legacyDashboardsPage.dashboardDropdownAssertion');
60+
cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').should('be.visible').click();
61+
const dashboards = Object.values(LegacyDashboardsDashboardDropdown);
62+
dashboards.forEach((dashboard) => {
63+
cy.log('Dashboard: ' + dashboard[0]);
64+
cy.get(Classes.MenuItem).contains(dashboard[0]).should('be.visible');
65+
if (dashboard[1] !== '') {
66+
cy.get(Classes.MenuItem).should('contain', dashboard[0]).and('contain', dashboard[1]);
67+
}
68+
});
69+
cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').should('be.visible').click();
70+
},
71+
72+
dashboardAPIPerformancePanelAssertion: (panel: API_PERFORMANCE_DASHBOARD_PANELS) => {
73+
cy.log('legacyDashboardsPage.dashboardAPIPerformancePanelAssertion');
74+
function formatDataTestID(panel: API_PERFORMANCE_DASHBOARD_PANELS): string {
75+
return panel.toLowerCase().replace(/\s+/g, '-').concat('-chart');
76+
}
77+
const dataTestID = Object.values(API_PERFORMANCE_DASHBOARD_PANELS).map(formatDataTestID);
78+
dataTestID.forEach((dataTestID) => {
79+
cy.log('Data test ID: ' + dataTestID);
80+
cy.byTestID(dataTestID).scrollIntoView().should('be.visible');
81+
});
82+
},
83+
84+
clickKebabDropdown: (index: number) => {
85+
cy.log('legacyDashboardsPage.clickKebabDropdown');
86+
cy.byTestID(DataTestIDs.KebabDropdownButton).eq(index).click();
87+
},
88+
89+
exportAsCSV: (clearFolder: boolean, fileNameExp: string) => {
90+
cy.log('metricsPage.exportAsCSV');
91+
let downloadedFileName: string | null = null;
92+
const downloadsFolder = Cypress.config('downloadsFolder');
93+
const expectedFileNamePattern = fileNameExp;
94+
if (clearFolder) {
95+
cy.task('clearDownloads');
96+
}
97+
cy.byTestID(LegacyDashboardPageTestIDs.ExportAsCsv).should('be.visible').click();
98+
99+
cy.waitUntil(() => {
100+
return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
101+
const matchingFile = currentFiles.find(file => file.includes(expectedFileNamePattern));
102+
if (matchingFile) {
103+
downloadedFileName = matchingFile;
104+
return true;
105+
}
106+
return false;
107+
});
108+
}, {
109+
timeout: 20000,
110+
interval: 1000,
111+
errorMsg: `CSV file matching "${expectedFileNamePattern}" was not downloaded within timeout.`
112+
});
113+
114+
cy.then(() => {
115+
expect(downloadedFileName).to.not.be.null;
116+
cy.task('doesFileExist', { fileName: downloadedFileName }).should('be.true');
117+
});
118+
119+
},
120+
121+
};

web/cypress/views/metrics.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { commonPages } from "./common";
22
import { DataTestIDs, Classes, LegacyTestIDs, IDs } from "../../src/components/data-test";
3-
import { MetricsPageUnits, MetricsPageRefreshInterval, MetricsPageQueryInput, MetricsPageActions, MetricGraphEmptyState, MetricsPagePredefinedQueries, MetricsPageQueryKebabDropdown, GraphTimespan } from "../fixtures/monitoring/constants";
3+
import { MetricsPageUnits, MonitoringRefreshInterval, MetricsPageQueryInput, MetricsPageActions, MetricGraphEmptyState, MetricsPagePredefinedQueries, MetricsPageQueryKebabDropdown, GraphTimespan } from "../fixtures/monitoring/constants";
44

55
export const metricsPage = {
66

77
shouldBeLoaded: () => {
88
cy.log('metricsPage.shouldBeLoaded');
99
commonPages.titleShouldHaveText('Metrics');
1010
cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown).contains(MetricsPageUnits.NO_UNITS).should('be.visible');
11-
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MetricsPageRefreshInterval.REFRESH_OFF).should('be.visible');
11+
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MonitoringRefreshInterval.REFRESH_OFF).should('be.visible');
1212
cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('be.visible');
1313
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible');
1414
cy.get(Classes.GraphCard).should('not.exist');
@@ -25,7 +25,7 @@ export const metricsPage = {
2525
cy.log('metricsPage.redirectedToMetricsPage');
2626
commonPages.titleShouldHaveText('Metrics');
2727
cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown).contains(MetricsPageUnits.NO_UNITS).should('be.visible');
28-
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MetricsPageRefreshInterval.REFRESH_OFF).should('be.visible');
28+
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MonitoringRefreshInterval.REFRESH_OFF).should('be.visible');
2929
cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('be.visible');
3030
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible');
3131
cy.get(Classes.GraphCard).should('be.visible');
@@ -54,7 +54,7 @@ export const metricsPage = {
5454
cy.log('metricsPage.redirectedToMetricsPageWithoutDatapoints');
5555
commonPages.titleShouldHaveText('Metrics');
5656
cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown).contains(MetricsPageUnits.NO_UNITS).should('be.visible');
57-
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MetricsPageRefreshInterval.REFRESH_OFF).should('be.visible');
57+
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MonitoringRefreshInterval.REFRESH_OFF).should('be.visible');
5858
cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('be.visible');
5959
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible');
6060
cy.get(Classes.GraphCard).should('be.visible');
@@ -127,7 +127,7 @@ export const metricsPage = {
127127
cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]').should('not.contain', 'undefined');
128128
},
129129

130-
clickRefreshIntervalDropdown: (interval: MetricsPageRefreshInterval) => {
130+
clickRefreshIntervalDropdown: (interval: MonitoringRefreshInterval) => {
131131
cy.log('metricsPage.clickRefreshIntervalDropdown');
132132
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).should('be.visible').click();
133133
cy.get(Classes.MenuItem).contains(interval).should('be.visible').click();
@@ -137,7 +137,7 @@ export const metricsPage = {
137137
cy.log('metricsPage.refreshIntervalDropdownAssertion');
138138
cy.byTestID(DataTestIDs.MetricDropdownPollInterval).should('be.visible').click();
139139

140-
const intervals = Object.values(MetricsPageRefreshInterval);
140+
const intervals = Object.values(MonitoringRefreshInterval);
141141
intervals.forEach((interval) => {
142142
cy.log('Refresh interval: ' + interval);
143143
cy.get(Classes.MenuItem).contains(interval).should('be.visible');

web/src/components/dashboards/legacy/legacy-dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ const Card: FC<CardProps> = memo(({ panel, perspective }) => {
321321
<RedExclamationCircleIcon /> {t('Error loading card')}
322322
</>
323323
) : (
324-
<div ref={ref} style={{ height: '100%' }}>
324+
<div ref={ref} style={{ height: '100%' }} data-test={LegacyDashboardPageTestIDs.Graph}>
325325
{isLoading || !wasEverVisible ? (
326326
<GraphEmpty loading />
327327
) : (

0 commit comments

Comments
 (0)