Skip to content

Commit

Permalink
fixes test flakiness (#63331) (#63349)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Apr 13, 2020
1 parent c8a9bcb commit babdac8
Showing 1 changed file with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ import {
FIFTH_RULE,
FIRST_RULE,
RULE_NAME,
RULE_SWITCH,
SECOND_RULE,
SEVENTH_RULE,
} from '../screens/signal_detection_rules';

import { goToManageSignalDetectionRules } from '../tasks/detections';
import {
goToManageSignalDetectionRules,
waitForSignalsPanelToBeLoaded,
waitForSignalsIndexToBeCreated,
} from '../tasks/detections';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import {
Expand All @@ -32,8 +37,10 @@ describe('Signal detection rules', () => {
esArchiverUnload('prebuilt_rules_loaded');
});

it.skip('Sorts by activated rules', () => {
it('Sorts by activated rules', () => {
loginAndWaitForPageWithoutDateRange(DETECTIONS);
waitForSignalsPanelToBeLoaded();
waitForSignalsIndexToBeCreated();
goToManageSignalDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
cy.get(RULE_NAME)
Expand All @@ -52,10 +59,24 @@ describe('Signal detection rules', () => {

cy.get(RULE_NAME)
.eq(FIRST_RULE)
.should('have.text', fifthRuleName);
cy.get(RULE_NAME)
.invoke('text')
.then(firstRuleName => {
cy.get(RULE_NAME)
.eq(SECOND_RULE)
.invoke('text')
.then(secondRuleName => {
const expectedRulesNames = `${firstRuleName} ${secondRuleName}`;
cy.wrap(expectedRulesNames).should('include', fifthRuleName);
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.text', seventhRuleName);
.should('have.attr', 'role', 'switch');
});
});
});
Expand Down

0 comments on commit babdac8

Please sign in to comment.