Michael Olorunnisola 2024-11-07 11:30:23 -05:00 committed by GitHub
parent 52d7eaf6d7
commit 3f236b1499
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 372 additions and 358 deletions

View file

@ -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",

View file

@ -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();
@ -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);
});
@ -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');

View file

@ -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);
});
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();
// Create and select data view
postDataView(DATA_VIEW);
});
after(() => {
cy.task('esArchiverUnload', { archiveName: 'risk_users' });
cy.task('esArchiverUnload', { archiveName: 'risk_hosts' });
});
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);
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);
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();
});
});
}
);
});
});

View file

@ -88,134 +88,127 @@ import {
THREAT_INTELLIGENCE_PAGE,
} from '../../../screens/kibana_navigation';
// Failing: See https://github.com/elastic/kibana/issues/176757
// Failing: See https://github.com/elastic/kibana/issues/176759
// Failing: See https://github.com/elastic/kibana/issues/176758
describe.skip(
'top-level navigation common to all pages in the Security app',
{ tags: '@ess' },
() => {
beforeEach(() => {
login();
visitWithTimeRange(TIMELINES_URL);
});
describe('top-level navigation common to all pages in the Security app', { tags: '@ess' }, () => {
beforeEach(() => {
login();
visitWithTimeRange(TIMELINES_URL);
});
it('navigates to the Dashboards landing page', () => {
navigateFromHeaderTo(DASHBOARDS);
cy.url().should('include', DASHBOARDS_URL);
});
it('navigates to the Dashboards landing page', () => {
navigateFromHeaderTo(DASHBOARDS);
cy.url().should('include', DASHBOARDS_URL);
});
it('navigates to the Overview page', () => {
navigateFromHeaderTo(OVERVIEW);
cy.url().should('include', OVERVIEW_URL);
});
it('navigates to the Overview page', () => {
navigateFromHeaderTo(OVERVIEW);
cy.url().should('include', OVERVIEW_URL);
});
it('navigates to the Detection & Response page', () => {
navigateFromHeaderTo(DETECTION_RESPONSE);
cy.url().should('include', DETECTION_AND_RESPONSE_URL);
});
it('navigates to the Detection & Response page', () => {
navigateFromHeaderTo(DETECTION_RESPONSE);
cy.url().should('include', DETECTION_AND_RESPONSE_URL);
});
it('navigates to the Entity Analytics page', () => {
navigateFromHeaderTo(ENTITY_ANALYTICS);
cy.url().should('include', ENTITY_ANALYTICS_URL);
});
it('navigates to the Entity Analytics page', () => {
navigateFromHeaderTo(ENTITY_ANALYTICS);
cy.url().should('include', ENTITY_ANALYTICS_URL);
});
it('navigates to the Kubernetes page', () => {
navigateFromHeaderTo(KUBERNETES);
cy.url().should('include', KUBERNETES_URL);
});
it('navigates to the Kubernetes page', () => {
navigateFromHeaderTo(KUBERNETES);
cy.url().should('include', KUBERNETES_URL);
});
it('navigates to the CSP dashboard page', () => {
navigateFromHeaderTo(CSP_DASHBOARD);
cy.url().should('include', CSP_DASHBOARD_URL);
});
it('navigates to the CSP dashboard page', () => {
navigateFromHeaderTo(CSP_DASHBOARD);
cy.url().should('include', CSP_DASHBOARD_URL);
});
it('navigates to the Alerts page', () => {
navigateFromHeaderTo(ALERTS);
cy.url().should('include', ALERTS_URL);
});
it('navigates to the Alerts page', () => {
navigateFromHeaderTo(ALERTS);
cy.url().should('include', ALERTS_URL);
});
it('navigates to the Findings page', () => {
navigateFromHeaderTo(CSP_FINDINGS);
cy.url().should('include', CSP_FINDINGS_URL);
});
it('navigates to the Findings page', () => {
navigateFromHeaderTo(CSP_FINDINGS);
cy.url().should('include', CSP_FINDINGS_URL);
});
it('navigates to the Timelines page', () => {
navigateFromHeaderTo(TIMELINES);
cy.url().should('include', TIMELINES_URL);
});
it('navigates to the Timelines page', () => {
navigateFromHeaderTo(TIMELINES);
cy.url().should('include', TIMELINES_URL);
});
it('navigates to the Explore landing page', () => {
navigateFromHeaderTo(EXPLORE);
cy.url().should('include', EXPLORE_URL);
});
it('navigates to the Explore landing page', () => {
navigateFromHeaderTo(EXPLORE);
cy.url().should('include', EXPLORE_URL);
});
it('navigates to the Hosts page', () => {
navigateFromHeaderTo(HOSTS);
cy.url().should('include', HOSTS_URL);
});
it('navigates to the Hosts page', () => {
navigateFromHeaderTo(HOSTS);
cy.url().should('include', HOSTS_URL);
});
it('navigates to the Network page', () => {
navigateFromHeaderTo(NETWORK);
cy.url().should('include', NETWORK_URL);
});
it('navigates to the Network page', () => {
navigateFromHeaderTo(NETWORK);
cy.url().should('include', NETWORK_URL);
});
it('navigates to the Users page', () => {
navigateFromHeaderTo(USERS);
cy.url().should('include', USERS_URL);
});
it('navigates to the Users page', () => {
navigateFromHeaderTo(USERS);
cy.url().should('include', USERS_URL);
});
it('navigates to the Indicators page', () => {
navigateFromHeaderTo(INDICATORS);
cy.url().should('include', INDICATORS_URL);
});
it('navigates to the Indicators page', () => {
navigateFromHeaderTo(INDICATORS);
cy.url().should('include', INDICATORS_URL);
});
it('navigates to the Rules page', () => {
navigateFromHeaderTo(RULES);
cy.url().should('include', RULES_MANAGEMENT_URL);
});
it('navigates to the Rules page', () => {
navigateFromHeaderTo(RULES);
cy.url().should('include', RULES_MANAGEMENT_URL);
});
it('navigates to the Exceptions page', () => {
navigateFromHeaderTo(EXCEPTIONS);
cy.url().should('include', EXCEPTIONS_URL);
});
it('navigates to the Exceptions page', () => {
navigateFromHeaderTo(EXCEPTIONS);
cy.url().should('include', EXCEPTIONS_URL);
});
it('navigates to the Cases page', () => {
navigateFromHeaderTo(CASES);
cy.url().should('include', CASES_URL);
});
it('navigates to the Cases page', () => {
navigateFromHeaderTo(CASES);
cy.url().should('include', CASES_URL);
});
it('navigates to the Manage landing page', () => {
navigateFromHeaderTo(SETTINGS);
cy.url().should('include', MANAGE_URL);
});
it('navigates to the Manage landing page', () => {
navigateFromHeaderTo(SETTINGS);
cy.url().should('include', MANAGE_URL);
});
it('navigates to the Endpoints page', () => {
navigateFromHeaderTo(ENDPOINTS);
cy.url().should('include', ENDPOINTS_URL);
});
it('navigates to the Policies page', () => {
navigateFromHeaderTo(POLICIES);
cy.url().should('include', POLICIES_URL);
});
it('navigates to the Trusted Apps page', () => {
navigateFromHeaderTo(TRUSTED_APPS);
cy.url().should('include', TRUSTED_APPS_URL);
});
it('navigates to the Event Filters page', () => {
navigateFromHeaderTo(EVENT_FILTERS);
cy.url().should('include', EVENT_FILTERS_URL);
});
it('navigates to the Blocklist page', () => {
navigateFromHeaderTo(BLOCKLIST);
cy.url().should('include', BLOCKLIST_URL);
});
it('navigates to the CSP Benchmarks page', () => {
navigateFromHeaderTo(CSP_BENCHMARKS);
cy.url().should('include', CSP_BENCHMARKS_URL);
});
}
);
it('navigates to the Endpoints page', () => {
navigateFromHeaderTo(ENDPOINTS);
cy.url().should('include', ENDPOINTS_URL);
});
it('navigates to the Policies page', () => {
navigateFromHeaderTo(POLICIES);
cy.url().should('include', POLICIES_URL);
});
it('navigates to the Trusted Apps page', () => {
navigateFromHeaderTo(TRUSTED_APPS);
cy.url().should('include', TRUSTED_APPS_URL);
});
it('navigates to the Event Filters page', () => {
navigateFromHeaderTo(EVENT_FILTERS);
cy.url().should('include', EVENT_FILTERS_URL);
});
it('navigates to the Blocklist page', () => {
navigateFromHeaderTo(BLOCKLIST);
cy.url().should('include', BLOCKLIST_URL);
});
it('navigates to the CSP Benchmarks page', () => {
navigateFromHeaderTo(CSP_BENCHMARKS);
cy.url().should('include', CSP_BENCHMARKS_URL);
});
});
describe('Kibana navigation to all pages in the Security app ', { tags: '@ess' }, () => {
beforeEach(() => {

View file

@ -15,7 +15,7 @@ import { login } from '../../../tasks/login';
import { visitWithTimeRange } from '../../../tasks/navigation';
import { ALERTS_URL } from '../../../urls/navigation';
describe.skip('Alerts Table Action column', { tags: ['@ess', '@serverless'] }, () => {
describe('Alerts Table Action column', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverLoad', {
archiveName: 'process_ancestry',

View file

@ -6,6 +6,7 @@
*/
import {
openDataGridColumnActions,
switchAlertTableToEventRenderedView,
switchAlertTableToGridView,
waitForAlerts,
@ -24,7 +25,6 @@ import {
DATA_GRID_COLUMN_ORDER_BTN,
DATA_GRID_FIELDS,
DATA_GRID_FULL_SCREEN,
GET_DATA_GRID_HEADER,
GET_DATA_GRID_HEADER_CELL_ACTION_GROUP,
} from '../../../screens/common/data_grid';
import { createRule } from '../../../tasks/api_calls/rules';
@ -42,7 +42,7 @@ import { DATAGRID_HEADER } from '../../../screens/timeline';
*
* */
describe.skip(`Alert Table Controls`, { tags: ['@ess', '@serverless'] }, () => {
describe(`Alert Table Controls`, { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
deleteAlertsAndRules();
login();
@ -66,7 +66,7 @@ describe.skip(`Alert Table Controls`, { tags: ['@ess', '@serverless'] }, () => {
cy.log('Date Column');
const timestampField = DATA_GRID_FIELDS.TIMESTAMP.fieldName;
cy.get(GET_DATA_GRID_HEADER(timestampField)).trigger('click');
openDataGridColumnActions(timestampField);
cy.get(GET_DATA_GRID_HEADER_CELL_ACTION_GROUP(timestampField))
.should('be.visible')
.should('contain.text', 'Sort Old-New');
@ -74,7 +74,7 @@ describe.skip(`Alert Table Controls`, { tags: ['@ess', '@serverless'] }, () => {
cy.log('Number column');
const riskScoreField = DATA_GRID_FIELDS.RISK_SCORE.fieldName;
cy.get(GET_DATA_GRID_HEADER(riskScoreField)).trigger('click');
openDataGridColumnActions(riskScoreField);
cy.get(GET_DATA_GRID_HEADER_CELL_ACTION_GROUP(riskScoreField))
.should('be.visible')
.should('contain.text', 'Sort Low-High');
@ -82,7 +82,7 @@ describe.skip(`Alert Table Controls`, { tags: ['@ess', '@serverless'] }, () => {
cy.log('Text Column');
const ruleField = DATA_GRID_FIELDS.RULE.fieldName;
cy.get(GET_DATA_GRID_HEADER(ruleField)).trigger('click');
openDataGridColumnActions(ruleField);
cy.get(GET_DATA_GRID_HEADER_CELL_ACTION_GROUP(ruleField))
.should('be.visible')
.should('contain.text', 'Sort A-Z');

View file

@ -16,7 +16,7 @@ import {
} from '../../../screens/timeline';
import {
scrollAlertTableColumnIntoView,
scrollAlertTableColumnIntoViewAndTest,
addAlertPropertyToTimeline,
filterForAlertProperty,
showTopNAlertProperty,
@ -29,17 +29,16 @@ import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule';
import { login } from '../../../tasks/login';
import { visit } from '../../../tasks/navigation';
import {
removeKqlFilter,
fillAddFilterForm,
fillKqlQueryBar,
openAddFilterPopover,
removeKqlFilter,
} from '../../../tasks/search_bar';
import { openActiveTimeline } from '../../../tasks/timeline';
import { ALERTS_URL } from '../../../urls/navigation';
// Failing: See https://github.com/elastic/kibana/issues/193840
describe.skip('Alerts cell actions', { tags: ['@ess', '@serverless'] }, () => {
describe('Alerts cell actions', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
deleteAlertsAndRules();
createRule(getNewRule());
@ -48,96 +47,102 @@ describe.skip('Alerts cell actions', { tags: ['@ess', '@serverless'] }, () => {
waitForAlertsToPopulate();
});
it('should filter for and out', () => {
cy.log('should work for a non-empty property');
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_HEADER);
filterForAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', `kibana.alert.severity: ${severityVal}`);
});
removeKqlFilter();
it('should filter in and out existing values', () => {
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
filterForAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', `kibana.alert.severity: ${severityVal}`);
});
removeKqlFilter();
});
cy.log('should work for empty properties');
// add query condition to make sure the field is empty
fillKqlQueryBar('not file.name: *{enter}');
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
cy.log('filter for alert property');
cy.log('filter for alert property');
filterForAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
filterForAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', 'NOT file.name: exists');
cy.get(FILTER_BADGE).first().should('have.text', 'NOT file.name: exists');
removeKqlFilter();
});
cy.log('filter out alert property');
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
filterOutAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', 'file.name: exists');
removeKqlFilter();
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_HEADER);
cy.log('should allow copy paste');
cy.window().then((win) => {
cy.stub(win, 'prompt').returns('DISABLED WINDOW PROMPT');
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
cy.get(ALERT_TABLE_FILE_NAME_VALUES)
.first()
.then(() => {
filterOutAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0);
cy.get(FILTER_BADGE).first().should('have.text', 'file.name: exists');
});
removeKqlFilter();
});
clickExpandActions(ALERT_TABLE_SEVERITY_VALUES, 0);
// We are not able to test the "copy to clipboard" action execution
// due to browsers security limitation accessing the clipboard services.
// We assume external `copy` library works
cy.get(CELL_COPY_BUTTON).should('exist');
cy.log('should filter out a non-empty property');
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_HEADER);
filterOutAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE)
.first()
.should('have.text', `NOT kibana.alert.severity: ${severityVal}`);
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
filterOutAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE)
.first()
.should('have.text', `NOT kibana.alert.severity: ${severityVal}`);
});
});
});
it('should allow copy paste', () => {
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.window().then((win) => {
cy.stub(win, 'prompt').returns('DISABLED WINDOW PROMPT');
});
clickExpandActions(ALERT_TABLE_SEVERITY_VALUES, 0);
// We are not able to test the "copy to clipboard" action execution
// due to browsers security limitation accessing the clipboard services.
// We assume external `copy` library works
cy.get(CELL_COPY_BUTTON).should('exist');
});
});
it('should add a non-empty property to default timeline', () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_HEADER);
addAlertPropertyToTimeline(ALERT_TABLE_SEVERITY_VALUES, 0);
openActiveTimeline();
cy.get(PROVIDER_BADGE)
.first()
.should('have.text', `kibana.alert.severity: "${severityVal}"`);
});
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES)
.first()
.invoke('text')
.then((severityVal) => {
addAlertPropertyToTimeline(ALERT_TABLE_SEVERITY_VALUES, 0);
openActiveTimeline();
cy.get(PROVIDER_BADGE)
.first()
.should('have.text', `kibana.alert.severity: "${severityVal}"`);
});
});
});
it('should add an empty property to default timeline', () => {
// add condition to make sure the field is empty
openAddFilterPopover();
fillAddFilterForm({ key: 'file.name', operator: 'does not exist' });
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
addAlertPropertyToTimeline(ALERT_TABLE_FILE_NAME_VALUES, 0);
openActiveTimeline();
cy.get(PROVIDER_BADGE).first().should('have.text', 'NOT file.name exists');
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_FILE_NAME_HEADER, () => {
addAlertPropertyToTimeline(ALERT_TABLE_FILE_NAME_VALUES, 0);
openActiveTimeline();
cy.get(PROVIDER_BADGE).first().should('have.text', 'NOT file.name exists');
});
});
it('should show top for a property', () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES);
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_HEADER);
showTopNAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(SHOW_TOP_N_HEADER).first().should('have.text', `Top kibana.alert.severity`);
it('should show top N for a property', () => {
scrollAlertTableColumnIntoViewAndTest(ALERT_TABLE_SEVERITY_HEADER, () => {
cy.get(ALERT_TABLE_SEVERITY_VALUES);
showTopNAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(SHOW_TOP_N_HEADER).first().should('have.text', `Top kibana.alert.severity`);
});
});
});

