Skip to content

Commit

Permalink
wait for monitor search to finish in the beginning
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
amsiglan committed Mar 26, 2024
1 parent 081de1b commit 9d41ad9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ describe('AcknowledgeAlertsModal', () => {
});

beforeEach(() => {
const getMonitorsUrl = new RegExp('.*api/alerting/monitors/_search.*');
cy.intercept(getMonitorsUrl).as('searchMonitors');

// Reloading the page to close any modals that were not closed by other tests that had failures.
cy.visit(`${BASE_PATH}/app/${ALERTING_PLUGIN_NAME}#/dashboard`);

// Wait for the monitor search call to finish before checking for the monitors below
cy.wait('@searchMonitors');

// Confirm dashboard is displaying rows for the test monitors.
cy.contains(BUCKET_MONITOR, { timeout: ALERTING_PLUGIN_TIMEOUT });
cy.contains(QUERY_MONITOR, { timeout: ALERTING_PLUGIN_TIMEOUT });
Expand Down

0 comments on commit 9d41ad9

Please sign in to comment.