Skip to content

Commit

Permalink
[Security Solution] Fix flakiness in: `prebuilt_rules_management.cy.t…
Browse files Browse the repository at this point in the history
…s` - Deletes and recovers more than one rule (#164694)

Relates to: #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
🟢
  • Loading branch information
jpdjere authored Aug 28, 2023
1 parent 78ba034 commit e22f9b8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from '../../../screens/alerts_detection_rules';
import {
deleteFirstRule,
disableAutoRefresh,
getRulesManagementTableRows,
selectAllRules,
selectRulesByName,
Expand All @@ -32,6 +33,7 @@ import {
import {
createAndInstallMockedPrebuiltRules,
getAvailablePrebuiltRulesCount,
preventPrebuiltRulesPackageInstallation,
} from '../../../tasks/api_calls/prebuilt_rules';
import {
cleanKibana,
Expand All @@ -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', () => {
Expand Down

0 comments on commit e22f9b8

Please sign in to comment.