Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport main] [Security Analytics][2.15] Fix alerts tests security analytics #1404

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ describe('Alerts', () => {
});

it('are generated', () => {
setupIntercept(cy, '/_security_analytics/alerts', 'getAlerts', 'GET');

// Refresh the table
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click({
force: true,
});
cy.wait('@getAlerts').should('have.property', 'state', 'Complete');

// Confirm there are alerts created
cy.get('tbody > tr')
Expand Down Expand Up @@ -388,6 +391,8 @@ describe('Alerts', () => {
cy.get('[aria-label="Acknowledge"]').click({ force: true });
});

// Wait for acknowledge to go through
cy.wait(2000);
cy.get('tbody > tr')
.filter(`:contains(${alertName})`)
.should('have.length', 1);
Expand All @@ -398,6 +403,8 @@ describe('Alerts', () => {
cy.contains('Acknowledged').click({ force: true });
});

// Wait for filter to apply
cy.wait(2000);
// Confirm there are now 3 "Acknowledged" alerts
cy.get('tbody > tr')
.filter(`:contains(${alertName})`)
Expand Down
Loading