Skip to content

Commit

Permalink
fix: update timeout for monitor creation to 60secs to handle failing …
Browse files Browse the repository at this point in the history
…cypress test

Signed-off-by: vikhy-aws <[email protected]>
  • Loading branch information
vikhy-aws committed Jan 7, 2025
1 parent ee9897c commit 90e8c60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cypress/integration/acknowledge_alerts_modal_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ describe('AcknowledgeAlertsModal', () => {
cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/dashboard`);

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

it('Acknowledge button disabled when more than 1 trigger selected', () => {
Expand Down
8 changes: 7 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

const { method } = require('lodash');
const { API, ADMIN_AUTH } = require('./constants');

// ***********************************************
Expand Down Expand Up @@ -71,7 +72,12 @@ Cypress.Commands.overwrite('request', (originalFn, ...args) => {
});

Cypress.Commands.add('createMonitor', (monitorJSON) => {
cy.request('POST', `${Cypress.env('opensearch')}${API.MONITOR_BASE}`, monitorJSON);
cy.request({
method: 'POST',
url: `${Cypress.env('opensearch')}${API.MONITOR_BASE}`,
body: monitorJSON,
timeout: 60000
});
});

Cypress.Commands.add('createAndExecuteMonitor', (monitorJSON) => {
Expand Down

0 comments on commit 90e8c60

Please sign in to comment.