From 0794fefac5f348ec4bdf359ef81a54f91e72aed9 Mon Sep 17 00:00:00 2001 From: Hengfei Yang Date: Tue, 27 Oct 2026 11:08:27 +0000 Subject: [PATCH] test(alerts): accept the latest digest on the calibration dashboard check (#15896) --- .../pages/alertsPages/alertCalibrationPage.js | 11 +++++++---- .../playwright-tests/Alerts/alertCalibration.spec.js | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/ui-testing/pages/alertsPages/alertCalibrationPage.js b/tests/ui-testing/pages/alertsPages/alertCalibrationPage.js index c5db61e784..662dce3d88 100644 --- a/tests/ui-testing/pages/alertsPages/alertCalibrationPage.js +++ b/tests/ui-testing/pages/alertsPages/alertCalibrationPage.js @@ -11,6 +11,7 @@ export class AlertCalibrationPage { // Page containers (OPageLayout forwards data-test to its root) this.dashboardPage = '[data-test="alert-calibration-dashboard-page"]'; this.settingsPage = '[data-test="alert-calibration-settings"]'; + this.dashboardRuns = '[data-test="alert-calibration-dashboard"]'; // Settings form — the enabled toggle. OFormSwitch forwards data-test to the // OSwitch button as `-btn`; the button exposes role="switch". @@ -49,11 +50,13 @@ export class AlertCalibrationPage { await expect(switchBtn).toHaveAttribute('aria-checked', 'true'); } - async expectEmptyRunsStateInsteadOfEnablePrompt() { - // The empty "no runs yet" state proves the org's config resolved to enabled - // (a disabled org would render the enable prompt), and that no digest exists yet. + async expectRunsViewInsteadOfEnablePrompt() { + // An enabled org shows the empty state or, once the scheduler has run, the latest digest. await expect( - this.page.getByText(this.dashboardEmptyTitle, { exact: false }), + this.page + .getByText(this.dashboardEmptyTitle, { exact: false }) + .or(this.page.locator(this.dashboardRuns)) + .first(), ).toBeVisible({ timeout: 20000 }); await expect( this.page.getByText(this.notEnabledTitle, { exact: true }), diff --git a/tests/ui-testing/playwright-tests/Alerts/alertCalibration.spec.js b/tests/ui-testing/playwright-tests/Alerts/alertCalibration.spec.js index 1d579719f2..f56dbc1081 100644 --- a/tests/ui-testing/playwright-tests/Alerts/alertCalibration.spec.js +++ b/tests/ui-testing/playwright-tests/Alerts/alertCalibration.spec.js @@ -36,12 +36,12 @@ test.describe("Alert Calibration testcases", () => { ); test( - "should show the empty runs state instead of the enable prompt on the dashboard by default", + "should show the runs view instead of the enable prompt on the dashboard by default", { tag: ["@alert-calibration", "@all"] }, async () => { testLogger.info("Opening the alert calibration dashboard"); await pm.alertCalibrationPage.navigateToDashboard(); - await pm.alertCalibrationPage.expectEmptyRunsStateInsteadOfEnablePrompt(); + await pm.alertCalibrationPage.expectRunsViewInsteadOfEnablePrompt(); testLogger.info("Test completed"); }, );