Skip to content

Commit

Permalink
[WIP] - Unskip threat hunting tests (elastic#195662)
Browse files Browse the repository at this point in the history
1. Added `cypress-network-idle` to better wait for a full page load as a
loading indicator flicker could cause flakiness.

2. List of addressed open issues:

Resolves elastic#191819
Resolves elastic#178367
Resolves elastic#176757
Resolves elastic#176759
Resolves elastic#176758
Resolves elastic#193840
Resolves elastic#182206
Resolves elastic#181977
Resolves elastic#168768
Resolves elastic#168769
Resolves elastic#168770
Resolves elastic#168771
Resolves elastic#168772
Resolves elastic#183104
Resolves elastic#173854

Successful Flaky Test Runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7267

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
michaelolo24 and kibanamachine authored Nov 7, 2024
1 parent 52d7eaf commit 3f236b1
Show file tree
Hide file tree
Showing 26 changed files with 391 additions and 377 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,7 @@
"cypress-axe": "^1.5.0",
"cypress-file-upload": "^5.0.8",
"cypress-multi-reporters": "^1.6.4",
"cypress-network-idle": "^1.14.2",
"cypress-real-events": "^1.11.0",
"cypress-recurse": "^1.35.2",
"date-fns": "^2.29.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const loadDetectionsPage = (role: SecurityRoleName) => {
waitForAlertsToPopulate();
};

// Failing: See https://github.com/elastic/kibana/issues/191819
describe.skip('Alerts timeline', { tags: ['@ess'] }, () => {
describe('Alerts timeline', () => {
beforeEach(() => {
// First we login as a privileged user to create alerts.
deleteAlertsAndRules();
Expand All @@ -36,7 +35,7 @@ describe.skip('Alerts timeline', { tags: ['@ess'] }, () => {
waitForAlertsToPopulate();
});

context('Privileges: read only', () => {
context('Privileges: read only', { tags: ['@ess'] }, () => {
beforeEach(() => {
loadDetectionsPage(ROLES.reader);
});
Expand All @@ -52,7 +51,7 @@ describe.skip('Alerts timeline', { tags: ['@ess'] }, () => {
});
});

context('Privileges: can crud', () => {
context('Privileges: can crud', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
loadDetectionsPage(ROLES.platform_engineer);
cy.get(LOADING_INDICATOR).should('not.exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,72 +21,66 @@ import { visitWithTimeRange } from '../../../tasks/navigation';
import { waitForWelcomePanelToBeLoaded } from '../../../tasks/common';
import { selectDataView } from '../../../tasks/sourcerer';
import { postDataView } from '../../../tasks/api_calls/common';
import { mockRiskEngineEnabled } from '../../../tasks/entity_analytics';

const DATA_VIEW = 'auditbeat-*';

// FLAKY: https://github.com/elastic/kibana/issues/178367
describe.skip(
'Inspect Explore pages',
{ tags: ['@ess', '@serverless', '@skipInServerlessMKI'] },
() => {
before(() => {
// illegal_argument_exception: unknown setting [index.lifecycle.name]
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
describe('Inspect Explore pages', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
// illegal_argument_exception: unknown setting [index.lifecycle.name]
cy.task('esArchiverLoad', { archiveName: 'risk_scores_new' });
login();
mockRiskEngineEnabled();
// Create and select data view
postDataView(DATA_VIEW);
});

login();
// Create and select data view
postDataView(DATA_VIEW);
});

after(() => {
cy.task('esArchiverUnload', { archiveName: 'risk_users' });
cy.task('esArchiverUnload', { archiveName: 'risk_hosts' });
});
afterEach(() => {
cy.task('esArchiverUnload', { archiveName: 'risk_scores_new' });
});

INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => {
/**
* Group all tests of a page into one "it" call to improve speed
*/
it(`inspect ${pageName} page`, () => {
login();
INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => {
/**
* Group all tests of a page into one "it" call to improve speed
*/
it(`inspect ${pageName} page`, () => {
login();

visitWithTimeRange(url, {
visitOptions: {
onLoad: () => {
waitForWelcomePanelToBeLoaded();
selectDataView(DATA_VIEW);
},
visitWithTimeRange(url, {
visitOptions: {
onLoad: () => {
waitForWelcomePanelToBeLoaded();
selectDataView(DATA_VIEW);
},
});

lensVisualizations.forEach((lens) => {
cy.log(`inspects the ${lens.title} visualization`);
openTab(lens.tab);

openLensVisualizationsInspectModal(lens, () => {
cy.get(INSPECT_MODAL).should('be.visible');
cy.get(INSPECT_MODAL_INDEX_PATTERN).should(
'contain.text',
lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW
);
});
});
},
});

tables.forEach((table) => {
cy.log(`inspects the ${table.title}`);
openTab(table.tab);
lensVisualizations.forEach((lens) => {
cy.log(`inspects the ${lens.title} visualization`);
openTab(lens.tab);

openTableInspectModal(table);
openLensVisualizationsInspectModal(lens, () => {
cy.get(INSPECT_MODAL).should('be.visible');
cy.get(INSPECT_MODAL_INDEX_PATTERN).should(
'contain.text',
table.customIndexPattern ? table.customIndexPattern : DATA_VIEW
lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW
);

closesModal();
});
});

tables.forEach((table) => {
cy.log(`inspects the ${table.title}`);
openTab(table.tab);

openTableInspectModal(table);
cy.get(INSPECT_MODAL).should('be.visible');
cy.get(INSPECT_MODAL_INDEX_PATTERN).should(
'contain.text',
table.customIndexPattern ? table.customIndexPattern : DATA_VIEW
);

closesModal();
});
});
}
);
});
});
Loading

0 comments on commit 3f236b1

Please sign in to comment.