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

[Security Solution] [Trigger Actions] Alert Table Refactoring #149128

Merged
merged 92 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
bb961b6
wip to get all teh features equally
XavierM Nov 28, 2022
382d5ee
incremental commit
logeekal Dec 10, 2022
fb9087c
Merging main ➡️ current branch
logeekal Dec 12, 2022
aaa754d
Table basics working
logeekal Dec 14, 2022
153846f
Added debug messages
logeekal Dec 16, 2022
43a41d9
Incremental dev commit
logeekal Dec 20, 2022
a6d15e6
Alert actions working
logeekal Dec 21, 2022
95a2f2d
Incremental commit
logeekal Jan 10, 2023
1839a09
Incremental commit
logeekal Jan 11, 2023
6f82983
Merged main -> current branch
logeekal Jan 13, 2023
fa23252
fix: event rendered view + some issues
logeekal Jan 16, 2023
8fc7e87
Merging main -> current branch
logeekal Jan 17, 2023
0d844dd
feat: field browser + right controls
logeekal Jan 17, 2023
c961b44
Merge main --> current branch
logeekal Jan 24, 2023
cedaae1
loading states + reorg
logeekal Jan 19, 2023
ade6969
Added time-range filter
logeekal Jan 23, 2023
740cc18
Replace alert Table with triggers action
logeekal Jan 23, 2023
a6ef9e5
fixing tests incremental
logeekal Jan 24, 2023
f0bb8e6
Added new state values to data table
logeekal Jan 25, 2023
b8306f8
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jan 25, 2023
7ed773b
Tests incremental commit
logeekal Jan 27, 2023
6897b7d
Merge main -> current branch
logeekal Jan 27, 2023
620ab08
Fixed trigger action typings
logeekal Jan 27, 2023
56b5c6b
Fixed types
logeekal Jan 27, 2023
2e70a69
fix: observability types
logeekal Jan 27, 2023
5bc78ea
Fixes localstorage tests
logeekal Jan 27, 2023
546758f
fixed types + alert bulk actions
logeekal Jan 27, 2023
084f4cc
fix: observaibility re-rendering
logeekal Jan 27, 2023
fd31e1f
Fixed tests + typing issues
logeekal Jan 28, 2023
ece32e6
Fixed jest tests + other linting issues
logeekal Jan 28, 2023
887a23b
fixed column issue
logeekal Jan 29, 2023
8368ee5
fixed exception flaky tests
logeekal Jan 29, 2023
576a743
fixes exception items
logeekal Jan 29, 2023
20fbbf0
fixed some cypress tests
logeekal Jan 29, 2023
6391d9f
removing un-necessary changes in o11y
logeekal Jan 29, 2023
64a59a1
cosmetic changes
logeekal Jan 29, 2023
5ee22c5
fixed flaky timeline tests
logeekal Jan 29, 2023
e8dc9e0
Merge branch 'main' into alert-table-columns-actions
logeekal Jan 29, 2023
124feae
refactor storage ref + styles
logeekal Jan 30, 2023
575c881
remove debug code
logeekal Jan 30, 2023
486f7f1
optimizations
logeekal Jan 30, 2023
2eabbf3
reverted unnecessary changes in rule strategy
logeekal Jan 31, 2023
c39a547
Merge main --> current branch
logeekal Jan 31, 2023
d4808ae
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jan 31, 2023
433887b
moved hook to the right place
logeekal Jan 31, 2023
6ab9716
Fetching correct fields
logeekal Feb 1, 2023
c958246
fixed types and timeline tests
logeekal Feb 1, 2023
8ba59d6
create type-safe hook mock
logeekal Feb 1, 2023
77a7ea1
refactor: tests
logeekal Feb 1, 2023
0d24cf7
refactor: corrected hook mock
logeekal Feb 1, 2023
9e80d5d
o11y fields issue + moved fields to useColumns
logeekal Feb 1, 2023
519640c
Merge branch 'main' into alert-table-columns-actions
logeekal Feb 1, 2023
aaa6cb6
added test cellActions + clearSelection
logeekal Feb 1, 2023
6820db2
Corrected issues with event rendered-view
logeekal Feb 2, 2023
b12f6d9
fixed types + cypress tests
logeekal Feb 2, 2023
439075c
fixes enrichment issues
logeekal Feb 2, 2023
c2058ed
added test refresh in toolbar bulk action
logeekal Feb 2, 2023
164cc56
refactor: prop browserFields prevent API
logeekal Feb 2, 2023
aab1859
Add Field browser create button
logeekal Feb 2, 2023
3bbff70
Review comments + test fixes
logeekal Feb 2, 2023
51dc5c9
Merged main -->current branch
logeekal Feb 6, 2023
078c254
fix: remove unncessary changes
logeekal Feb 6, 2023
f77914f
Removed unnecessary commands
logeekal Feb 6, 2023
355002b
peer review comments
logeekal Feb 6, 2023
20c28b2
Merged main --> current branch
logeekal Feb 6, 2023
6c44bad
Cases Owner issue
logeekal Feb 6, 2023
ea1a0a1
enabled inspect button
logeekal Feb 6, 2023
c26c3c6
Refresh retry in cypress tests
logeekal Feb 6, 2023
344e913
reverting cypress retry alerts_populate
logeekal Feb 6, 2023
78c7d8b
remove o11y casting
logeekal Feb 7, 2023
80b6d1f
Merged main -> current branch + Grouping
logeekal Feb 8, 2023
6197ba3
Added toolbar visibility options
logeekal Feb 9, 2023
09bf193
Merging main --> current branch
logeekal Feb 9, 2023
2a1f1af
Fixes stateful event renderer error
logeekal Feb 9, 2023
ff82a8d
skipped invalid tests
logeekal Feb 9, 2023
143976b
refactor: waitForAlertsToPopulate based on new alert table
logeekal Feb 14, 2023
bc98174
fix: register alert table only once
logeekal Feb 15, 2023
7e75b58
Merging main --> current branch
logeekal Feb 15, 2023
b6e3922
refactor: add to timeline data provider
logeekal Feb 15, 2023
5977f12
migrate triggers action state
logeekal Feb 16, 2023
58390ad
fix: localstorage migration
logeekal Feb 16, 2023
a91d5a2
fix: enclose triggers actions query in filter
logeekal Feb 16, 2023
39ed2cc
Merging main --> current branch
logeekal Feb 20, 2023
fd288eb
Fix tests
logeekal Feb 20, 2023
ad000e9
cypress review feedback
logeekal Feb 21, 2023
3e13779
fix: onboarding tours test
logeekal Feb 21, 2023
1352dfe
alert suppression
logeekal Feb 21, 2023
27a15bb
Merging main --> current branch
logeekal Feb 21, 2023
ef74cb2
fix: types
logeekal Feb 21, 2023
f79e02e
fix: onRuleChange
logeekal Feb 22, 2023
f6c8506
Skip triggers actions failing tests
logeekal Feb 22, 2023
7c70b73
fix: types
logeekal Feb 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Case View Page activity tab', () => {
await waitFor(async () => {
expect(getAlertsStateTableMock).toHaveBeenCalledWith({
alertsTableConfigurationRegistry: expect.anything(),
configurationId: 'securitySolution',
configurationId: 'securitySolution-case',
featureIds: ['siem', 'observability'],
id: 'case-details-alerts-securitySolution',
query: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ export const CaseViewAlerts = ({ caseData }: CaseViewAlertsProps) => {
const { isLoading: isLoadingAlertFeatureIds, data: alertFeatureIds } =
useGetFeatureIds(alertRegistrationContexts);

const configId =
caseData.owner === SECURITY_SOLUTION_OWNER ? `${caseData.owner}-case` : caseData.owner;

const alertStateProps = {
alertsTableConfigurationRegistry: triggersActionsUi.alertsTableConfigurationRegistry,
configurationId: caseData.owner,
configurationId: configId,
id: `case-details-alerts-${caseData.owner}`,
flyoutSize: (alertFeatureIds?.includes('siem') ? 'm' : 's') as EuiFlyoutSize,
featureIds: alertFeatureIds ?? [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import type { GetRenderCellValue } from '@kbn/triggers-actions-ui-plugin/public';
import { TIMESTAMP } from '@kbn/rule-data-utils';
import { SortOrder } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { AlertsTableConfigurationRegistry } from '@kbn/triggers-actions-ui-plugin/public/types';
import { casesFeatureId, observabilityFeatureId } from '../../common';
import { useBulkAddToCaseActions } from '../hooks/use_alert_bulk_case_actions';
import { useBulkAddToCaseTriggerActions } from '../hooks/use_alert_bulk_case_actions';
import { TopAlert, useToGetInternalFlyout } from '../pages/alerts';
import { getRenderCellValue } from '../pages/alerts/components/render_cell_value';
import { addDisplayNames } from '../pages/alerts/containers/alerts_table/add_display_names';
Expand All @@ -21,7 +22,7 @@ import type { ConfigSchema } from '../plugin';
const getO11yAlertsTableConfiguration = (
observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry,
config: ConfigSchema
) => ({
): AlertsTableConfigurationRegistry => ({
id: observabilityFeatureId,
casesFeatureId,
columns: alertO11yColumns.map(addDisplayNames),
Expand All @@ -36,7 +37,7 @@ const getO11yAlertsTableConfiguration = (
},
],
useActionsColumn: getRowActions(observabilityRuleTypeRegistry, config),
useBulkActions: useBulkAddToCaseActions,
useBulkActions: useBulkAddToCaseTriggerActions,
useInternalFlyout: () => {
const { header, body, footer } = useToGetInternalFlyout(observabilityRuleTypeRegistry);
return { header, body, footer };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,12 @@ export const useBulkAddToCaseActions = ({ onClose, onSuccess }: UseAddToCaseActi
selectCaseModal,
]);
};

/*
* Wrapper hook to support trigger actions
* registry props for the alert table
*
* */
export const useBulkAddToCaseTriggerActions = () => {
return useBulkAddToCaseActions({});
};
15 changes: 14 additions & 1 deletion x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* https://mariusschulz.com/blog/literal-type-widening-in-typescript
* Please follow this convention when adding to this file
*/

export const APP_ID = 'securitySolution' as const;
export const APP_UI_ID = 'securitySolutionUI' as const;
export const CASES_FEATURE_ID = 'securitySolutionCases' as const;
Expand Down Expand Up @@ -499,3 +498,17 @@ export const DEFAULT_DETECTION_PAGE_FILTERS = [
fieldName: 'host.name',
},
];

/** This local storage key stores the `Grid / Event rendered view` selection */
export const ALERTS_TABLE_VIEW_SELECTION_KEY = 'securitySolution.alerts.table.view-selection';

export const VIEW_SELECTION = {
gridView: 'gridView',
eventRenderedView: 'eventRenderedView',
} as const;

export const ALERTS_TABLE_REGISTRY_CONFIG_IDS = {
ALERTS_PAGE: `${APP_ID}-alerts-page`,
RULE_DETAILS: `${APP_ID}-rule-details`,
CASE: `${APP_ID}-case`,
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import * as runtimeTypes from 'io-ts';
import type { VIEW_SELECTION } from '../../constants';

export enum Direction {
asc = 'asc',
Expand Down Expand Up @@ -33,6 +34,7 @@ export enum TableId {
alternateTest = 'alternateTest',
rulePreview = 'rule-preview',
kubernetesPageSessions = 'kubernetes-page-sessions',
alertsOnCasePage = 'alerts-case-page',
}

const TableIdLiteralRt = runtimeTypes.union([
Expand All @@ -46,4 +48,9 @@ const TableIdLiteralRt = runtimeTypes.union([
runtimeTypes.literal(TableId.rulePreview),
runtimeTypes.literal(TableId.kubernetesPageSessions),
]);

export type TableIdLiteral = runtimeTypes.TypeOf<typeof TableIdLiteralRt>;

export type ViewSelectionTypes = keyof typeof VIEW_SELECTION;

export type ViewSelection = typeof VIEW_SELECTION[ViewSelectionTypes];
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { JSON_TEXT } from '../../screens/alerts_details';

import { expandFirstAlert, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
import { expandFirstAlert, waitForAlerts } from '../../tasks/alerts';
import { openJsonView } from '../../tasks/alerts_details';
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
Expand All @@ -25,7 +25,7 @@ describe('Alert details with unmapped fields', () => {
esArchiverCCSLoad('unmapped_fields');
createCustomRuleEnabled(getUnmappedCCSRule());
visitWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlerts();
expandFirstAlert();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { esArchiverCCSLoad } from '../../tasks/es_archiver';
import { getCCSEqlRule } from '../../objects/rule';

import { ALERT_DATA_GRID, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { ALERTS_COUNT, ALERT_DATA_GRID } from '../../screens/alerts';

import {
filterByCustomRules,
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('Detection rules', function () {
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(NUMBER_OF_ALERTS).should('have.text', expectedNumberOfAlerts);
cy.get(ALERTS_COUNT).should('have.text', expectedNumberOfAlerts);
cy.get(ALERT_DATA_GRID)
.invoke('text')
.then((text) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,39 @@ import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { getNewRule } from '../../objects/rule';
import { refreshPage } from '../../tasks/security_header';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
import { openEventsViewerFieldsBrowser } from '../../tasks/hosts/events';
import { assertFieldDisplayed, createField } from '../../tasks/create_runtime_field';
import { createField } from '../../tasks/create_runtime_field';
import { openAlertsFieldBrowser } from '../../tasks/alerts';
import { deleteRuntimeField } from '../../tasks/sourcerer';
import { GET_DATA_GRID_HEADER } from '../../screens/common/data_grid';
import { GET_TIMELINE_HEADER } from '../../screens/timeline';

const alertRunTimeField = 'field.name.alert.page';
const timelineRuntimeField = 'field.name.timeline';

describe('Create DataView runtime field', () => {
before(() => {
deleteRuntimeField('security-solution-default', alertRunTimeField);
deleteRuntimeField('security-solution-default', timelineRuntimeField);
login();
});

it('adds field to alert table', () => {
const fieldName = 'field.name.alert.page';
visit(ALERTS_URL);
createCustomRuleEnabled(getNewRule());
refreshPage();
waitForAlertsToPopulate();
openEventsViewerFieldsBrowser();

createField(fieldName);
assertFieldDisplayed(fieldName, 'alerts');
openAlertsFieldBrowser();
createField(alertRunTimeField);
cy.get(GET_DATA_GRID_HEADER(alertRunTimeField)).should('exist');
});

it('adds field to timeline', () => {
const fieldName = 'field.name.timeline';
visit(HOSTS_URL);
openTimelineUsingToggle();
populateTimeline();
openTimelineFieldsBrowser();

createField(fieldName);
assertFieldDisplayed(fieldName);
createField(timelineRuntimeField);
cy.get(GET_TIMELINE_HEADER(timelineRuntimeField)).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { expandFirstAlert, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
import { expandFirstAlert, waitForAlerts } from '../../tasks/alerts';
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { login, visit } from '../../tasks/login';
Expand Down Expand Up @@ -35,7 +35,7 @@ describe('Alert Details Page Navigation', () => {
describe('context menu', () => {
beforeEach(() => {
visit(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlerts();
});

it('should navigate to the details page from the alert context menu', () => {
Expand All @@ -55,7 +55,7 @@ describe('Alert Details Page Navigation', () => {
describe('flyout', () => {
beforeEach(() => {
visit(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlerts();
});

it('should navigate to the details page from the alert flyout', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Alerts cell actions', () => {
.first()
.invoke('text')
.then((severityVal) => {
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_VALUES);
filterForAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(FILTER_BADGE)
.first()
Expand All @@ -75,7 +75,7 @@ describe('Alerts cell actions', () => {
.first()
.invoke('text')
.then((severityVal) => {
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_VALUES);
addAlertPropertyToTimeline(ALERT_TABLE_SEVERITY_VALUES, 0);
openActiveTimeline();
cy.get(PROVIDER_BADGE)
Expand All @@ -101,7 +101,7 @@ describe('Alerts cell actions', () => {
.first()
.invoke('text')
.then(() => {
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_VALUES);
showTopNAlertProperty(ALERT_TABLE_SEVERITY_VALUES, 0);
cy.get(SHOW_TOP_N_HEADER).first().should('have.text', `Top kibana.alert.severity`);
});
Expand All @@ -114,7 +114,7 @@ describe('Alerts cell actions', () => {
.first()
.invoke('text')
.then(() => {
scrollAlertTableColumnIntoView(ALERT_TABLE_FILE_NAME_HEADER);
scrollAlertTableColumnIntoView(ALERT_TABLE_SEVERITY_VALUES);
cy.window().then((win) => {
cy.stub(win, 'prompt').returns('DISABLED WINDOW PROMPT');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { APP_ID, DEFAULT_DETECTION_PAGE_FILTERS } from '../../../common/constant
import { formatPageFilterSearchParam } from '../../../common/utils/format_page_filter_search_param';
import {
markAcknowledgedFirstAlert,
refreshAlertPageFilter,
resetFilters,
selectCountTable,
waitForAlerts,
Expand Down Expand Up @@ -152,7 +151,7 @@ describe.skip('Detections : Page Filters', () => {
.then((noOfAlerts) => {
const originalAlertCount = noOfAlerts.split(' ')[0];
markAcknowledgedFirstAlert();
refreshAlertPageFilter();
waitForAlerts();
cy.get(OPTION_LIST_VALUES).eq(0).click();
cy.get(OPTION_SELECTABLE(0, 'acknowledged')).should('be.visible');
cy.get(ALERTS_COUNT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import { getNewRule } from '../../objects/rule';
import {
NUMBER_OF_ALERTS,
HOST_RISK_HEADER_COLIMN,
USER_RISK_HEADER_COLIMN,
HOST_RISK_COLUMN,
USER_RISK_COLUMN,
ACTION_COLUMN,
ALERTS_COUNT,
} from '../../screens/alerts';
import { ENRICHED_DATA_ROW } from '../../screens/alerts_details';
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('Enrichment', () => {
});

it('Should has enrichment fields', function () {
cy.get(NUMBER_OF_ALERTS)
cy.get(ALERTS_COUNT)
.invoke('text')
.should('match', /^[1-9].+$/); // Any number of alerts
cy.get(HOST_RISK_HEADER_COLIMN).contains('host.risk.calculated_level');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getNewOverrideRule,
} from '../../objects/rule';
import { getTimeline } from '../../objects/timeline';
import { ALERT_GRID_CELL, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../screens/alerts';

import {
CUSTOM_RULES_BTN,
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('Custom query rules', () => {
waitForAlertsToPopulate();

cy.log('Asserting that alerts have been generated after the creation');
cy.get(NUMBER_OF_ALERTS)
cy.get(ALERTS_COUNT)
.invoke('text')
.should('match', /^[1-9].+$/); // Any number of alerts
cy.get(ALERT_GRID_CELL).contains(ruleFields.ruleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { formatMitreAttackDescription } from '../../helpers/rules';
import type { Mitre } from '../../objects/rule';
import { getDataViewRule } from '../../objects/rule';
import type { CompleteTimeline } from '../../objects/timeline';
import { ALERT_GRID_CELL, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../screens/alerts';

import {
CUSTOM_RULES_BTN,
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('Custom query rules', () => {
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(NUMBER_OF_ALERTS)
cy.get(ALERTS_COUNT)
.invoke('text')
.should('match', /^[1-9].+$/);
cy.get(ALERT_GRID_CELL).contains(this.rule.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { formatMitreAttackDescription } from '../../helpers/rules';
import type { Mitre } from '../../objects/rule';
import { getEqlRule, getEqlSequenceRule, getIndexPatterns } from '../../objects/rule';

import { ALERT_DATA_GRID, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { ALERTS_COUNT, ALERT_DATA_GRID } from '../../screens/alerts';
import {
CUSTOM_RULES_BTN,
RISK_SCORE,
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('EQL rules', () => {
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(NUMBER_OF_ALERTS).should('have.text', expectedNumberOfAlerts);
cy.get(ALERTS_COUNT).should('have.text', expectedNumberOfAlerts);
cy.get(ALERT_DATA_GRID)
.invoke('text')
.then((text) => {
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('EQL rules', () => {
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(NUMBER_OF_ALERTS).should('have.text', expectedNumberOfSequenceAlerts);
cy.get(ALERTS_COUNT).should('have.text', expectedNumberOfSequenceAlerts);
cy.get(ALERT_DATA_GRID)
.invoke('text')
.then((text) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ALERT_RULE_NAME,
ALERT_RISK_SCORE,
ALERT_SEVERITY,
NUMBER_OF_ALERTS,
ALERTS_COUNT,
} from '../../screens/alerts';
import {
CUSTOM_RULES_BTN,
Expand Down Expand Up @@ -491,7 +491,7 @@ describe('indicator match', () => {
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(NUMBER_OF_ALERTS).should('have.text', expectedNumberOfAlerts);
cy.get(ALERTS_COUNT).should('have.text', expectedNumberOfAlerts);
cy.get(ALERT_RULE_NAME).first().should('have.text', rule.name);
cy.get(ALERT_SEVERITY).first().should('have.text', rule.severity?.toLowerCase());
cy.get(ALERT_RISK_SCORE).first().should('have.text', rule.riskScore);
Expand Down