Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions e2e_tests/pages/dashboards/dashboards.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ export default class Dashboards extends BasePage {

let noDataPanels: string[] = [];
let missingMetrics: string[] = [];
let extraMetrics: string[] = [];

for (let i = 0; i <= timeout; i += Timeouts.THIRTY_SECONDS) {
noDataPanels = await this.elements.noDataPanelName.allTextContents();
missingMetrics = Array.from(noDataPanels).filter((e) => !noDataMetrics.includes(e));
extraMetrics = noDataMetrics.filter((e) => !noDataPanels.includes(e));

if (missingMetrics.length == 0) break;

Expand All @@ -95,18 +93,8 @@ export default class Dashboards extends BasePage {
});
}
}
if (extraMetrics.length > 0) {
for (const extraMetric of extraMetrics) {
await this.builders.panelByName(extraMetric).screenshot({
path: `./screenshots/extra-metric-${extraMetric.toLowerCase().replace(/[^a-z0-9-_]+/gi, '_')}.png`,
});
}
}

expect.soft(missingMetrics, `Metrics without data are: ${missingMetrics}`).toHaveLength(0);
expect
.soft(extraMetrics, `Metrics with data that are expected to be empty are: ${extraMetrics}`)
.toHaveLength(0);
};

verifyMetricsPresent = async (expectedMetrics: GrafanaPanel[], serviceList?: GetService[]) => {
Expand Down