Skip to content

Commit

Permalink
[Alerting] Update alerting tests in main (#880)
Browse files Browse the repository at this point in the history
* forcing name typing (#865)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* [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 <amardeep7194@gmail.com>

* wait before checking update status

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
amsiglan authored Oct 6, 2023
1 parent 07eb834 commit d52ad2f
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,30 @@ 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 });

cy.get('button').contains('Add trigger').click({ force: true });

// 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');
Expand Down Expand Up @@ -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 });

Expand All @@ -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`);
});
});
});
Expand Down

0 comments on commit d52ad2f

Please sign in to comment.