Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes flakiness #62406

Merged
merged 3 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ describe('Detections', () => {
});

it('Closes and opens signals', () => {
const SIGNALS_TIMEOUT = 60000;

waitForSignalsPanelToBeLoaded();
waitForSignalsToBeLoaded();

Expand All @@ -60,7 +62,7 @@ describe('Detections', () => {

const expectedNumberOfSignalsAfterClosing = +numberOfSignals - numberOfSignalsToBeClosed;
cy.get(NUMBER_OF_SIGNALS)
.invoke('text')
.invoke('text', { timeout: SIGNALS_TIMEOUT })
.should('eq', expectedNumberOfSignalsAfterClosing.toString());
cy.get(SHOWING_SIGNALS)
.invoke('text')
Expand All @@ -70,7 +72,7 @@ describe('Detections', () => {
waitForSignals();

cy.get(NUMBER_OF_SIGNALS)
.invoke('text')
.invoke('text', { timeout: SIGNALS_TIMEOUT })
.should('eql', numberOfSignalsToBeClosed.toString());
cy.get(SHOWING_SIGNALS)
.invoke('text')
Expand All @@ -94,15 +96,18 @@ describe('Detections', () => {

const expectedNumberOfClosedSignalsAfterOpened = 2;
cy.get(NUMBER_OF_SIGNALS)
.invoke('text')
.invoke('text', { timeout: SIGNALS_TIMEOUT })
.should('eql', expectedNumberOfClosedSignalsAfterOpened.toString());
cy.get(SHOWING_SIGNALS)
.invoke('text')
.should(
'eql',
`Showing ${expectedNumberOfClosedSignalsAfterOpened.toString()} signals`
);
cy.get(SIGNALS).should('have.length', expectedNumberOfClosedSignalsAfterOpened);
cy.get(SIGNALS, { timeout: SIGNALS_TIMEOUT }).should(
'have.length',
expectedNumberOfClosedSignalsAfterOpened
);

goToOpenedSignals();
waitForSignals();
Expand All @@ -114,7 +119,7 @@ describe('Detections', () => {
.should('eql', `Showing ${expectedNumberOfOpenedSignals.toString()} signals`);

cy.get('[data-test-subj="server-side-event-count"]')
.invoke('text')
.invoke('text', { timeout: SIGNALS_TIMEOUT })
.should('eql', expectedNumberOfOpenedSignals.toString());
});
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/siem/cypress/screens/detections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const LOADING_SIGNALS_PANEL = '[data-test-subj="loading-signals-panel"]';

export const MANAGE_SIGNAL_DETECTION_RULES_BTN = '[data-test-subj="manage-signal-detection-rules"]';

export const NUMBER_OF_SIGNALS = '[data-test-subj="server-side-event-count"]';
export const NUMBER_OF_SIGNALS = '[data-test-subj="server-side-event-count"] .euiBadge__text';

export const OPEN_CLOSE_SIGNAL_BTN = '[data-test-subj="update-signal-status-button"]';

Expand Down