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

[Security Solution] Fix : skip failing MKI test #201120

Merged
merged 2 commits into from
Nov 21, 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 @@ -47,57 +47,67 @@ describe('Alerts cell actions', { tags: ['@ess', '@serverless'] }, () => {
waitForAlertsToPopulate();
});

it('should filter in and out existing values', () => {
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
filterForAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', `kibana.alert.severity: ${severityVal}`);
});
removeKqlFilter();
});
// Flaky in Serverless MKI only
// https://github.com/elastic/kibana/issues/201117
it(
'should filter in and out existing values',
{
tags: ['@skipInServerlessMKI'],
},
() => {
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
filterForAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE)
.first()
.should('have.text', `kibana.alert.severity: ${severityVal}`);
});
removeKqlFilter();
});

cy.log('should work for empty properties');
// add query condition to make sure the field is empty
fillKqlQueryBar('not file.name: *{enter}');
cy.log('should work for empty properties');
// add query condition to make sure the field is empty
fillKqlQueryBar('not file.name: *{enter}');

scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
cy.log('filter for alert property');
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
cy.log('filter for alert property');

filterForAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
filterForAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);

cy.get(FILTER_BADGE).first().should('have.text', 'NOT file.name: exists');
removeKqlFilter();
});
cy.get(FILTER_BADGE).first().should('have.text', 'NOT file.name: exists');
removeKqlFilter();
});

cy.log('filter out alert property');
cy.log('filter out alert property');

scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
cy.get(ALERT_TABLE_FILE_NAME_VALUES)
.first()
.then(() => {
filterOutAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', 'file.name: exists');
});
removeKqlFilter();
});

cy.log('should filter out a non-empty property');
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
cy.get(ALERT_TABLE_FILE_NAME_VALUES)
.first()
.then(() => {
filterOutAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', 'file.name: exists');
});
removeKqlFilter();
});

scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
filterOutAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE)
.first()
.should('have.text', `NOT kibana.alert.severity: ${severityVal}`);
});
});
});
cy.log('should filter out a non-empty property');

scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
filterOutAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE)
.first()
.should('have.text', `NOT kibana.alert.severity: ${severityVal}`);
});
});
}
);

it('should allow copy paste', () => {
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
Expand Down