From 262f09cf9b6109e07c8dfc04ca42676b4e34a779 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 30 Nov 2022 12:13:49 -0500 Subject: [PATCH] [8.6] [Security Solution] Refactors `All exception lists - read only` tests to remove flakiness (#146677) (#146708) # Backport This will backport the following commits from `main` to `8.6`: - [[Security Solution] Refactors `All exception lists - read only` tests to remove flakiness (#146677)](https://github.com/elastic/kibana/pull/146677) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Gloria Hornero --- .../all_exception_lists_read_only.cy.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/all_exception_lists_read_only.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/all_exception_lists_read_only.cy.ts index c1c4fc18960e6..ae16df825d125 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/all_exception_lists_read_only.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/all_exception_lists_read_only.cy.ts @@ -5,16 +5,16 @@ * 2.0. */ +import { cleanKibana } from '../../../tasks/common'; import { ROLES } from '../../../../common/test'; import { getExceptionList } from '../../../objects/exception'; import { EXCEPTIONS_TABLE_SHOWING_LISTS } from '../../../screens/exceptions'; -import { createExceptionList } from '../../../tasks/api_calls/exceptions'; +import { createExceptionList, deleteExceptionList } from '../../../tasks/api_calls/exceptions'; import { dismissCallOut, getCallOut, waitForCallOutToBeShown, } from '../../../tasks/common/callouts'; -import { esArchiverResetKibana } from '../../../tasks/es_archiver'; import { login, visitWithoutDateRange } from '../../../tasks/login'; import { EXCEPTIONS_URL } from '../../../urls/navigation'; @@ -22,7 +22,11 @@ const MISSING_PRIVILEGES_CALLOUT = 'missing-user-privileges'; describe('All exception lists - read only', () => { before(() => { - esArchiverResetKibana(); + cleanKibana(); + }); + + beforeEach(() => { + deleteExceptionList(getExceptionList().list_id, getExceptionList().namespace_type); // Create exception list not used by any rules createExceptionList(getExceptionList(), getExceptionList().list_id); @@ -30,8 +34,6 @@ describe('All exception lists - read only', () => { login(ROLES.reader); visitWithoutDateRange(EXCEPTIONS_URL, ROLES.reader); - cy.reload(); - // Using cy.contains because we do not care about the exact text, // just checking number of lists shown cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '1');