From 6ab3aa3da1a3d1ed37b711efb9891cae43c0da39 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Fri, 25 Aug 2023 15:26:47 +0200 Subject: [PATCH] [Security Solution] Fix bulk edit rules tests (#164692) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Relates to:** https://github.com/elastic/kibana/issues/161507 ## Summary This PR fixes **bulk_edit_rules.cy.ts** flakiness found while running Security Solution Cypress tests in Flaky test runner ([run 1](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2969) and [run 2](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2970)). ## Flaky test runner [bulk_edit_rules.cy.ts 300 runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2975) 🟢 --- .../rule_actions/bulk_actions/bulk_edit_rules.cy.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts index 5ae78264a0b93..4b86a8344836c 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts @@ -95,6 +95,7 @@ import { import { createAndInstallMockedPrebuiltRules, getAvailablePrebuiltRulesCount, + preventPrebuiltRulesPackageInstallation, } from '../../../../../tasks/api_calls/prebuilt_rules'; import { setRowsPerPageTo, sortByTableColumn } from '../../../../../tasks/table_pagination'; @@ -122,6 +123,7 @@ describe('Detection rules, bulk edit', { tags: ['@ess', '@brokenInServerless'] } // Make sure persisted rules table state is cleared resetRulesTableState(); deleteAlertsAndRules(); + preventPrebuiltRulesPackageInstallation(); // Make sure prebuilt rules aren't pulled from Fleet API cy.task('esArchiverResetKibana'); createRule(getNewRule({ name: RULE_NAME, ...defaultRuleData, rule_id: '1', enabled: false })); createRule( @@ -232,9 +234,7 @@ describe('Detection rules, bulk edit', { tags: ['@ess', '@brokenInServerless'] } clickAddTagsMenuItem(); waitForMixedRulesBulkEditModal(rows.length); - getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { - checkPrebuiltRulesCannotBeModified(availablePrebuiltRulesCount); - }); + checkPrebuiltRulesCannotBeModified(PREBUILT_RULES.length); // user cancels action and modal disappears cancelConfirmationModal();