Skip to content

Commit

Permalink
fixes CI issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Nov 26, 2020
1 parent 2ef6b65 commit 626c639
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
activatesRule,
addsException,
addsExceptionFromRuleSettings,
deactivatesRule,
goToAlertsTab,
goToExceptionsTab,
removeException,
Expand Down Expand Up @@ -61,6 +62,7 @@ describe('Exceptions', () => {
NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS
);
});
deactivatesRule();
});

afterEach(() => {
Expand All @@ -74,6 +76,7 @@ describe('Exceptions', () => {
goToExceptionsTab();
addsExceptionFromRuleSettings(exception);
esArchiverLoad('auditbeat_for_exceptions2');
activatesRule();
waitForTheRuleToBeExecuted();
goToAlertsTab();
refreshPage();
Expand Down Expand Up @@ -136,6 +139,7 @@ describe('Exceptions', () => {
esArchiverLoad('auditbeat_for_exceptions2');

cy.scrollTo('bottom');
activatesRule();
cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.then((numberOfAlertsAfterCreatingExceptionText) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ import {
} from '../screens/rule_details';

export const activatesRule = () => {
cy.server();
cy.route('PATCH', '**/api/detection_engine/rules/_bulk_update').as('bulk_update');
cy.get(RULE_SWITCH).should('be.visible');
cy.get(RULE_SWITCH).click();
cy.wait('@bulk_update').then((response) => {
cy.wrap(response.status).should('eql', 200);
});
};

export const deactivatesRule = () => {
Expand Down

0 comments on commit 626c639

Please sign in to comment.