[8.9] [Security Solution] Fix flaky test: detection_rules/bulk_edit_rules_actions.cy.ts#164569
Merged
jpdjere merged 2 commits intoelastic:8.9from Aug 24, 2023
Merged
[8.9] [Security Solution] Fix flaky test: detection_rules/bulk_edit_rules_actions.cy.ts#164569jpdjere merged 2 commits intoelastic:8.9from
jpdjere merged 2 commits intoelastic:8.9from
Conversation
Contributor
|
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @jpdjere |
banderror
approved these changes
Aug 24, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: This is a manual backport of #163698
Original PR description:
Fixes: #154721
Summary
x-pack/plugins/security_solution/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_actions.cy.tsDetection rules, bulk edit of rule actionsDetails
For:
Detection rules, bulk edit of rule actions - Restricted action privileges - User with no privileges can't add rule actionsselectNumberOfRules();command selects rules one by one by clicking on their checkboxes. However, flakiness was caused when the callout was rendered while the selection of the rules was happening, causing a layout shift that caused the selection of a checkbox to lose focus, and not being able to be checked. This was solved by waiting the callout to be rendered before the selection of rules start, with the newwaitForCallOutToBeShownmethod.For:
Detection rules, bulk edit of rule actions - All actions privileges - before/beforeEach ClausebeforeEachclause because the first test, mentioned above, would be logged in with aROLES.hunter_no_actionsrole, and logging in with a user with permissions happened in abeforeclause instead of abeforeEachclause. This caused the rest of the suite to continue with a role without permissions, and the setup of the second test would fail as the API requests done would fail with401. Moving the initial logging-in from abeforeclause to abeforeEachclause solved this issue.For:
Detection rules, bulk edit of rule actions - All actions privileges - Add a rule action to rules (existing connector)Other changes
security_detection_enginepackage and creates mock rules instead.waitForCallOutToBeShownmethod and moves the callout IDs spread across different files to a a single file where they are exported from.