Skip to content

Commit

Permalink
enable feature flag and cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christineweng committed Jul 17, 2024
1 parent 3e80e0e commit 2feca71
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const allowedExperimentalValues = Object.freeze({
/**
* Enables entity and alert previews
*/
entityAlertPreviewEnabled: false,
entityAlertPreviewEnabled: true,

/**
* Enables the Assistant Model Evaluation advanced setting and API endpoint, introduced in `8.11.0`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import {
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_ENTITIES_BUTTON,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS_RIGHT_SECTION,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS_TITLE,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS_LINK,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_RIGHT_SECTION,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_TITLE,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_LINK,
} from '../../../../screens/expandable_flyout/alert_details_left_panel_entities_tab';
import {
Expand Down Expand Up @@ -68,34 +66,20 @@ describe(
.should('have.text', 'Entities')
.and('have.class', 'euiButtonGroupButton-isSelected');

// github.com/elastic/security-team/issues/9933
// Comment out when feature flag 'entityAlertPreviewEnabled' is enabled
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_TITLE).should(
'contain.text',
'test'
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_RIGHT_SECTION).should(
'contain.text',
'Related hosts: 0'
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS).should('exist');

// github.com/elastic/security-team/issues/9933
// Comment out when feature flag 'entityAlertPreviewEnabled' is enabled
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS_TITLE).should(
'contain.text',
'siem-kibana'
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS_RIGHT_SECTION).should(
'contain.text',
'Related users: 0'
);
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS).should('exist');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('should open host preview when click on host details title', () => {
it('should open host preview when click on host details title', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS_LINK).should(
'contain.text',
'siem-kibana'
Expand All @@ -115,9 +99,7 @@ describe(
cy.get(HOST_PREVIEW_PANEL_FOOTER).should('not.exist');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('should open user preview when click on user details title', () => {
it('should open user preview when click on user details title', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_LINK).should('contain.text', 'test');
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS_LINK).click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ describe(
);
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('should open host preview when click on host details title', () => {
it('should open host preview when click on host details title', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_HOST_CELL).click();

cy.get(PREVIEW_SECTION).should('exist');
Expand All @@ -118,9 +116,7 @@ describe(
cy.get(HOST_PREVIEW_PANEL_FOOTER).should('not.exist');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('should open user preview when click on user details title', () => {
it('should open user preview when click on user details title', () => {
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_USER_CELL).click();

cy.get(PREVIEW_SECTION).should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ import {
openTableTab,
} from '../../../../tasks/expandable_flyout/alert_details_right_panel';

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
describe.skip(
describe(
'Opening alert previews from alert details flyout',
{ tags: ['@ess', '@serverless'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
*/

import { deleteAlertsAndRules } from '../../../../tasks/api_calls/common';
import {
closeFlyout,
collapseDocumentDetailsExpandableFlyoutLeftSection,
} from '../../../../tasks/expandable_flyout/alert_details_right_panel';
import { closeFlyout } from '../../../../tasks/expandable_flyout/alert_details_right_panel';
import {
createNewCaseFromExpandableFlyout,
expandAlertAtIndexExpandableFlyout,
Expand Down Expand Up @@ -65,11 +62,7 @@ import { createRule } from '../../../../tasks/api_calls/rules';
import { getNewRule } from '../../../../objects/rule';
import { ALERTS_URL } from '../../../../urls/navigation';
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';
import {
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_ENTITIES_BUTTON,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS,
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS,
} from '../../../../screens/expandable_flyout/alert_details_left_panel_entities_tab';
import { DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_ENTITIES_BUTTON } from '../../../../screens/expandable_flyout/alert_details_left_panel_entities_tab';
import {
DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB,
DOCUMENT_DETAILS_FLYOUT_INVESTIGATION_TAB,
Expand Down Expand Up @@ -238,29 +231,7 @@ describe(
);
});

// github.com/elastic/security-team/issues/9933
// Skip when feature flag 'entityAlertPreviewEnabled' is enabled
it('should open entities details when clicking host name and user name', () => {
const hostNameCell =
DOCUMENT_DETAILS_FLYOUT_OVERVIEW_TAB_HIGHLIGHTED_FIELDS_TABLE_VALUE_CELL('siem-kibana');
cy.get(hostNameCell).and('have.text', 'siem-kibana');

cy.get(hostNameCell).click();
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_HOST_DETAILS).should('exist');

collapseDocumentDetailsExpandableFlyoutLeftSection();

const userNameCell =
DOCUMENT_DETAILS_FLYOUT_OVERVIEW_TAB_HIGHLIGHTED_FIELDS_TABLE_VALUE_CELL('test');
cy.get(userNameCell).should('have.text', 'test');

cy.get(userNameCell).click();
cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_USER_DETAILS).should('exist');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('should open host preview when host name is clicked', () => {
it('should open host preview when host name is clicked', () => {
toggleOverviewTabAboutSection();

cy.log('should open host preview when clicked on host name');
Expand All @@ -282,9 +253,7 @@ describe(
cy.get(HOST_PREVIEW_PANEL_FOOTER).should('not.exist');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('should open user preview when user name is clicked', () => {
it('should open user preview when user name is clicked', () => {
toggleOverviewTabAboutSection();

const userNameCell =
Expand Down Expand Up @@ -328,9 +297,7 @@ describe(
.and('have.class', 'euiButtonGroupButton-isSelected');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('open host preview when host name is clicked', () => {
it('open host preview when host name is clicked', () => {
toggleOverviewTabAboutSection();
toggleOverviewTabInvestigationSection();
toggleOverviewTabInsightsSection();
Expand All @@ -352,9 +319,7 @@ describe(
cy.get(HOST_PREVIEW_PANEL_FOOTER).should('not.exist');
});

// github.com/elastic/security-team/issues/9933
// Enable when feature flag 'entityAlertPreviewEnabled' is enabled
it.skip('open user preview when user name is clicked', () => {
it('open user preview when user name is clicked', () => {
toggleOverviewTabAboutSection();
toggleOverviewTabInvestigationSection();
toggleOverviewTabInsightsSection();
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/security_solution_cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"cypress:detection_engine:exceptions:run:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/detection_engine/exceptions/**/*.cy.ts'",
"cypress:ai_assistant:run:ess":"yarn cypress:ess --spec './cypress/e2e/ai_assistant/**/*.cy.ts'",
"cypress:run:respops:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/**/*.cy.ts'",
"cypress:investigations:run:ess": "yarn cypress:ess --spec './cypress/e2e/investigations/**/*.cy.ts'",
"cypress:investigations:run:ess": "yarn cypress:ess --spec './cypress/e2e/investigations/alerts/expandable_flyout/**/*.cy.ts'",
"cypress:explore:run:ess": "yarn cypress:ess --spec './cypress/e2e/explore/**/*.cy.ts'",
"cypress:changed-specs-only:ess": "yarn cypress:ess --changed-specs-only --env burn=5",
"cypress:burn:ess": "yarn cypress:ess --env burn=5",
Expand All @@ -32,7 +32,7 @@
"cypress:detection_engine:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/detection_response/detection_engine/!(exceptions)/**/*.cy.ts'",
"cypress:detection_engine:exceptions:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/detection_response/detection_engine/exceptions/**/*.cy.ts'",
"cypress:ai_assistant:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/ai_assistant/**/*.cy.ts'",
"cypress:investigations:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/investigations/**/*.cy.ts'",
"cypress:investigations:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/investigations/alerts/expandable_flyout/**/*.cy.ts'",
"cypress:explore:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/explore/**/*.cy.ts'",
"cypress:changed-specs-only:serverless": "yarn cypress:serverless --changed-specs-only --env burn=5",
"cypress:burn:serverless": "yarn cypress:serverless --env burn=2",
Expand Down

0 comments on commit 2feca71

Please sign in to comment.