[Security Solution] Unskipping x-pack/test/security_solution_cypress/cypress/e2e/explore/dashboards/ working tests on serverless (#167916)

This commit is contained in:
Gloria Hornero 2023-10-16 16:06:02 +02:00 committed by GitHub
parent 217929a636
commit 3c4a5977a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 94 deletions

View file

@ -20,34 +20,30 @@ import { ENTITY_ANALYTICS_URL } from '../../../urls/navigation';
import { PAGE_TITLE } from '../../../screens/entity_analytics_management';
// FLAKY: https://github.com/elastic/kibana/issues/165644
describe(
'Enable risk scores from dashboard',
{ tags: ['@ess', '@serverless', '@brokenInServerless'] },
() => {
before(() => {
cleanKibana();
login();
});
describe('Enable risk scores from dashboard', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
login();
});
beforeEach(() => {
login();
visit(ENTITY_ANALYTICS_URL);
});
beforeEach(() => {
login();
visit(ENTITY_ANALYTICS_URL);
});
it('host risk enable button should redirect to entity management page', () => {
cy.get(ENABLE_HOST_RISK_SCORE_BUTTON).should('exist');
it('host risk enable button should redirect to entity management page', () => {
cy.get(ENABLE_HOST_RISK_SCORE_BUTTON).should('exist');
clickEnableRiskScore(RiskScoreEntity.host);
clickEnableRiskScore(RiskScoreEntity.host);
cy.get(PAGE_TITLE).should('have.text', 'Entity Risk Score');
});
cy.get(PAGE_TITLE).should('have.text', 'Entity Risk Score');
});
it('user risk enable button should redirect to entity management page', () => {
cy.get(ENABLE_USER_RISK_SCORE_BUTTON).should('exist');
it('user risk enable button should redirect to entity management page', () => {
cy.get(ENABLE_USER_RISK_SCORE_BUTTON).should('exist');
clickEnableRiskScore(RiskScoreEntity.user);
clickEnableRiskScore(RiskScoreEntity.user);
cy.get(PAGE_TITLE).should('have.text', 'Entity Risk Score');
});
}
);
cy.get(PAGE_TITLE).should('have.text', 'Entity Risk Score');
});
});

View file

