From e22f9b860e6d62ddcaacae6a1b2f57178afa8e54 Mon Sep 17 00:00:00 2001 From: Juan Pablo Djeredjian Date: Mon, 28 Aug 2023 13:02:22 +0200 Subject: [PATCH] [Security Solution] Fix flakiness in: `prebuilt_rules_management.cy.ts` - Deletes and recovers more than one rule (#164694) 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 - Solves flakiness in following test: - Filename: `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts` - Test name: **Prebuilt rules Actions with prebuilt rules Rules table Deletes and recovers more than one rule** - Test was failing because of already observed issue of `autoRefresh` taking place while the rule selection is happening, causing Cypress to lose focus and preventing the checkbox from being checked. This PR disables autorefresh from the table to prevent that from happening. ## Flaky test runner 350 iters: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2976 🟢 --- .../prebuilt_rules/prebuilt_rules_management.cy.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts index 9eb5f33bcdb4d..b172b84b76953 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts @@ -18,6 +18,7 @@ import { } from '../../../screens/alerts_detection_rules'; import { deleteFirstRule, + disableAutoRefresh, getRulesManagementTableRows, selectAllRules, selectRulesByName, @@ -32,6 +33,7 @@ import { import { createAndInstallMockedPrebuiltRules, getAvailablePrebuiltRulesCount, + preventPrebuiltRulesPackageInstallation, } from '../../../tasks/api_calls/prebuilt_rules'; import { cleanKibana, @@ -57,10 +59,12 @@ describe('Prebuilt rules', { tags: ['@ess', '@serverless'] }, () => { login(); deleteAlertsAndRules(); deletePrebuiltRulesAssets(); + preventPrebuiltRulesPackageInstallation(); visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); createAndInstallMockedPrebuiltRules({ rules }); cy.reload(); waitForPrebuiltDetectionRulesToBeLoaded(); + disableAutoRefresh(); }); describe('Alerts rules, prebuilt rules', () => {