Skip to content

Commit

Permalink
wait for monitor search to finish in the beginning (opensearch-projec…
Browse files Browse the repository at this point in the history
…t#1177) (opensearch-project#1179)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 7fbfbd7)

Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
opensearch-trigger-bot[bot] and amsiglan authored Mar 27, 2024
1 parent 8ec090c commit feee50a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,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: TWENTY_SECONDS });
cy.contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS });
Expand Down

0 comments on commit feee50a

Please sign in to comment.