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

[7.x] Fixes cypress flake across two tests (#105645) #105700

Closed
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,18 @@ describe('Actions with prebuilt rules', () => {
'have.text',
`Elastic rules (${expectedNumberOfRulesAfterDeletion})`
);
cy.get(RELOAD_PREBUILT_RULES_BTN).should('exist');
cy.get(RELOAD_PREBUILT_RULES_BTN).should('have.text', 'Install 1 Elastic prebuilt rule ');

// Have to add a 5 minute timeout wait as this can timeout on slow CI system
cy.get(RELOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should('exist');
cy.get(RELOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should(
'have.text',
'Install 1 Elastic prebuilt rule '
);

reloadDeletedRules();

cy.get(RELOAD_PREBUILT_RULES_BTN).should('not.exist');
// Have to add a 5 minute timeout wait as this can timeout on slow CI system
cy.get(RELOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should('not.exist');

cy.reload();
changeRowsPerPageTo100();
Expand All @@ -154,8 +160,9 @@ describe('Actions with prebuilt rules', () => {
cy.reload();
changeRowsPerPageTo100();

cy.get(RELOAD_PREBUILT_RULES_BTN).should('exist');
cy.get(RELOAD_PREBUILT_RULES_BTN).should(
// Have to add a 5 minute timeout wait as this can timeout on slow CI system
cy.get(RELOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should('exist');
cy.get(RELOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should(
'have.text',
`Install ${numberOfRulesToBeSelected} Elastic prebuilt rules `
);
Expand All @@ -166,7 +173,8 @@ describe('Actions with prebuilt rules', () => {

reloadDeletedRules();

cy.get(RELOAD_PREBUILT_RULES_BTN).should('not.exist');
// Have to add a 5 minute timeout wait as this can timeout on slow CI system
cy.get(RELOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should('not.exist');

cy.reload();
changeRowsPerPageTo100();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,6 @@ import { populateTimeline } from '../../tasks/timeline';

import { HOSTS_URL } from '../../urls/navigation';

const RowRenderersId = [
'alerts',
'auditd',
'auditd_file',
'library',
'netflow',
'plain',
'registry',
'suricata',
'system',
'system_dns',
'system_endgame_process',
'system_file',
'system_fim',
'system_security_event',
'system_socket',
'threat_match',
'zeek',
];

describe('Row renderers', () => {
beforeEach(() => {
cleanKibana();
Expand Down Expand Up @@ -100,9 +80,5 @@ describe('Row renderers', () => {
.should('not.be.checked');

cy.wait('@updateTimeline').its('response.statusCode').should('eq', 200);

cy.wait('@updateTimeline').then((interception) => {
expect(interception.request.body.timeline.excludedRowRendererIds).to.eql(RowRenderersId);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ export const sortByActivatedRules = () => {

export const waitForRulesTableToBeLoaded = () => {
cy.get(RULES_TABLE_INITIAL_LOADING_INDICATOR).should('exist');
cy.get(RULES_TABLE_INITIAL_LOADING_INDICATOR).should('not.exist');
// Wait up to 5 minutes for the rules to load as in CI containers this can be very slow
cy.get(RULES_TABLE_INITIAL_LOADING_INDICATOR, { timeout: 300000 }).should('not.exist');
};

export const waitForRulesTableToBeRefreshed = () => {
Expand All @@ -204,9 +205,10 @@ export const waitForRulesTableToBeAutoRefreshed = () => {
};

export const waitForPrebuiltDetectionRulesToBeLoaded = () => {
cy.get(LOAD_PREBUILT_RULES_BTN).should('not.exist');
cy.get(RULES_TABLE).should('exist');
cy.get(RULES_TABLE_REFRESH_INDICATOR).should('not.exist');
// Wait up to 5 minutes for the rules to load as in CI containers this can be very slow
cy.get(LOAD_PREBUILT_RULES_BTN, { timeout: 300000 }).should('not.exist');
cy.get(RULES_TABLE, { timeout: 300000 }).should('exist');
cy.get(RULES_TABLE_REFRESH_INDICATOR, { timeout: 300000 }).should('not.exist');
};

export const waitForRuleToChangeStatus = () => {
Expand Down