From 78feee8dde4f8c7845f95820f7f05b73e272aef6 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 22 Sep 2021 14:50:21 +0200 Subject: [PATCH] refactors 'exceptions table' tests --- .../integration/exceptions/exceptions_table.spec.ts | 7 +------ .../plugins/security_solution/cypress/objects/exception.ts | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/security_solution/cypress/integration/exceptions/exceptions_table.spec.ts b/x-pack/plugins/security_solution/cypress/integration/exceptions/exceptions_table.spec.ts index d217c4bc736b1..4eb146dbd2123 100644 --- a/x-pack/plugins/security_solution/cypress/integration/exceptions/exceptions_table.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/exceptions/exceptions_table.spec.ts @@ -23,11 +23,9 @@ import { waitForPageWithoutDateRange, } from '../../tasks/login'; import { - activatesRule, addsExceptionFromRuleSettings, goBackToAllRulesTable, goToExceptionsTab, - waitForTheRuleToBeExecuted, } from '../../tasks/rule_details'; import { ALERTS_URL, EXCEPTIONS_URL } from '../../urls/navigation'; @@ -59,12 +57,9 @@ describe('Exceptions Table', () => { esArchiverLoad('auditbeat_for_exceptions'); - activatesRule(); - // Add a detections exception list goToExceptionsTab(); addsExceptionFromRuleSettings(getException()); - waitForTheRuleToBeExecuted(); // Create exception list not used by any rules createExceptionList(getExceptionList(), getExceptionList().list_id).as('exceptionListResponse'); @@ -116,7 +111,7 @@ describe('Exceptions Table', () => { cy.get(EXCEPTIONS_TABLE_SHOWING_LISTS).should('have.text', `Showing 3 lists`); }); - it.skip('Exports exception list', function () { + it('Exports exception list', function () { cy.intercept(/(\/api\/exception_lists\/_export)/).as('export'); waitForPageWithoutDateRange(EXCEPTIONS_URL); diff --git a/x-pack/plugins/security_solution/cypress/objects/exception.ts b/x-pack/plugins/security_solution/cypress/objects/exception.ts index 2bbcad9b4f4f3..81c3b885ab94d 100644 --- a/x-pack/plugins/security_solution/cypress/objects/exception.ts +++ b/x-pack/plugins/security_solution/cypress/objects/exception.ts @@ -42,5 +42,5 @@ export const expectedExportedExceptionList = ( ): string => { const jsonrule = exceptionListResponse.body; - return `"{\\"_version\\":\\"${jsonrule._version}\\",\\"created_at\\":\\"${jsonrule.created_at}\\",\\"created_by\\":\\"elastic\\",\\"description\\":\\"${jsonrule.description}\\",\\"id\\":\\"${jsonrule.id}\\",\\"immutable\\":false,\\"list_id\\":\\"test_exception_list\\",\\"name\\":\\"Test exception list\\",\\"namespace_type\\":\\"single\\",\\"os_types\\":[],\\"tags\\":[],\\"tie_breaker_id\\":\\"${jsonrule.tie_breaker_id}\\",\\"type\\":\\"detection\\",\\"updated_at\\":\\"${jsonrule.updated_at}\\",\\"updated_by\\":\\"elastic\\",\\"version\\":1}\n"\n""\n{"exception_list_items_details":"{\\"exported_count\\":0}\n"}\n`; + return `"{\\"_version\\":\\"${jsonrule._version}\\",\\"created_at\\":\\"${jsonrule.created_at}\\",\\"created_by\\":\\"elastic\\",\\"description\\":\\"${jsonrule.description}\\",\\"id\\":\\"${jsonrule.id}\\",\\"immutable\\":false,\\"list_id\\":\\"test_exception_list\\",\\"name\\":\\"Test exception list\\",\\"namespace_type\\":\\"single\\",\\"os_types\\":[],\\"tags\\":[],\\"tie_breaker_id\\":\\"${jsonrule.tie_breaker_id}\\",\\"type\\":\\"detection\\",\\"updated_at\\":\\"${jsonrule.updated_at}\\",\\"updated_by\\":\\"elastic\\",\\"version\\":1}\\n"\n""\n{"exception_list_items_details":"{\\"exported_count\\":0}\\n"}\n`; };