Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions codeceptjs-e2e/tests/QAN/timerange_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ Scenario(
async ({
I, queryAnalyticsPage,
}) => {
// Re-anchor on a window that is already closed. The suite default is now-5m, whose
// last minutes are still being aggregated: Copy Link freezes it into absolute
// from/to, but re-querying that same absolute range seconds later returns more
// groups in a different load order, so the selected query moves to another page and
// never gets highlighted on the copied link. A window ending 5 minutes in the past
// returns byte-identical rows on every fetch, and starting it well before the suite
// keeps it at least as populated as now-5m was, so page 2 still exists.
Comment thread
travagliad marked this conversation as resolved.
Outdated
I.amOnPage(I.buildUrlWithParams(queryAnalyticsPage.url, { from: 'now-30m', to: 'now-5m' }));
queryAnalyticsPage.waitForLoaded();

Comment thread
travagliad marked this conversation as resolved.
Outdated
await I.waitForVisible(queryAnalyticsPage.data.buttons.nextPage);
await I.click(queryAnalyticsPage.data.buttons.nextPage);
await queryAnalyticsPage.data.selectRow(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ Data(backupTypes).Scenario('PMM-T2036 - Verify MongoDB PBM dashboard @pbm-nightl
await dashboardPage.expandEachDashboardRow();
await dashboardPage.verifyMetricsExistence(dashboardPage.mongodbBackupDetailsDashboard.metrics);
await dashboardPage.mongodbBackupDetailsDashboard.waitForLastSuccessfulBackupValue();
await dashboardPage.mongodbBackupDetailsDashboard.waitForLateMetricPanels();
Comment thread
travagliad marked this conversation as resolved.
Outdated
await dashboardPage.verifyThereAreNoGraphsWithoutData();
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ class MongodbBackupDetailsDashboard {
lastSuccessfulBackupValue: locate('//section[contains(@data-testid, "Last Successful Backup")]//div[@data-testid="data-testid panel content"]//span'),
refresh: locate('//button[contains(@data-testid, "RefreshPicker run button")]'),
};
// Panels fed by the same low-resolution mongodb_pbm_* collectors as the
// Last Successful Backup stat, so they are empty for the same 30-60s after a
// backup finishes -- and they sit at the bottom of the dashboard.
this.lateMetricPanels = [
'Backup history',
'Backup Sizes',
'Backup Duration',
];
Comment thread
travagliad marked this conversation as resolved.
Outdated
this.metrics = [
'Backup Configured',
'PITR Status',
Expand Down Expand Up @@ -65,6 +73,30 @@ class MongodbBackupDetailsDashboard {
return actualValue !== 'N/A' && actualValue !== '';
}, 120, 'Last Successful Backup panel still has no value');
}

// Same viewport rule as above, applied to the panels the previous wait scrolls away
// from. Grafana unmounts a panel that leaves the viewport and only re-runs its query
// when it comes back, so the bottom row keeps whatever it rendered on page load -- the
// "N/A" from before PBM published a status="done" sample -- through every refresh
// waitForLastSuccessfulBackupValue does at the top of the dashboard. Bring each one
// back into view and refresh it there, so an empty-panel check sees current state
// instead of a stale render.
async waitForLateMetricPanels() {
const I = actor();

for (const panel of this.lateMetricPanels) {
const panelSection = locate(`//section[contains(@data-testid, "${panel}")]`);
const noData = locate(`//section[contains(@data-testid, "${panel}")]//*[(text()="No data") or (text()="NO DATA") or (text()="N/A") or (text()="No Data") or (text()="-")]`);

I.waitForElement(panelSection, 30);
await I.asyncWaitFor(async () => {
I.scrollTo(panelSection);
I.click(this.elements.refresh);

return await I.grabNumberOfVisibleElements(noData) === 0;
}, 120, `${panel} panel still has no data`);
}
}
Comment thread
travagliad marked this conversation as resolved.
Outdated
}

module.exports = new MongodbBackupDetailsDashboard();
Expand Down
Loading