diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/upgrade_risk_score.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/upgrade_risk_score.cy.ts index 2f399416122d2..0da6597450126 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/upgrade_risk_score.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/upgrade_risk_score.cy.ts @@ -36,7 +36,7 @@ import { deleteRiskEngineConfiguration } from '../../../tasks/api_calls/risk_eng const spaceId = 'default'; describe('Upgrade risk scores', { tags: ['@ess', '@serverless'] }, () => { - before(() => { + beforeEach(() => { login(); deleteRiskEngineConfiguration(); createRule(getNewRule({ rule_id: 'rule1' })); @@ -44,7 +44,6 @@ describe('Upgrade risk scores', { tags: ['@ess', '@serverless'] }, () => { describe('show upgrade risk button', () => { beforeEach(() => { - login(); deleteRiskScore({ riskScoreEntity: RiskScoreEntity.host, spaceId }); deleteRiskScore({ riskScoreEntity: RiskScoreEntity.user, spaceId }); installLegacyRiskScoreModule(RiskScoreEntity.host, spaceId); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_flyout.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_flyout.cy.ts index b2d545773cb94..90eb208f7d710 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_flyout.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_flyout.cy.ts @@ -62,14 +62,18 @@ describe( }, }, () => { - before(() => { + beforeEach(() => { cy.task('esArchiverLoad', { archiveName: 'risk_scores_new_complete_data' }); cy.task('esArchiverLoad', { archiveName: 'query_alert', useCreate: true, docsOnly: true }); cy.task('esArchiverLoad', { archiveName: 'user_managed_data' }); enableAssetCriticality(); + mockRiskEngineEnabled(); + login(); + visitWithTimeRange(ALERTS_URL); + waitForAlerts(); }); - after(() => { + afterEach(() => { cy.task('esArchiverUnload', 'risk_scores_new_complete_data'); cy.task('esArchiverUnload', 'user_managed_data'); deleteAlertsAndRules(); // esArchiverUnload doesn't work properly when using with `useCreate` and `docsOnly` flags @@ -77,13 +81,6 @@ describe( deleteCriticality({ idField: 'user.name', idValue: USER_NAME }); }); - beforeEach(() => { - mockRiskEngineEnabled(); - login(); - visitWithTimeRange(ALERTS_URL); - waitForAlerts(); - }); - describe('User details', () => { it('should display entity flyout and open risk input panel', () => { expandFirstAlertUserFlyout(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/host_details/risk_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/host_details/risk_tab.cy.ts index fcb329da8b0d0..6b4f12a7619aa 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/host_details/risk_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/host_details/risk_tab.cy.ts @@ -22,7 +22,6 @@ describe('risk tab', { tags: ['@ess', '@serverless'] }, () => { // FLAKY: https://github.com/elastic/kibana/issues/169034 describe.skip('with legacy risk score', () => { before(() => { - // illegal_argument_exception: unknown setting [index.lifecycle.rollover_alias] cy.task('esArchiverLoad', { archiveName: 'risk_hosts' }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/hosts_risk_column.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/hosts_risk_column.cy.ts index 15e62f274145f..dfbb017efe0d2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/hosts_risk_column.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/hosts_risk_column.cy.ts @@ -16,7 +16,6 @@ import { mockRiskEngineEnabled } from '../../../tasks/entity_analytics'; describe('All hosts table', { tags: ['@ess', '@serverless'] }, () => { describe('with legacy risk score', () => { before(() => { - // illegal_argument_exception: unknown setting [index.lifecycle.name] cy.task('esArchiverLoad', { archiveName: 'risk_hosts' }); }); @@ -39,7 +38,6 @@ describe('All hosts table', { tags: ['@ess', '@serverless'] }, () => { describe('with new risk score', () => { before(() => { - // illegal_argument_exception: unknown setting [index.lifecycle.name] cy.task('esArchiverLoad', { archiveName: 'risk_scores_new' }); });