diff --git a/x-pack/plugins/security_solution/cypress/e2e/explore/dashboards/entity_analytics.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/explore/dashboards/entity_analytics.cy.ts index a8d2146e4433b..4829a8d939331 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/explore/dashboards/entity_analytics.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/explore/dashboards/entity_analytics.cy.ts @@ -10,7 +10,12 @@ import { login, visit } from '../../../tasks/login'; import { ALERTS_URL, ENTITY_ANALYTICS_URL } from '../../../urls/navigation'; import { esArchiverLoad, esArchiverUnload } from '../../../tasks/es_archiver'; -import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common'; +import { + cleanKibana, + deleteAlertsAndRules, + waitForPageToBeLoaded, + waitForTableToLoad, +} from '../../../tasks/common'; import { ANOMALIES_TABLE, ANOMALIES_TABLE_ROWS, @@ -313,11 +318,15 @@ describe('Entity Analytics Dashboard', () => { beforeEach(() => { login(); visit(ENTITY_ANALYTICS_URL); + waitForPageToBeLoaded(); }); it('renders table with pagination', () => { cy.get(ANOMALIES_TABLE).should('be.visible'); - cy.get(ANOMALIES_TABLE_ROWS).should('have.length', 10); + waitForTableToLoad(); + + // Increase default timeout because anomalies table takes a while to load + cy.get(ANOMALIES_TABLE_ROWS, { timeout: 20000 }).should('have.length', 10); // navigates to next page cy.get(ANOMALIES_TABLE_NEXT_PAGE_BUTTON).click(); diff --git a/x-pack/plugins/security_solution/cypress/e2e/explore/host_details/risk_tab.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/explore/host_details/risk_tab.cy.ts index 6bcb5cd9532ee..a57d49a602c53 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/explore/host_details/risk_tab.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/explore/host_details/risk_tab.cy.ts @@ -7,7 +7,7 @@ import { login, visitHostDetailsPage } from '../../../tasks/login'; -import { cleanKibana } from '../../../tasks/common'; +import { cleanKibana, waitForTableToLoad } from '../../../tasks/common'; import { esArchiverLoad, esArchiverUnload } from '../../../tasks/es_archiver'; import { TABLE_CELL, TABLE_ROWS } from '../../../screens/alerts_details'; @@ -49,8 +49,3 @@ describe('risk tab', () => { ); }); }); - -export const waitForTableToLoad = () => { - cy.get('.euiBasicTable-loading').should('exist'); - cy.get('.euiBasicTable-loading').should('not.exist'); -}; diff --git a/x-pack/plugins/security_solution/cypress/tasks/common.ts b/x-pack/plugins/security_solution/cypress/tasks/common.ts index 1767b70fe33fe..fc6a7096e1814 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/common.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/common.ts @@ -12,6 +12,7 @@ import { LOADING_INDICATOR, LOADING_INDICATOR_HIDDEN, } from '../screens/security_header'; +import { EUI_BASIC_TABLE_LOADING } from '../screens/common/controls'; const primaryButton = 0; @@ -280,3 +281,8 @@ export const waitForWelcomePanelToBeLoaded = () => { cy.get(KIBANA_LOADING_ICON).should('exist'); cy.get(KIBANA_LOADING_ICON).should('not.exist'); }; + +export const waitForTableToLoad = () => { + cy.get(EUI_BASIC_TABLE_LOADING).should('exist'); + cy.get(EUI_BASIC_TABLE_LOADING).should('not.exist'); +};