forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Get rid of
goToRuleDetails()
in favor of `goToR…
…uleDetailsOf()` (elastic#165011) **Addresses:** elastic#164513 ## Summary This PR gets rid of Rules Management `goToRuleDetails()` Cypress helper replacing it with `goToRuleDetailsOf()`. ## Details The following has been done - `goToRuleDetails()` replaced with `goToRuleDetailsOf()` where it makes sense (rule creation, scenarios validating something on the rules management table and then on the rule details page and etc). - For quite a number of tests expectations are done on the rule details page but it's opened via rules management table page. In fact this unnecessary step may be flaky as rules table has auto resfresh feature and it should be ideally disabled as well as this requires loading of lazy UI resources and increases test's execution time. It can be avoided by directly opening the details page via ```ts createRule(getNewRule()).then((rule) => visitWithoutDateRange(ruleDetailsUrl(rule.body.id)) ); ``` `goToRuleDetails()` was removed from such tests in favor of opening the rule details page directly. ## Does opening rule detail page directly make the tests less stable? Yes, it can give such side effect but it will help to either find and fix some bugs in our code or make our tests more robust by adding an universal page ready expectation. While working on this PR I had to fix a few problems on the rule details page caused by getting rid of unnecessary opening rule details page via rules management table but it fact it revealed rule details page's problems - If a test needs first thing to enable a rule like editing test for custom query rule the test may fail as `-1` is sent as rule id. In fact it's a page loading problem. Rule switch become available while the rule isn't loaded yet and it can be easily reproduced in prod if the connection is slow. Disabling rule switch while rule isn't loaded yet solves the problem. - Rule exceptions tests turned to be flaky. Edit exception list item context menu closes on its own sometimes. In fact `useEffect` causing HTTP request fired much more often than it should due to exception list types defined in place and regenerated each render causing the list item to be in loading state while the request is in progress. It was fixed by moving the arrays to stable constants. ## Flaky test runner [Security Solution Cypress tests (150 runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3017) (there is no indication of negative impact)
- Loading branch information
Showing
39 changed files
with
694 additions
and
660 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.