Skip to content

Commit

Permalink
[Security Solution] Improves detections tests (#77295)
Browse files Browse the repository at this point in the history
* improves 'Creates and activates a new custom rule' test

* fixes constant problem

* improves 'Creates and activates a new custom rule with override option' test

* improves 'Creates and activates a new threshold rule' test

* refactor

* fixes type check issue

* improves assertions

* removes unused code

* changes variables for constants

* improves 'waitForTheRuleToBeExecuted' test

* improves readability

* fixes jenkins error

* refactor

* refactor

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
MadameSheema and elasticmachine authored Sep 29, 2020
1 parent 6f2fd54 commit 7285026
Show file tree
Hide file tree
Showing 19 changed files with 729 additions and 548 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ describe('Alerts', () => {
});
});
});

context('Opening alerts', () => {
beforeEach(() => {
esArchiverLoad('closed_alerts');
Expand Down Expand Up @@ -204,6 +205,7 @@ describe('Alerts', () => {
});
});
});

context('Marking alerts as in-progress', () => {
beforeEach(() => {
esArchiverLoad('alerts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('Alerts detection rules', () => {
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();

cy.get(RULE_NAME)
.eq(FIFTH_RULE)
.invoke('text')
Expand All @@ -56,7 +57,6 @@ describe('Alerts detection rules', () => {
activateRule(SEVENTH_RULE);
waitForRuleToBeActivated();
sortByActivatedRules();

cy.get(RULE_NAME)
.eq(FIRST_RULE)
.invoke('text')
Expand All @@ -70,7 +70,6 @@ describe('Alerts detection rules', () => {
cy.wrap(expectedRulesNames).should('include', seventhRuleName);
});
});

cy.get(RULE_SWITCH).eq(FIRST_RULE).should('have.attr', 'role', 'switch');
cy.get(RULE_SWITCH).eq(SECOND_RULE).should('have.attr', 'role', 'switch');
});
Expand Down
Loading

0 comments on commit 7285026

Please sign in to comment.