From 70931761d6af27ede0a7eaf04800439341234271 Mon Sep 17 00:00:00 2001 From: Yara Tercero Date: Wed, 29 Nov 2023 12:20:55 -0800 Subject: [PATCH] [Cypress][Flake] Fix manage_exceptions flake (#171699) ## Summary Addresses https://github.com/elastic/kibana/issues/171242, https://github.com/elastic/kibana/issues/171235 Seems it was related to not deleting rules on cleanup. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../manage_exceptions.cy.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts index 2b9b200ae6c26..dd21e8571673c 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts @@ -40,30 +40,28 @@ import { findSharedExceptionListItemsByName, } from '../../../tasks/exceptions_table'; import { visitRuleDetailsPage } from '../../../tasks/rule_details'; -import { deleteEndpointExceptionList, deleteExceptionLists } from '../../../tasks/api_calls/common'; +import { + deleteAlertsAndRules, + deleteEndpointExceptionList, + deleteExceptionLists, +} from '../../../tasks/api_calls/common'; -// https://github.com/elastic/kibana/issues/171235 -// FLAKY: https://github.com/elastic/kibana/issues/171242 -describe.skip('Add, edit and delete exception', { tags: ['@ess', '@serverless'] }, () => { +describe('Manage exceptions', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); + deleteAlertsAndRules(); deleteExceptionLists(); deleteEndpointExceptionList(); - cy.task('esArchiverLoad', { archiveName: 'exceptions' }); createRule(getNewRule()).as('createdRule'); visit(EXCEPTIONS_URL); }); - afterEach(() => { - cy.task('esArchiverUnload', 'exceptions'); - }); - const exceptionName = 'My item name'; const exceptionNameEdited = 'My item name edited'; const FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD = 'agent.name'; const EXCEPTION_LIST_NAME = 'Newly created list'; - describe('Add, Edit and delete Exception item', () => { + describe('Add, edit and delete exception item', () => { it('should create exception item from Shared Exception List page and linked to a Rule', () => { // Click on "Create shared exception list" button on the header // Click on "Create exception item"