mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Security Solution] [Detections] Fixes flakey exceptions read-only viewer cypress test (#162839)
## Summary Ref: https://github.com/elastic/kibana/issues/162569 The test was trying to load the exceptions tab before the rule details page loaded. Now we wait for the rule tab to load before continuing. Something I was unaware of was that `cy.url()` will [automatically retry](https://docs.cypress.io/api/commands/url#Assertions) until all chained assertions have passed, which I think can be an easy way to fix future flake issues where cypress tries to click on an element before the new page loads.
This commit is contained in:
parent
cafaa9295e
commit
7b3cc8f573
1 changed files with 3 additions and 2 deletions
|
@ -13,7 +13,7 @@ import { login, visitWithoutDateRange } from '../../../tasks/login';
|
|||
import { goToExceptionsTab, goToAlertsTab } from '../../../tasks/rule_details';
|
||||
import { goToRuleDetails } from '../../../tasks/alerts_detection_rules';
|
||||
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../urls/navigation';
|
||||
import { deleteAlertsAndRules } from '../../../tasks/common';
|
||||
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
|
||||
import {
|
||||
NO_EXCEPTIONS_EXIST_PROMPT,
|
||||
EXCEPTION_ITEM_VIEWER_CONTAINER,
|
||||
|
@ -31,7 +31,7 @@ describe('Exceptions viewer read only', () => {
|
|||
const exceptionList = getExceptionList();
|
||||
|
||||
before(() => {
|
||||
cy.task('esArchiverResetKibana');
|
||||
cleanKibana();
|
||||
// create rule with exceptions
|
||||
createExceptionList(exceptionList, exceptionList.list_id).then((response) => {
|
||||
createRule(
|
||||
|
@ -56,6 +56,7 @@ describe('Exceptions viewer read only', () => {
|
|||
login(ROLES.reader);
|
||||
visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL, ROLES.reader);
|
||||
goToRuleDetails();
|
||||
cy.url().should('contain', 'app/security/rules/id');
|
||||
goToExceptionsTab();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue