From d52ad2f01a1c6101d5d6cae2eb46ee52a44ad3f1 Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Fri, 6 Oct 2023 12:24:19 -0700 Subject: [PATCH] [Alerting] Update alerting tests in main (#880) * forcing name typing (#865) Signed-off-by: Amardeepsingh Siglani * [Alerting] use input element for typing (#872) When selecting delegate monitors for composite monitor creation, we are typing in the combo box div element which is throwing invalid typing element error. This PR fixes that by selecting the child input element instead. This change is already part of #866 for 2.x Issues Resolved: opensearch-project/alerting-dashboards-plugin#728 Signed-off-by: Amardeepsingh Siglani * wait before checking update status Signed-off-by: Amardeepsingh Siglani --------- Signed-off-by: Amardeepsingh Siglani --- .../composite_level_monitor_spec.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js b/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js index fe1f47d87..f4f911758 100644 --- a/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js +++ b/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js @@ -71,16 +71,20 @@ describe('CompositeLevelMonitor', () => { cy.get('[data-test-subj="visualEditorRadioCard"]').click({ force: true }); // Wait for input to load and then type in the monitor name - cy.get('input[name="name"]').type(SAMPLE_VISUAL_EDITOR_MONITOR); + cy.get('input[name="name"]').type(SAMPLE_VISUAL_EDITOR_MONITOR, { + force: true, + }); // Select associated monitors - cy.get('[data-test-subj="monitors_list_0"]').type('monitorOne', { + cy.get('[id="associatedMonitorsList_0"]').type('monitorOne', { delay: 50, + force: true, }); cy.get('[title="monitorOne"]').click({ force: true }); - cy.get('[data-test-subj="monitors_list_1"]').type('monitorTwo', { + cy.get('[id="associatedMonitorsList_1"]').type('monitorTwo', { delay: 50, + force: true, }); cy.get('[title="monitorTwo"]').click({ force: true }); @@ -88,9 +92,9 @@ describe('CompositeLevelMonitor', () => { // Type trigger name cy.get('[data-test-subj="composite-trigger-name"]') - .type('{selectall}') - .type('{backspace}') - .type('Composite trigger'); + .type('{selectall}', { force: true }) + .type('{backspace}', { force: true }) + .type('Composite trigger', { force: true }); cy.intercept('api/alerting/workflows').as('createMonitorRequest'); cy.intercept(`api/alerting/monitors?*`).as('getMonitorsRequest'); @@ -159,8 +163,9 @@ describe('CompositeLevelMonitor', () => { cy.get('button').contains('Add another monitor').click({ force: true }); - cy.get('[data-test-subj="monitors_list_2"]').type('monitorThree', { + cy.get('[id="associatedMonitorsList_2"]').type('monitorThree', { delay: 50, + force: true, }); cy.get('[title="monitorThree"]').click({ force: true }); @@ -180,9 +185,8 @@ describe('CompositeLevelMonitor', () => { // Wait for monitor to be created cy.wait('@updateMonitorRequest').then(() => { - cy.get('.euiTitle--large').contains( - `${SAMPLE_VISUAL_EDITOR_MONITOR}_edited` - ); + cy.wait(5000); + cy.contains(`${SAMPLE_VISUAL_EDITOR_MONITOR}_edited`); }); }); });