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] Unskipping x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/ working tests on serverless #167512

Original file line number Diff line number Diff line change
Expand Up @@ -34,77 +34,71 @@ import { login } from '../../../../tasks/login';
import { visit } from '../../../../tasks/navigation';
import { ALERTS_URL } from '../../../../urls/navigation';

describe(
'Expandable flyout left panel correlations',
{ tags: ['@ess', '@brokenInServerless'] },
() => {
beforeEach(() => {
cleanKibana();
login();
createRule(getNewRule());
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
expandDocumentDetailsExpandableFlyoutLeftSection();
createNewCaseFromExpandableFlyout();
openInsightsTab();
openCorrelationsTab();
});
describe('Expandable flyout left panel correlations', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
cleanKibana();
login();
createRule(getNewRule());
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
expandDocumentDetailsExpandableFlyoutLeftSection();
createNewCaseFromExpandableFlyout();
openInsightsTab();
openCorrelationsTab();
});

it('should render correlations details correctly', () => {
cy.log('link the alert to a new case');
it('should render correlations details correctly', () => {
cy.log('link the alert to a new case');

cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).scrollIntoView();
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).scrollIntoView();

cy.log('should render the Insights header');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB)
.should('be.visible')
.and('have.text', 'Insights');
cy.log('should render the Insights header');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).should('be.visible').and('have.text', 'Insights');

cy.log('should render the inner tab switch');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible');
cy.log('should render the inner tab switch');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible');

cy.log('should render correlations tab activator / button');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_CORRELATIONS_BUTTON)
.should('be.visible')
.and('have.text', 'Correlations');
cy.log('should render correlations tab activator / button');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_CORRELATIONS_BUTTON)
.should('be.visible')
.and('have.text', 'Correlations');

cy.log('should render all the correlations sections');
cy.log('should render all the correlations sections');

cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE).scrollIntoView();
cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE)
.should('be.visible')
.and('contain.text', '1 alert related by ancestry');
cy.get(CORRELATIONS_ANCESTRY_SECTION_TABLE).should('be.visible');
cy.get(CORRELATIONS_ANCESTRY_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');
cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE).scrollIntoView();
cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE)
.should('be.visible')
.and('contain.text', '1 alert related by ancestry');
cy.get(CORRELATIONS_ANCESTRY_SECTION_TABLE).should('be.visible');
cy.get(CORRELATIONS_ANCESTRY_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');

// TODO get proper data to test this section
// cy.get(CORRELATIONS_SOURCE_SECTION).scrollIntoView();
// cy.get(CORRELATIONS_SOURCE_SECTION)
// .should('be.visible')
// .and('contain.text', '0 alerts related by source event');
// cy.get(CORRELATIONS_SOURCE_SECTION_TABLE).should('be.visible');
// cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');
// TODO get proper data to test this section
// cy.get(CORRELATIONS_SOURCE_SECTION).scrollIntoView();
// cy.get(CORRELATIONS_SOURCE_SECTION)
// .should('be.visible')
// .and('contain.text', '0 alerts related by source event');
// cy.get(CORRELATIONS_SOURCE_SECTION_TABLE).should('be.visible');
// cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');

cy.get(CORRELATIONS_SESSION_SECTION_TITLE).scrollIntoView();
cy.get(CORRELATIONS_SESSION_SECTION_TITLE)
.should('be.visible')
.and('contain.text', '1 alert related by session');
cy.get(CORRELATIONS_SESSION_SECTION_TABLE).should('be.visible');
cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');
cy.get(CORRELATIONS_SESSION_SECTION_TITLE).scrollIntoView();
cy.get(CORRELATIONS_SESSION_SECTION_TITLE)
.should('be.visible')
.and('contain.text', '1 alert related by session');
cy.get(CORRELATIONS_SESSION_SECTION_TABLE).should('be.visible');
cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');

cy.get(CORRELATIONS_CASES_SECTION_TITLE).scrollIntoView();
cy.get(CORRELATIONS_CASES_SECTION_TITLE)
.should('be.visible')
.and('contain.text', '1 related case');
cy.get(CORRELATIONS_CASES_SECTION_TABLE).should('be.visible');
cy.get(CORRELATIONS_CASES_SECTION_TITLE).scrollIntoView();
cy.get(CORRELATIONS_CASES_SECTION_TITLE)
.should('be.visible')
.and('contain.text', '1 related case');
cy.get(CORRELATIONS_CASES_SECTION_TABLE).should('be.visible');

// TODO get proper data to test suppressed alerts
// cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE).scrollIntoView();
// cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE)
// .should('be.visible')
// .and('contain.text', '1 suppressed alert');
// cy.get(CORRELATIONS_SUPPRESSED_ALERTS_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');
});
}
);
// TODO get proper data to test suppressed alerts
// cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE).scrollIntoView();
// cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE)
// .should('be.visible')
// .and('contain.text', '1 suppressed alert');
// cy.get(CORRELATIONS_SUPPRESSED_ALERTS_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';