View file

@ -39,9 +39,7 @@ import { visit } from '../../../tasks/navigation';
import { ALERTS_URL } from '../../../urls/navigation';
// Iusse tracked in: https://github.com/elastic/kibana/issues/167809
// FLAKY: https://github.com/elastic/kibana/issues/182206
describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] }, () => {
describe('Changing alert status', () => {
before(() => {
cy.task('esArchiverLoad', { archiveName: 'auditbeat_multiple' });
});
@ -50,7 +48,7 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
cy.task('esArchiverUnload', { archiveName: 'auditbeat_multiple' });
});
context('Opening alerts', () => {
context('Opening alerts', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
createRule(getNewRule());
@ -64,7 +62,7 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
selectAlertsCountTable();
});
it.skip('Open one alert when more than one closed alerts are selected', () => {
it('Open one alert when more than one closed alerts are selected', () => {
waitForAlertsToPopulate();
cy.get(ALERTS_COUNT)
.invoke('text')
@ -119,7 +117,7 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
});
});
});
context('Marking alerts as acknowledged', () => {
context('Marking alerts as acknowledged', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
deleteAlertsAndRules();
@ -159,8 +157,7 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
});
});
});
// FLAKY: https://github.com/elastic/kibana/issues/173597
context.skip('Closing alerts', () => {
context('Closing alerts', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
deleteAlertsAndRules();
@ -169,7 +166,7 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
waitForAlertsToPopulate();
selectAlertsCountTable();
});
it.skip('Closes and opens alerts', () => {
it('Closes and opens alerts', () => {
const numberOfAlertsToBeClosed = 3;
cy.get(ALERTS_COUNT)
.invoke('text')
@ -311,12 +308,11 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
});
});
});
context('Changing alert status with read only role', () => {
context.only('Changing alert status with read only role', { tags: ['@ess'] }, () => {
beforeEach(() => {
login(ROLES.t2_analyst);
deleteAlertsAndRules();
createRule(getNewRule());
login(ROLES.reader);
visit(ALERTS_URL);
waitForAlertsToPopulate();
selectAlertsCountTable();
@ -334,6 +330,7 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
cy.get(TAKE_ACTION_POPOVER_BTN).should('exist');
markAcknowledgedFirstAlert();
waitForAlerts();
cy.get(ALERTS_COUNT).should('have.text', `${numberOfAlerts} alerts`); // user with read only role cannot mark alerts as acknowledged
sumAlertCountFromAlertCountTable((sumAlerts) => {
@ -362,10 +359,10 @@ describe.skip('Changing alert status', { tags: ['@ess', '@skipInServerless'] },
closeAlerts();
waitForAlerts();
cy.get(ALERTS_COUNT).should('have.text', `${numberOfAlerts} alerts`); // user with read only role cannot mark alerts as acknowledged
cy.get(ALERTS_COUNT).should('have.text', `${numberOfAlertsToBeClosed} alerts`); // user with read only role cannot mark alerts as acknowledged
sumAlertCountFromAlertCountTable((sumAlerts) => {
expect(sumAlerts).to.eq(parseAlertsCountToInt(numberOfAlerts));
expect(sumAlerts).to.eq(parseAlertsCountToInt(numberOfAlertsToBeClosed));
});
});
});

View file

@ -104,8 +104,7 @@ const assertFilterControlsWithFilterObject = (
});
};
// FLAKY: https://github.com/elastic/kibana/issues/167914
describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, () => {
describe(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
deleteAlertsAndRules();
createRule(getNewRule());
@ -119,7 +118,8 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, ()
});
context('Alert Page Filters Customization ', () => {
it('should be able to customize Controls', () => {
// FLAKY: https://github.com/elastic/kibana/issues/167914
it.skip('should be able to customize Controls', () => {
const fieldName = 'event.module';
const label = 'EventModule';
switchFilterGroupControlsToEditMode();
@ -217,8 +217,7 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, ()
cy.get(FILTER_GROUP_CHANGED_BANNER).should('be.visible');
});
// Flaky: https://github.com/elastic/kibana/issues/181977
context.skip('with data modification', () => {
context('with data modification', () => {
/*
*
* default scrollBehavior is true, which scrolls the element into view automatically without any scroll Margin
@ -237,15 +236,14 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, ()
// mark status of one alert to be acknowledged
cy.get(ALERTS_COUNT)
.invoke('text')
.then((noOfAlerts) => {
const originalAlertCount = noOfAlerts.split(' ')[0];
.then(() => {
markAcknowledgedFirstAlert();
waitForAlerts();
selectPageFilterValue(0, 'acknowledged');
cy.get(ALERTS_COUNT)
.invoke('text')
.should((newAlertCount) => {
expect(newAlertCount.split(' ')[0]).eq(String(parseInt(originalAlertCount, 10)));
expect(newAlertCount.split(' ')[0]).eq('1');
});
});
}
@ -315,7 +313,7 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, ()
});
context('Impact of inputs', () => {
it('should recover from invalid kql Query result', () => {
it('should recover from invalid kql query result', () => {
// do an invalid search
kqlSearch('\\');
refreshPage();

View file

@ -33,8 +33,7 @@ import {
XY_CHART,
} from '../../../screens/shared';
// skipping as this test is also failing on main (see https://github.com/elastic/security-team/issues/10874)
describe.skip(`Event Rendered View`, { tags: ['@ess', '@serverless'] }, () => {
describe(`Event Rendered View`, { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
createRule(getNewRule());
@ -44,12 +43,16 @@ describe.skip(`Event Rendered View`, { tags: ['@ess', '@serverless'] }, () => {
waitForAlerts();
});
it('should show Event Summary column correctly', () => {
// skipping as this test is also failing on main (see https://github.com/elastic/security-team/issues/10874)
// Looks like the height of the new table isn't being properly calculated. Making the table full screen shows the rows appropriately
it.skip('should show Event Summary column correctly', () => {
cy.get(EVENT_SUMMARY_COLUMN).should('be.visible');
cy.get(EVENT_SUMMARY_ALERT_RENDERER_CONTENT).should('be.visible');
});
it('should show TopN in Event Summary column', () => {
// skipping as this test is also failing on main (see https://github.com/elastic/security-team/issues/10874)
// Looks like the height of the new table isn't being properly calculated. Making the table full screen shows the rows appropriately
it.skip('should show TopN in Event Summary column', () => {
showHoverActionsEventRenderedView(ALERT_RENDERER_HOST_NAME);
cy.get(HOVER_ACTIONS.SHOW_TOP).trigger('click');
cy.get(TOP_N_ALERT_HISTOGRAM).should('be.visible');

View file

@ -18,7 +18,7 @@ import { visitWithTimeRange } from '../../../tasks/navigation';
import { ALERTS_URL } from '../../../urls/navigation';
import { deleteAlertsAndRules } from '../../../tasks/api_calls/common';
describe.skip('Analyze events view for alerts', { tags: ['@ess', '@serverless'] }, () => {
describe('Analyze events view for alerts', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
deleteAlertsAndRules();
createRule(getNewRule());

View file

@ -43,13 +43,7 @@ import { ALERTS_URL, DASHBOARDS_URL, DETECTION_AND_RESPONSE_URL } from '../../..
const TEST_USER_NAME = 'test';
const SIEM_KIBANA_HOST_NAME = 'siem-kibana';
// Failing: See https://github.com/elastic/kibana/issues/177761
// FLAKY: https://github.com/elastic/kibana/issues/168768
// FLAKY: https://github.com/elastic/kibana/issues/168769
// FLAKY: https://github.com/elastic/kibana/issues/168770
// FLAKY: https://github.com/elastic/kibana/issues/168771
// FLAKY: https://github.com/elastic/kibana/issues/168772
describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () => {
describe('Detection response view', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverLoad', { archiveName: 'auditbeat_multiple' });
});
@ -185,9 +179,9 @@ describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () =
cy.get(ALERTS_COUNT).should('be.visible').should('have.text', `${alertCount} alerts`);
cy.get(CONTROL_FRAMES).should('have.length', 2);
cy.get(OPTION_LIST_LABELS).eq(0).should('have.text', `Status`);
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open1');
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open 1');
cy.get(OPTION_LIST_LABELS).eq(1).should('have.text', `Host name`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${hostName}1`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${hostName} 1`);
});
});
});
@ -210,11 +204,11 @@ describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () =
cy.get(ALERTS_COUNT).should('be.visible').should('have.text', `${alertCount} alerts`);
cy.get(CONTROL_FRAMES).should('have.length', 3);
cy.get(OPTION_LIST_LABELS).eq(0).should('have.text', `Status`);
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open1');
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open 1');
cy.get(OPTION_LIST_LABELS).eq(1).should('have.text', 'Host name');
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${hostName}1`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${hostName} 1`);
cy.get(OPTION_LIST_LABELS).eq(2).should('have.text', 'Severity');
cy.get(OPTION_LIST_VALUES(2)).should('have.text', `${severityVal}1`);
cy.get(OPTION_LIST_VALUES(2)).should('have.text', `${severityVal} 1`);
});
});
});
@ -239,9 +233,9 @@ describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () =
cy.get(ALERTS_COUNT).should('be.visible').should('have.text', `${alertCount} alert`);
cy.get(CONTROL_FRAMES).should('have.length', 2);
cy.get(OPTION_LIST_LABELS).eq(0).should('have.text', `Status`);
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open1');
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open 1');
cy.get(OPTION_LIST_LABELS).eq(1).should('have.text', `Username`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${userName}1`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${userName} 1`);
});
});
});
@ -264,11 +258,11 @@ describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () =
cy.get(ALERTS_COUNT).should('be.visible').should('have.text', `${alertCount} alert`);
cy.get(CONTROL_FRAMES).should('have.length', 3);
cy.get(OPTION_LIST_LABELS).eq(0).should('have.text', `Status`);
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open1');
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open 1');
cy.get(OPTION_LIST_LABELS).eq(1).should('have.text', 'Username');
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${userName}1`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${userName} 1`);
cy.get(OPTION_LIST_LABELS).eq(2).should('have.text', 'Severity');
cy.get(OPTION_LIST_VALUES(2)).should('have.text', `${severityVal}1`);
cy.get(OPTION_LIST_VALUES(2)).should('have.text', `${severityVal} 1`);
});
});
});
@ -289,9 +283,9 @@ describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () =
cy.get(ALERTS_COUNT).should('be.visible').should('have.text', `${alertCount} alerts`);
cy.get(CONTROL_FRAMES).should('have.length', 2);
cy.get(OPTION_LIST_LABELS).eq(0).should('have.text', `Status`);
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open1');
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open 1');
cy.get(OPTION_LIST_LABELS).eq(1).should('have.text', 'Rule name');
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${ruleName}1`);
cy.get(OPTION_LIST_VALUES(1)).should('have.text', `${ruleName} 1`);
});
});
});
@ -301,7 +295,7 @@ describe.skip('Detection response view', { tags: ['@ess', '@serverless'] }, () =
waitForAlerts();
cy.get(CONTROL_FRAMES).should('have.length', 1);
cy.get(OPTION_LIST_LABELS).eq(0).should('have.text', `Status`);
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open1');
cy.get(OPTION_LIST_VALUES(0)).should('have.text', 'open 1');
});
});
});

View file

@ -203,6 +203,8 @@ export const EVENT_SUMMARY_ALERT_RENDERER_CONTENT = '[data-test-subj="alertRende
export const ALERT_TABLE_EVENT_RENDERED_VIEW_OPTION = '[data-test-subj="eventRenderedView"]';
export const ALERT_TABLE_SUMMARY_VIEW_SELECTOR = '[data-test-subj="summary-view-selector"]';
export const ALERT_RENDERER_HOST_NAME =
'[data-test-subj="alertFieldBadge"] [data-test-subj="render-content-host.name"]';

View file

@ -9,6 +9,10 @@ export const GET_DATA_GRID_HEADER = (fieldName: string) => {
return `[data-test-subj="dataGridHeaderCell-${fieldName}"]`;
};
export const GET_DATA_GRID_HEADER_ACTION_BUTTON = (fieldName: string) => {
return `[data-test-subj="dataGridHeaderCellActionButton-${fieldName}"]`;
};
export const DATA_GRID_FIELDS = {
TIMESTAMP: {
fieldName: '@timestamp',

View file

@ -12,7 +12,7 @@ export const CONTROL_FRAMES = '[data-test-subj="control-frame"]';
export const CONTROL_FRAME_TITLE = '[data-test-subj="control-frame-title"]';
export const OPTION_LIST_LABELS = '.controlFrame__labelToolTip';
export const OPTION_LIST_LABELS = '.controlPanel--label';
export const OPTION_LIST_VALUES = (idx: number) => `[data-test-subj="optionsList-control-${idx}"]`;
@ -63,7 +63,7 @@ export const FILTER_GROUP_EDIT_CONTROL_PANEL_ITEMS = {
CANCEL: getDataTestSubjectSelector('control-editor-cancel'),
FILTER_FIELD_TYPE: getDataTestSubjectSelector('toggleFieldFilterButton'),
FIELD_TYPES: {
STRING: getDataTestSubjectSelector('typeFilter-string'),
STRING: getDataTestSubjectSelector('typeFilter-keyword'),
BOOLEAN: getDataTestSubjectSelector('typeFilter-boolean'),
IP: getDataTestSubjectSelector('typeFilter-ip'),
NUMBER: getDataTestSubjectSelector('typeFilter-number'),

View file

@ -10,3 +10,5 @@ export const CREATE_FIELD_BUTTON = '[data-test-subj="create-field"]';
export const RUNTIME_FIELD_INPUT = '.indexPatternFieldEditorMaskOverlay [data-test-subj="input"]';
export const SAVE_FIELD_BUTTON = '[data-test-subj="fieldSaveButton"]';
export const TIMELINE_CREATE_FIELD_BUTTON = '[data-test-subj="dataView-add-field_btn"]';

View file

@ -11,4 +11,4 @@ export const ALL_HOSTS_TAB = '[data-test-subj="navigation-allHosts"]';
export const HOSTS_NAMES = '[data-test-subj="cellActions-renderContent-host.name"] a.euiLink';
export const UNIQUE_IPS_VISUALIZATIONS = '[data-test-subj="stat-uniqueIps"]';
export const UNIQUE_IPS_VISUALIZATIONS = '[data-test-subj="uniqueIps"]';

View file

@ -9,4 +9,4 @@ export const PROCESS_NAME_FIELD = '[data-test-subj="cellActions-renderContent-pr
export const UNCOMMON_PROCESSES_TABLE = '[data-test-subj="table-uncommonProcesses-loading-false"]';
export const HOSTS_VISUALIZATION = '[data-test-subj="stat-hosts"]';
export const HOSTS_VISUALIZATION = '[data-test-subj="hosts"]';

View file

@ -8,7 +8,6 @@
import { hostsUrl, networkUrl, usersUrl } from '../urls/navigation';
import { EVENT_CONTAINER_TABLE_NOT_LOADING } from './alerts';
import { ALL_HOSTS_TAB, ALL_HOSTS_TABLE, UNIQUE_IPS_VISUALIZATIONS } from './hosts/all_hosts';
import { HOST_BY_RISK_TABLE, RISK_DETAILS_NAV } from './hosts/host_risk';
import { UNCOMMON_PROCESSES_TAB } from './hosts/main';
import { HOSTS_VISUALIZATION, UNCOMMON_PROCESSES_TABLE } from './hosts/uncommon_processes';
import {
@ -31,11 +30,12 @@ import {
USERS_VISUALIZATION,
} from './users/all_users';
import { AUTHENTICATIONS_TAB, AUTHENTICATIONS_TABLE } from './users/user_authentications';
import { EVENTS_HISTOGRAM, EVENTS_TAB } from './users/user_events';
import { EVENTS_TAB } from './users/user_events';
import { HTTP_TAB, HTTP_TABLE } from './network/http';
import { TLS_TAB, TLS_TABLE } from './network/tls';
import { RISK_SCORE_TAB, RISK_SCORE_TAB_CONTENT } from './users/user_risk_score';
import { getDataTestSubjectSelector } from '../helpers/common';
import { HOST_BY_RISK_TABLE, RISK_DETAILS_NAV } from './hosts/host_risk';
import { RISK_SCORE_TAB, RISK_SCORE_TAB_CONTENT } from './users/user_risk_score';
export const INSPECT_BUTTON_ICON = '[data-test-subj="inspect-icon-button"]';
export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]';
@ -93,7 +93,7 @@ export const INSPECT_BUTTONS_IN_SECURITY: InspectButtonMetadata[] = [
{
title: 'Host risk',
tab: RISK_DETAILS_NAV,
customIndexPattern: 'ml_host_risk_score_latest_default',
customIndexPattern: 'risk-score.risk-score-latest-default',
id: HOST_BY_RISK_TABLE,
},
],
@ -242,33 +242,33 @@ export const INSPECT_BUTTONS_IN_SECURITY: InspectButtonMetadata[] = [
{
title: 'User authentications',
panelSelector: AUTHENTICATION_VISUALIZATION,
embeddableId: 'usersKpiAuthenticationsQuery-authenticationsSuccess-metric-embeddable',
embeddableId: 'usersKpiAuthentications-authenticationsSuccess-metric-embeddable',
tab: ALL_USERS_TAB,
},
{
title: 'User authentications',
panelSelector: AUTHENTICATION_VISUALIZATION,
embeddableId: 'usersKpiAuthenticationsQuery-authenticationsFailure-metric-embeddable',
embeddableId: 'usersKpiAuthentications-authenticationsFailure-metric-embeddable',
tab: ALL_USERS_TAB,
},
{
title: 'User authentications',
panelSelector: AUTHENTICATION_VISUALIZATION,
embeddableId: 'usersKpiAuthenticationsQuery-bar-embeddable',
embeddableId: 'usersKpiAuthentications-bar-embeddable',
tab: ALL_USERS_TAB,
},
{
title: 'User authentications',
panelSelector: AUTHENTICATION_VISUALIZATION,
embeddableId: 'usersKpiAuthenticationsQuery-area-embeddable',
embeddableId: 'usersKpiAuthentications-area-embeddable',
tab: ALL_USERS_TAB,
},
{
title: 'Events',
panelSelector: EVENTS_HISTOGRAM,
embeddableId: 'alertsOrEventsHistogramQuery-embeddable',
tab: EVENTS_TAB,
},
// {
// title: 'Events',
// panelSelector: EVENTS_HISTOGRAM,
// embeddableId: 'alertsOrEventsHistogramQuery-embeddable',
// tab: EVENTS_TAB,
// },
],
tables: [
{
@ -290,7 +290,7 @@ export const INSPECT_BUTTONS_IN_SECURITY: InspectButtonMetadata[] = [
title: 'User risk',
tab: RISK_SCORE_TAB,
id: RISK_SCORE_TAB_CONTENT,
customIndexPattern: 'ml_user_risk_score_latest_default',
customIndexPattern: 'risk-score.risk-score-latest-default',
},
],
},

View file

@ -29,13 +29,13 @@ export const OVERFLOW_ITEM =
export const NETWORK_FLOW_TAB = '[data-test-subj="navigation-flows"]';
export const NETWORK_EVENTS_VISUALIZATION = '[data-test-subj="stat-networkEvents"]';
export const NETWORK_EVENTS_VISUALIZATION = '[data-test-subj="networkEvents"]';
export const NETWORK_DNS_VISUALIZATION = '[data-test-subj="stat-dnsQueries"]';
export const NETWORK_DNS_VISUALIZATION = '[data-test-subj="dnsQueries"]';
export const NETWORK_UNIQUE_FLOW_VISUALIZATION = '[data-test-subj="stat-uniqueFlowId"]';
export const NETWORK_UNIQUE_FLOW_VISUALIZATION = '[data-test-subj="uniqueFlowId"]';
export const NETWORK_TLS_HANDSHAKE_VISUALIZATION = '[data-test-subj="stat-tlsHandshakes"]';
export const NETWORK_TLS_HANDSHAKE_VISUALIZATION = '[data-test-subj="tlsHandshakes"]';
export const NETWORK_DESTINATION_IPS_TABLE =
'[data-test-subj="table-topNFlowDestination-loading-false"]';

View file

@ -11,6 +11,6 @@ export const HEADER_SUBTITLE = '[data-test-subj="header-panel-subtitle"]';
export const ALL_USERS_TAB = '[data-test-subj="navigation-allUsers"]';
export const USERS_VISUALIZATION = '[data-test-subj="stat-users"]';
export const USERS_VISUALIZATION = '[data-test-subj="users"]';
export const AUTHENTICATION_VISUALIZATION = '[data-test-subj="stat-authentication"]';
export const AUTHENTICATION_VISUALIZATION = '[data-test-subj="authentication"]';

View file

@ -7,6 +7,7 @@
import { encode } from '@kbn/rison';
import { recurse } from 'cypress-recurse';
import 'cypress-network-idle';
import { formatPageFilterSearchParam } from '@kbn/security-solution-plugin/common/utils/format_page_filter_search_param';
import type { FilterControlConfig } from '@kbn/alerts-ui-shared';
import {
@ -80,6 +81,7 @@ import { ALERTS_URL } from '../urls/navigation';
import { FIELDS_BROWSER_BTN } from '../screens/rule_details';
import { openFilterGroupContextMenu } from './common/filter_group';
import { visitWithTimeRange } from './navigation';
import { GET_DATA_GRID_HEADER_ACTION_BUTTON } from '../screens/common/data_grid';
export const addExceptionFromFirstAlert = () => {
expandFirstAlertActions();
@ -351,6 +353,7 @@ const clickAction = (propertySelector: string, rowIndex: number, actionSelector:
() => {
// To clear focus
cy.get('body').type('{esc}');
cy.get(propertySelector).eq(rowIndex).should('be.visible');
cy.get(propertySelector).eq(rowIndex).realHover();
return cy.get(actionSelector).first();
},
@ -387,19 +390,12 @@ export const showTopNAlertProperty = (propertySelector: string, rowIndex: number
};
export const waitForAlerts = () => {
/*
* below line commented because alertpagefiltersenabled feature flag
* is disabled by default
* target: enable by default in v8.8
*
* waitforpagefilters();
*
* */
waitForPageFilters();
cy.get(REFRESH_BUTTON).should('not.have.attr', 'aria-label', 'Needs updating');
cy.get(DATAGRID_CHANGES_IN_PROGRESS).should('not.be.true');
cy.get(EVENT_CONTAINER_TABLE_LOADING).should('not.exist');
cy.get(LOADING_INDICATOR).should('not.exist');
cy.waitForNetworkIdle('/internal/search/privateRuleRegistryAlertsSearchStrategy', 500);
};
export const expandAlertTableCellValue = (columnSelector: string, row = 1) => {
@ -407,6 +403,11 @@ export const expandAlertTableCellValue = (columnSelector: string, row = 1) => {
cy.get(columnSelector).eq(1).find(CELL_EXPAND_VALUE).click();
};
export const hideAlertTableHorizontalScrollBar = () => {
// .realHover ends up being flaky if the scroll bar is visible as the element below it cannot be properly
cy.get('.euiDataGrid__virtualized').invoke('attr', 'style', 'overflow-x: hidden');
};
export const scrollAlertTableColumnIntoView = (columnSelector: string) => {
cy.get(columnSelector).eq(0).scrollIntoView();
@ -417,6 +418,24 @@ export const scrollAlertTableColumnIntoView = (columnSelector: string) => {
});
};
export const scrollAlertTableColumnIntoViewAndTest = (
columnSelector: string,
testCallback: () => void
) => {
cy.get(columnSelector).eq(0).scrollIntoView();
// Wait for data grid to populate column
cy.waitUntil(() => cy.get(columnSelector).then(($el) => $el.length > 1), {
interval: 500,
timeout: 12000,
});
// We remove the horizontal scrollbar from the table after scrolling
// so `realHover` doesn't conflict with it when attempting to click elements in the table
cy.get('.euiDataGrid__virtualized').invoke('attr', 'style', 'overflow-x: hidden');
testCallback();
cy.get('.euiDataGrid__virtualized').invoke('attr', 'style', 'overflow-x: auto');
};
export const waitForPageFilters = () => {
cy.log('Waiting for Page Filters');
cy.url().then((urlString) => {
@ -427,6 +446,7 @@ export const waitForPageFilters = () => {
cy.get(DETECTION_PAGE_FILTER_GROUP_LOADING).should('not.exist');
cy.get(DETECTION_PAGE_FILTERS_LOADING).should('not.exist');
cy.get(OPTION_LISTS_LOADING).should('have.lengthOf', 0);
cy.waitForNetworkIdle('*/internal/controls/optionsList/*', 500);
} else {
cy.log('Skipping Page Filters Wait');
}
@ -514,3 +534,8 @@ export const switchAlertTableToGridView = () => {
cy.get(ALERT_TABLE_SUMMARY_VIEW_SELECTABLE).should('be.visible').trigger('click');
cy.get(ALERT_TABLE_GRID_VIEW_OPTION).should('be.visible').trigger('click');
};
export const openDataGridColumnActions = (fieldName: string) => {
cy.get(GET_DATA_GRID_HEADER_ACTION_BUTTON(fieldName)).realHover();
cy.get(GET_DATA_GRID_HEADER_ACTION_BUTTON(fieldName)).trigger('click');
};

View file

@ -9,6 +9,7 @@ import {
CREATE_FIELD_BUTTON,
RUNTIME_FIELD_INPUT,
SAVE_FIELD_BUTTON,
TIMELINE_CREATE_FIELD_BUTTON,
} from '../screens/create_runtime_field';
export const createField = (fieldName: string): Cypress.Chainable<JQuery<HTMLElement>> => {
@ -16,3 +17,9 @@ export const createField = (fieldName: string): Cypress.Chainable<JQuery<HTMLEle
cy.get(RUNTIME_FIELD_INPUT).type(fieldName);
return cy.get(SAVE_FIELD_BUTTON).click();
};
export const timelineCreateField = (fieldName: string): Cypress.Chainable<JQuery<HTMLElement>> => {
cy.get(TIMELINE_CREATE_FIELD_BUTTON).click();
cy.get(RUNTIME_FIELD_INPUT).type(fieldName);
return cy.get(SAVE_FIELD_BUTTON).click();
};

View file

@ -47,6 +47,7 @@ export const openLensVisualizationsInspectModal = (
cy.get(LOADER_ARIA).should('not.exist');
}
cy.wrap($el).realHover();
cy.wrap($el).find(EMBEDDABLE_PANEL_TOGGLE_ICON).click();
cy.get(EMBEDDABLE_PANEL_INSPECT).click();

View file

@ -22,7 +22,7 @@ export const EVENT_FILTERS_URL = '/app/security/administration/event_filters';
export const BLOCKLIST_URL = '/app/security/administration/blocklist';
export const CSP_BENCHMARKS_URL = '/app/security/cloud_security_posture/benchmarks';
export const CSP_DASHBOARD_URL = '/app/security/cloud_security_posture/dashboard';
export const CSP_FINDINGS_URL = '/app/security/cloud_security_posture/findings/vulnerabilities';
export const CSP_FINDINGS_URL = '/app/security/cloud_security_posture/findings/configurations';
export const RULES_LANDING_URL = '/app/security/rules/landing';
export const RULES_COVERAGE_URL = '/app/security/rules_coverage_overview';

View file

@ -1509,9 +1509,9 @@
globby "^11.0.4"
"@cypress/request@^3.0.0":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.1.tgz#72d7d5425236a2413bd3d8bb66d02d9dc3168960"
integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==
version "3.0.6"
resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.6.tgz#f5580add6acee0e183b4d4e07eff4f31327ae12b"
integrity sha512-fi0eVdCOtKu5Ed6+E8mYxUF6ZTFJDZvHogCBelM0xVXmrDEkyM22gRArQzq1YcHPm1V47Vf/iAD+WgVdUlJCGg==
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.8.0"
@ -1519,16 +1519,16 @@
combined-stream "~1.0.6"
extend "~3.0.2"
forever-agent "~0.6.1"
form-data "~2.3.2"
http-signature "~1.3.6"
form-data "~4.0.0"
http-signature "~1.4.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.19"
performance-now "^2.1.0"
qs "6.10.4"
qs "6.13.0"
safe-buffer "^5.1.2"
tough-cookie "^4.1.3"
tough-cookie "^5.0.0"
tunnel-agent "^0.6.0"
uuid "^8.3.2"
@ -14645,7 +14645,7 @@ combinations@^1.0.0:
resolved "https://registry.yarnpkg.com/combinations/-/combinations-1.0.0.tgz#d6bd9ce6468a13eba4651c85b57db12547892b1c"
integrity sha512-aVgTfI/dewHblSn4gF+NZHvS7wtwg9YAPF2EknHMdH+xLsXLLIMpmHkSj64Zxs/R2m9VAAgn3bENjssrn7V4vQ==
combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
combined-stream@^1.0.8, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
@ -15393,6 +15393,11 @@ cypress-multi-reporters@^1.6.4:
debug "^4.3.4"
lodash "^4.17.21"
cypress-network-idle@^1.14.2:
version "1.14.2"
resolved "https://registry.yarnpkg.com/cypress-network-idle/-/cypress-network-idle-1.14.2.tgz#0837100861feeb5a18f4c2d9815be079f8590f4d"
integrity sha512-xAdR8dH58KFPv8eCDWjviScITrJOcUpuMXYfYTc175nk2/NvnJ+I6ylSn1CM7yZmoV/gLbFa36QLiH5NfNEaLQ==
cypress-plugin-config@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/cypress-plugin-config/-/cypress-plugin-config-1.2.1.tgz#aa7eaa55ab5ce5e186ab7d0e37cc7e42bfb609b4"
@ -18499,7 +18504,7 @@ form-data@^3.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"
form-data@^4.0.0:
form-data@^4.0.0, form-data@~4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
@ -18508,15 +18513,6 @@ form-data@^4.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"
form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.6"
mime-types "^2.1.12"
format@^0.2.0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b"
@ -19961,14 +19957,14 @@ http-proxy@^1.17.0, http-proxy@^1.18.1:
follow-redirects "^1.0.0"
requires-port "^1.0.0"
http-signature@~1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9"
integrity sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==
http-signature@~1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.4.0.tgz#dee5a9ba2bf49416abc544abd6d967f6a94c8c3f"
integrity sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==
dependencies:
assert-plus "^1.0.0"
jsprim "^2.0.2"
sshpk "^1.14.1"
sshpk "^1.18.0"
http2-client@^1.2.5:
version "1.3.5"
@ -26336,13 +26332,6 @@ pure-rand@^6.0.0:
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306"
integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==
qs@6.10.4:
version "6.10.4"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.4.tgz#6a3003755add91c0ec9eacdc5f878b034e73f9e7"
integrity sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==
dependencies:
side-channel "^1.0.4"
qs@6.13.0, qs@^6.10.0, qs@^6.11.0, qs@^6.7.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906"
@ -29263,10 +29252,10 @@ sql-summary@^1.0.1:
resolved "https://registry.yarnpkg.com/sql-summary/-/sql-summary-1.0.1.tgz#a2dddb5435bae294eb11424a7330dc5bafe09c2b"
integrity sha512-IpCr2tpnNkP3Jera4ncexsZUp0enJBLr+pHCyTweMUBrbJsTgQeLWx1FXLhoBj/MvcnUQpkgOn2EY8FKOkUzww==
sshpk@^1.14.1:
version "1.16.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
sshpk@^1.18.0:
version "1.18.0"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028"
integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
@ -30565,7 +30554,7 @@ totalist@^1.0.0:
resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df"
integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==
tough-cookie@^4.1.2, tough-cookie@^4.1.3, tough-cookie@^4.1.4:
tough-cookie@^4.1.2, tough-cookie@^4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36"
integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==