@ -46,8 +46,8 @@ import { getNewRule } from '../../../objects/rule';
import { clickOnFirstHostsAlerts, clickOnFirstUsersAlerts } from '../../../tasks/risk_scores';
import { OPTION_LIST_LABELS, OPTION_LIST_VALUES } from '../../../screens/common/filter_group';
import { setRowsPerPageTo } from '../../../tasks/table_pagination';
import { clearSearchBar, kqlSearch } from '../../../tasks/security_header';
import { setEndDate, setEndDateNow, updateDates } from '../../../tasks/date_picker';
import { kqlSearch } from '../../../tasks/security_header';
import { setEndDate, updateDates } from '../../../tasks/date_picker';
import {
enableJob,
navigateToNextPage,
@ -62,7 +62,7 @@ const SIEM_KIBANA_HOST_ALERTS = 2;
const SIEM_KIBANA_HOST_NAME = 'siem-kibana';
const END_DATE = 'Jan 19, 2019 @ 20:33:29.186';
describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }, () => {
describe('Entity Analytics Dashboard', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
login();
@ -177,8 +177,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
cy.get(HOSTS_DONUT_CHART).should('include.text', '1Total');
cy.get(HOSTS_TABLE_ROWS).should('have.length', 1);
clearSearchBar();
});
describe('With alerts data', () => {
@ -206,10 +204,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
updateDates();
cy.get(HOSTS_TABLE_ALERT_CELL).first().should('include.text', 0);
// CLEAR DATES
setEndDateNow();
updateDates();
});
it('opens alerts page when alerts count is clicked', () => {
@ -265,8 +259,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
cy.get(USERS_DONUT_CHART).should('include.text', '1Total');
cy.get(USERS_TABLE_ROWS).should('have.length', 1);
clearSearchBar();
});
describe('With alerts data', () => {
@ -294,10 +286,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
updateDates();
cy.get(USERS_TABLE_ALERT_CELL).first().should('include.text', 0);
// CLEAR DATES
setEndDateNow();
updateDates();
});
it('opens alerts page when alerts count is clicked', () => {
@ -398,8 +386,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
cy.get(HOSTS_DONUT_CHART).should('include.text', '1Total');
cy.get(HOSTS_TABLE_ROWS).should('have.length', 1);
clearSearchBar();
});
describe('With alerts data', () => {
@ -427,10 +413,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
updateDates();
cy.get(HOSTS_TABLE_ALERT_CELL).first().should('include.text', 0);
// CLEAR DATES
setEndDateNow();
updateDates();
});
it('opens alerts page when alerts count is clicked', () => {
@ -491,8 +473,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
cy.get(USERS_DONUT_CHART).should('include.text', '1Total');
cy.get(USERS_TABLE_ROWS).should('have.length', 1);
clearSearchBar();
});
describe('With alerts data', () => {
@ -520,10 +500,6 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }
updateDates();
cy.get(USERS_TABLE_ALERT_CELL).first().should('include.text', 0);
// CLEAR DATES
setEndDateNow();
updateDates();
});
it('opens alerts page when alerts count is clicked', () => {

View file

@ -16,7 +16,7 @@ import { PAYWALL_DESCRIPTION } from '../../../screens/entity_analytics_serverles
describe(
'Entity Analytics Dashboard in Serverless',
{
tags: ['@serverless', '@brokenInServerless'],
tags: ['@serverless'],
env: {
ftrConfig: {
productTypes: [

View file

@ -36,8 +36,7 @@ import { deleteRiskEngineConfiguration } from '../../../tasks/api_calls/risk_eng
const spaceId = 'default';
// Flaky on serverless
describe('Upgrade risk scores', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
describe('Upgrade risk scores', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
login();
@ -72,18 +71,15 @@ describe('Upgrade risk scores', { tags: ['@ess', '@serverless', '@brokenInServer
});
describe('upgrade risk engine', () => {
before(() => {
beforeEach(() => {
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
});
beforeEach(() => {
login();
installRiskScoreModule();
visitWithTimeRange(ENTITY_ANALYTICS_URL);
});
after(() => {
afterEach(() => {
cy.task('esArchiverUnload', 'risk_hosts');
cy.task('esArchiverUnload', 'risk_users');
deleteRiskScore({ riskScoreEntity: RiskScoreEntity.host, spaceId });

View file

@ -31,9 +31,9 @@ export const setEndDateNow = (container: string = GLOBAL_FILTERS_CONTAINER) => {
export const setEndDate = (date: string, container: string = GLOBAL_FILTERS_CONTAINER) => {
cy.get(GET_LOCAL_DATE_PICKER_END_DATE_POPOVER_BUTTON(container)).first().click();
cy.get(DATE_PICKER_ABSOLUTE_TAB).first().click();
cy.get(DATE_PICKER_ABSOLUTE_TAB).first().click({ force: true });
cy.get(DATE_PICKER_ABSOLUTE_INPUT).click();
cy.get(DATE_PICKER_ABSOLUTE_INPUT).click({ force: true });
cy.get(DATE_PICKER_ABSOLUTE_INPUT).then(($el) => {
if (Cypress.dom.isAttached($el)) {
cy.wrap($el).click({ force: true });
@ -57,7 +57,7 @@ export const setStartDate = (date: string, container: string = GLOBAL_FILTERS_CO
};
export const updateDates = (container: string = GLOBAL_FILTERS_CONTAINER) => {
cy.get(GET_DATE_PICKER_APPLY_BUTTON(container)).click();
cy.get(GET_DATE_PICKER_APPLY_BUTTON(container)).click({ force: true });
cy.get(GET_DATE_PICKER_APPLY_BUTTON(container)).should('not.have.text', 'Updating');
};

View file

@ -31,10 +31,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_host_risk_score_latest_default",
"rollover_alias": "ml_host_risk_score_latest_default"
},
"mapping": {
"total_fields": {
"limit": "10000"
@ -83,10 +79,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_host_risk_score_default",
"rollover_alias": "ml_host_risk_score_default"
},
"mapping": {
"total_fields": {
"limit": "10000"

View file

@ -31,10 +31,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_host_risk_score_latest_default",
"rollover_alias": "ml_host_risk_score_latest_default"
},
"mapping": {
"total_fields": {
"limit": "10000"
@ -83,10 +79,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_host_risk_score_default",
"rollover_alias": "ml_host_risk_score_default"
},
"mapping": {
"total_fields": {
"limit": "10000"

View file

@ -31,10 +31,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_user_risk_score_latest_default",
"rollover_alias": "ml_user_risk_score_latest_default"
},
"mapping": {
"total_fields": {
"limit": "10000"
@ -83,10 +79,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_user_risk_score_default",
"rollover_alias": "ml_user_risk_score_default"
},
"mapping": {
"total_fields": {
"limit": "10000"

View file

@ -31,10 +31,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_user_risk_score_latest_default",
"rollover_alias": "ml_user_risk_score_latest_default"
},
"mapping": {
"total_fields": {
"limit": "10000"
@ -83,10 +79,6 @@
},
"settings": {
"index": {
"lifecycle": {
"name": "ml_user_risk_score_default",
"rollover_alias": "ml_user_risk_score_default"
},
"mapping": {
"total_fields": {
"limit": "10000"