describe(
'Alert details expandable flyout left panel entities',
{ tags: ['@ess', '@brokenInServerless'] },
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
cleanKibana();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';

describe(
'Alert details expandable flyout left panel investigation',
{ tags: ['@ess', '@brokenInServerless'] },
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
cleanKibana();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,60 @@ import { getNewRule } from '../../../../objects/rule';
import { ALERTS_URL } from '../../../../urls/navigation';
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';

describe('Alert details expandable flyout left panel prevalence', () => {
beforeEach(() => {
cleanKibana();
login();
createRule({ ...getNewRule(), investigation_fields: { field_names: ['host.os.name'] } });
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
expandDocumentDetailsExpandableFlyoutLeftSection();
openInsightsTab();
openPrevalenceTab();
});
describe(
'Alert details expandable flyout left panel prevalence',
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
cleanKibana();
login();
createRule({ ...getNewRule(), investigation_fields: { field_names: ['host.os.name'] } });
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
expandDocumentDetailsExpandableFlyoutLeftSection();
openInsightsTab();
openPrevalenceTab();
});

it('should display prevalence tab', { tags: ['@ess', '@brokenInServerless'] }, () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).should('be.visible').and('have.text', 'Insights');
it('should display prevalence tab', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB)
.should('be.visible')
.and('have.text', 'Insights');

cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible');

cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_BUTTON)
.should('be.visible')
.and('have.text', 'Prevalence');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_BUTTON)
.should('be.visible')
.and('have.text', 'Prevalence');

cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_DATE_PICKER).should('be.visible');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_DATE_PICKER).should('be.visible');

cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE).should('be.visible');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_TYPE_CELL)
.should('contain.text', 'host.os.name')
.and('contain.text', 'host.name')
.and('contain.text', 'user.name');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_NAME_CELL)
.should('contain.text', 'Mac OS X')
.and('contain.text', 'siem-kibana')
.and('contain.text', 'test');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_ALERT_COUNT_CELL).should(
'contain.text',
2
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_DOC_COUNT_CELL).should(
'contain.text',
'—'
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_HOST_PREVALENCE_CELL).should(
'contain.text',
100
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_USER_PREVALENCE_CELL).should(
'contain.text',
100
);
});
});
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE).should('be.visible');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_TYPE_CELL)
.should('contain.text', 'host.os.name')
.and('contain.text', 'host.name')
.and('contain.text', 'user.name');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_NAME_CELL)
.should('contain.text', 'Mac OS X')
.and('contain.text', 'siem-kibana')
.and('contain.text', 'test');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_ALERT_COUNT_CELL).should(
'contain.text',
2
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_DOC_COUNT_CELL).should(
'contain.text',
'—'
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_HOST_PREVALENCE_CELL).should(
'contain.text',
100
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_USER_PREVALENCE_CELL).should(
'contain.text',
100
);
});
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ import { getNewRule } from '../../../../objects/rule';
import { ALERTS_URL } from '../../../../urls/navigation';
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';

describe('Alert details expandable flyout left panel investigation', () => {
beforeEach(() => {
cleanKibana();
login();
createRule(getNewRule());
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
expandDocumentDetailsExpandableFlyoutLeftSection();
openResponseTab();
});
describe(
'Alert details expandable flyout left panel investigation',
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
cleanKibana();
login();
createRule(getNewRule());
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
expandDocumentDetailsExpandableFlyoutLeftSection();
openResponseTab();
});

it('should display empty response message', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_RESPONSE_EMPTY).should('be.visible');
});
});
it('should display empty response message', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_RESPONSE_EMPTY).should('be.visible');
});
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';
// TODO enable once the visualize tabs are back
describe.skip(
'Alert details expandable flyout left panel session view',
{ tags: ['@ess', '@brokenInServerless'] },
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
cleanKibana();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_THREAT_INTELLIGENCE_BUTTON } from

describe(
'Expandable flyout left panel threat intelligence',
{ tags: ['@ess', '@brokenInServerless'] },
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
cleanKibana();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';

describe(
'Alert details expandable flyout rule preview panel',
{ tags: ['@ess', '@brokenInServerless'] },
{ tags: ['@ess', '@serverless'] },
() => {
const rule = getNewRule();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ import { getNewRule } from '../../../../objects/rule';
import { ALERTS_URL } from '../../../../urls/navigation';
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';

describe('Alert details expandable flyout rule preview panel', () => {
const rule = getNewRule();
describe(
'Alert details expandable flyout rule preview panel',
{ tags: ['@ess', '@serverless'] },
() => {
const rule = getNewRule();

beforeEach(() => {
cleanKibana();
login();
createRule(rule);
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
clickRuleSummaryButton();
});
beforeEach(() => {
cleanKibana();
login();
createRule(rule);
visit(ALERTS_URL);
waitForAlertsToPopulate();
expandFirstAlertExpandableFlyout();
clickRuleSummaryButton();
});

describe('rule preview', () => {
it(
'should display rule preview and its sub sections',
{ tags: ['@ess', '@brokenInServerless'] },
() => {
describe('rule preview', () => {
it('should display rule preview and its sub sections', () => {
cy.log('rule preview panel');

cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SECTION).scrollIntoView();
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Alert details expandable flyout rule preview panel', () => {
cy.log('footer');
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER).scrollIntoView();
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER).should('be.visible');
}
);
});
});
});
});
}
);
Loading