Skip to content

Commit

Permalink
[Security Solution] Fix bulk edit rules tests (#164692)
Browse files Browse the repository at this point in the history
**Relates to:** #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) 🟢
  • Loading branch information
maximpn authored Aug 25, 2023
1 parent 0b4adc8 commit 6ab3aa3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import {
import {
createAndInstallMockedPrebuiltRules,
getAvailablePrebuiltRulesCount,
preventPrebuiltRulesPackageInstallation,
} from '../../../../../tasks/api_calls/prebuilt_rules';
import { setRowsPerPageTo, sortByTableColumn } from '../../../../../tasks/table_pagination';

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 6ab3aa3

Please sign in to comment.