Skip to content

Commit

Permalink
[Security Solution] Fix bulk edit rules tests (elastic#164692)
Browse files Browse the repository at this point in the history
**Relates to:** elastic#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) 🟢

(cherry picked from commit 6ab3aa3)
  • Loading branch information
maximpn committed Aug 26, 2023
1 parent 41b32c7 commit 1dcbe39
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import {
import {
createAndInstallMockedPrebuiltRules,
getAvailablePrebuiltRulesCount,
preventPrebuiltRulesPackageInstallation,
} from '../../../../../tasks/api_calls/prebuilt_rules';
import { setRowsPerPageTo, sortByTableColumn } from '../../../../../tasks/table_pagination';

Expand Down Expand Up @@ -123,6 +124,7 @@ describe('Detection rules, bulk edit', { tags: [tag.ESS, tag.BROKEN_IN_SERVERLES
// 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 @@ -233,9 +235,7 @@ describe('Detection rules, bulk edit', { tags: [tag.ESS, tag.BROKEN_IN_SERVERLES
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 1dcbe39

Please sign in to comment.