Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Gloria Hornero 2022-01-26 17:00:56 +01:00 committed by GitHub
parent 83fee75692
commit de0605ce32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 57 additions and 265 deletions

View file

@ -7,11 +7,7 @@
import { JSON_TEXT } from '../../screens/alerts_details';
import {
expandFirstAlert,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { expandFirstAlert, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
import { openJsonView } from '../../tasks/alerts_details';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
@ -27,8 +23,6 @@ describe('Alert details with unmapped fields', () => {
cleanKibana();
esArchiverCCSLoad('unmapped_fields');
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getUnmappedCCSRule());
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();

View file

@ -15,7 +15,7 @@ import {
goToRuleDetails,
waitForRulesTableToBeLoaded,
} from '../../tasks/alerts_detection_rules';
import { createSignalsIndex, createEventCorrelationRule } from '../../tasks/api_calls/rules';
import { createEventCorrelationRule } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { waitForAlertsToPopulate, waitForTheRuleToBeExecuted } from '../../tasks/create_new_rule';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
@ -27,7 +27,6 @@ describe('Detection rules', function () {
beforeEach('Reset signals index', function () {
cleanKibana();
createSignalsIndex();
});
it('EQL rule on remote indices generates alerts', function () {

View file

@ -13,7 +13,6 @@ import { openTimelineFieldsBrowser, populateTimeline } from '../../tasks/timelin
import { HOSTS_URL, ALERTS_URL } from '../../urls/navigation';
import { waitForAlertsIndexToBeCreated, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { getNewRule } from '../../objects/rule';
@ -30,8 +29,6 @@ describe('Create DataView runtime field', () => {
it('adds field to alert table', () => {
const fieldName = 'field.name.alert.page';
loginAndWaitForPage(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule());
refreshPage();
waitForAlertsToPopulate(500);

View file

@ -14,11 +14,9 @@ import {
import {
selectNumberOfAlerts,
waitForAlertsPanelToBeLoaded,
waitForAlerts,
markAcknowledgedFirstAlert,
goToAcknowledgedAlerts,
waitForAlertsIndexToBeCreated,
} from '../../tasks/alerts';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
@ -32,8 +30,6 @@ describe('Marking alerts as acknowledged', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPage(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule());
refreshPage();
waitForAlertsToPopulate(500);

View file

@ -13,17 +13,14 @@ import {
TABLE_ROWS,
} from '../../screens/alerts_details';
import {
expandFirstAlert,
refreshAlerts,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { expandFirstAlert } from '../../tasks/alerts';
import { openJsonView, openTable } from '../../tasks/alerts_details';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
import { esArchiverLoad } from '../../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { refreshPage } from '../../tasks/security_header';
import { getUnmappedRule } from '../../objects/rule';
@ -34,12 +31,9 @@ describe('Alert details with unmapped fields', () => {
cleanKibana();
esArchiverLoad('unmapped_fields');
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getUnmappedRule());
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
refreshAlerts();
refreshPage();
waitForAlertsToPopulate();
expandFirstAlert();
});

View file

@ -15,7 +15,6 @@ import {
loginAndWaitForPageWithoutDateRange,
waitForPageWithoutDateRange,
} from '../../tasks/login';
import { waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { createCustomRule, deleteCustomRule } from '../../tasks/api_calls/rules';
import { getCallOut, waitForCallOutToBeShown } from '../../tasks/common/callouts';
@ -38,7 +37,6 @@ describe('Detections > Need Admin Callouts indicating an admin is needed to migr
// Otherwise the app will be disabled and show a "welcome"-like page.
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL, ROLES.platform_engineer);
waitForAlertsIndexToBeCreated();
// After that we can login as a soc manager.
login(ROLES.soc_manager);
@ -52,7 +50,7 @@ describe('Detections > Need Admin Callouts indicating an admin is needed to migr
// need admin callouts being shown.
cy.intercept('GET', '/api/detection_engine/index', {
index_mapping_outdated: true,
name: '.siem-signals-default',
name: '.alerts-security.alerts-default',
});
});
context('On Detections home page', () => {
@ -102,7 +100,7 @@ describe('Detections > Need Admin Callouts indicating an admin is needed to migr
// need admin callouts being shown.
cy.intercept('GET', '/api/detection_engine/index', {
index_mapping_outdated: false,
name: '.siem-signals-default',
name: '.alerts-security.alerts-default',
});
});
context('On Detections home page', () => {
@ -152,7 +150,7 @@ describe('Detections > Need Admin Callouts indicating an admin is needed to migr
// need admin callouts being shown.
cy.intercept('GET', '/api/detection_engine/index', {
index_mapping_outdated: null,
name: '.siem-signals-default',
name: '.alerts-security.alerts-default',
});
});
context('On Detections home page', () => {

View file

@ -8,11 +8,7 @@
import { getNewRule } from '../../objects/rule';
import { ROLES } from '../../../common/test';
import {
expandFirstAlertActions,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { expandFirstAlertActions } from '../../tasks/alerts';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
@ -32,8 +28,6 @@ describe('Alerts timeline', () => {
// First we login as a privileged user to create alerts.
cleanKibana();
loginAndWaitForPage(ALERTS_URL, ROLES.platform_engineer);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule());
refreshPage();
waitForAlertsToPopulate(500);

View file

@ -8,7 +8,6 @@
import { getBuildingBlockRule } from '../../objects/rule';
import { OVERVIEW_ALERTS_HISTOGRAM } from '../../screens/overview';
import { OVERVIEW } from '../../screens/security_header';
import { waitForAlertsIndexToBeCreated, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
@ -23,8 +22,6 @@ describe('Alerts generated by building block rules', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
});
it('Alerts should be visible on the Rule Detail page and not visible on the Overview page', () => {

View file

@ -21,9 +21,7 @@ import {
goToOpenedAlerts,
openAlerts,
selectNumberOfAlerts,
waitForAlertsPanelToBeLoaded,
waitForAlerts,
waitForAlertsIndexToBeCreated,
} from '../../tasks/alerts';
import { createCustomRuleActivated, deleteCustomRule } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
@ -37,8 +35,6 @@ describe('Closing alerts', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPage(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule(), '1', '100m', 100);
refreshPage();
waitForAlertsToPopulate(100);

View file

@ -8,11 +8,7 @@
import { getNewRule } from '../../objects/rule';
import { PROVIDER_BADGE } from '../../screens/timeline';
import {
investigateFirstAlertInTimeline,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { investigateFirstAlertInTimeline } from '../../tasks/alerts';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
@ -25,8 +21,6 @@ describe('Alerts timeline', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPage(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule());
refreshPage();
waitForAlertsToPopulate(500);

View file

@ -15,7 +15,6 @@ import {
loginAndWaitForPageWithoutDateRange,
waitForPageWithoutDateRange,
} from '../../tasks/login';
import { waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { createCustomRule, deleteCustomRule } from '../../tasks/api_calls/rules';
import { getCallOut, waitForCallOutToBeShown, dismissCallOut } from '../../tasks/common/callouts';
@ -48,7 +47,6 @@ describe('Detections > Callouts', () => {
// Otherwise the app will be disabled and show a "welcome"-like page.
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL, ROLES.platform_engineer);
waitForAlertsIndexToBeCreated();
// After that we can login as a read-only user.
login(ROLES.reader);

View file

@ -19,9 +19,7 @@ import {
goToOpenedAlerts,
openFirstAlert,
selectNumberOfAlerts,
waitForAlertsPanelToBeLoaded,
waitForAlerts,
waitForAlertsIndexToBeCreated,
} from '../../tasks/alerts';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
@ -35,8 +33,6 @@ describe('Opening alerts', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPage(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule());
refreshPage();
waitForAlertsToPopulate(500);

View file

@ -73,11 +73,6 @@ import {
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
deleteFirstRule,
@ -85,10 +80,8 @@ import {
deleteSelectedRules,
editFirstRule,
filterByCustomRules,
goToCreateNewRule,
goToRuleDetails,
selectNumberOfRules,
waitForRulesTableToBeLoaded,
waitForRulesTableToBeRefreshed,
} from '../../tasks/alerts_detection_rules';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
@ -111,7 +104,7 @@ import { saveEditedRule, waitForKibana } from '../../tasks/edit_rule';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { activatesRule } from '../../tasks/rule_details';
import { ALERTS_URL } from '../../urls/navigation';
import { RULE_CREATION, DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
describe('Custom detection rules creation', () => {
const expectedUrls = getNewRule().referenceUrls.join('');
@ -134,12 +127,7 @@ describe('Custom detection rules creation', () => {
});
it('Creates and activates a new rule', function () {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
loginAndWaitForPageWithoutDateRange(RULE_CREATION);
fillDefineCustomRuleWithImportedQueryAndContinue(this.rule);
fillAboutRuleAndContinue(this.rule);
fillScheduleRuleAndContinue(this.rule);
@ -221,9 +209,7 @@ describe('Custom detection rules deletion and edition', () => {
context('Deletion', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
goToManageAlertsDetectionRules();
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRuleActivated(getNewRule(), 'rule1');
createCustomRuleActivated(getNewOverrideRule(), 'rule2');
@ -323,9 +309,7 @@ describe('Custom detection rules deletion and edition', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
goToManageAlertsDetectionRules();
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRuleActivated(getExistingRule(), 'rule1');
reload();
});

View file

@ -43,17 +43,10 @@ import {
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
filterByCustomRules,
goToCreateNewRule,
goToRuleDetails,
waitForRulesTableToBeLoaded,
} from '../../tasks/alerts_detection_rules';
import { createTimeline } from '../../tasks/api_calls/timelines';
import { cleanKibana } from '../../tasks/common';
@ -68,7 +61,7 @@ import {
} from '../../tasks/create_new_rule';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { RULE_CREATION } from '../../urls/navigation';
describe('Detection rules, EQL', () => {
const expectedUrls = getEqlRule().referenceUrls.join('');
@ -92,12 +85,7 @@ describe('Detection rules, EQL', () => {
});
it('Creates and activates a new EQL rule', function () {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
loginAndWaitForPageWithoutDateRange(RULE_CREATION);
selectEqlRuleType();
fillDefineEqlRuleAndContinue(this.rule);
fillAboutRuleAndContinue(this.rule);
@ -189,12 +177,7 @@ describe('Detection rules, sequence EQL', () => {
});
it('Creates and activates a new EQL rule with a sequence', function () {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
loginAndWaitForPageWithoutDateRange(RULE_CREATION);
selectEqlRuleType();
fillDefineEqlRuleAndContinue(this.rule);
fillAboutRuleAndContinue(this.rule);

View file

@ -6,17 +6,12 @@
*/
import { expectedExportedRule, getNewRule } from '../../objects/rule';
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { exportFirstRule, getRulesImportExportToast } from '../../tasks/alerts_detection_rules';
import { createCustomRule } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
describe('Export rules', () => {
beforeEach(() => {
@ -25,14 +20,11 @@ describe('Export rules', () => {
'POST',
'/api/detection_engine/rules/_export?exclude_export_details=false&file_name=rules_export.ndjson'
).as('export');
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule(getNewRule()).as('ruleResponse');
});
it('Exports a custom rule', function () {
goToManageAlertsDetectionRules();
exportFirstRule();
cy.wait('@export').then(({ response }) => {
cy.wrap(response?.body).should('eql', expectedExportedRule(this.ruleResponse));

View file

@ -5,11 +5,6 @@
* 2.0.
*/
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import {
getRulesImportExportToast,
importRules,
@ -18,16 +13,13 @@ import {
import { cleanKibana, reload } from '../../tasks/common';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
describe('Import rules', () => {
beforeEach(() => {
cleanKibana();
cy.intercept('POST', '/api/detection_engine/rules/_import*').as('import');
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
});
it('Imports a custom rule with exceptions', function () {

View file

@ -59,8 +59,6 @@ import { INDICATOR_MATCH_ROW_RENDER, PROVIDER_BADGE } from '../../screens/timeli
import {
goToManageAlertsDetectionRules,
investigateFirstAlertInTimeline,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
@ -412,8 +410,6 @@ describe('indicator match', () => {
});
it('Creates and activates a new Indicator Match rule', () => {
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();

View file

@ -7,20 +7,16 @@
import { getNewRule } from '../../objects/rule';
import { RULES_MONIROTING_TABLE, RULE_NAME } from '../../screens/alerts_detection_rules';
import { goToManageAlertsDetectionRules, waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
import { cleanKibana, reload } from '../../tasks/common';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
describe('Rules talbes links', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
goToManageAlertsDetectionRules();
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRuleActivated(getNewRule(), 'rule1');
reload();
});

View file

@ -40,17 +40,10 @@ import {
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
filterByCustomRules,
goToCreateNewRule,
goToRuleDetails,
waitForRulesTableToBeLoaded,
} from '../../tasks/alerts_detection_rules';
import { cleanKibana } from '../../tasks/common';
import {
@ -62,7 +55,7 @@ import {
} from '../../tasks/create_new_rule';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { RULE_CREATION } from '../../urls/navigation';
describe('Detection rules, machine learning', () => {
const expectedUrls = getMachineLearningRule().referenceUrls.join('');
@ -76,12 +69,7 @@ describe('Detection rules, machine learning', () => {
});
it('Creates and activates a new ml rule', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
loginAndWaitForPageWithoutDateRange(RULE_CREATION);
selectMachineLearningRuleType();
fillDefineMachineLearningRuleAndContinue(getMachineLearningRule());
fillAboutRuleAndContinue(getMachineLearningRule());

View file

@ -54,17 +54,10 @@ import {
TIMESTAMP_OVERRIDE_DETAILS,
} from '../../screens/rule_details';
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
filterByCustomRules,
goToCreateNewRule,
goToRuleDetails,
waitForRulesTableToBeLoaded,
} from '../../tasks/alerts_detection_rules';
import { createTimeline } from '../../tasks/api_calls/timelines';
import { cleanKibana } from '../../tasks/common';
@ -78,7 +71,7 @@ import {
} from '../../tasks/create_new_rule';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { RULE_CREATION } from '../../urls/navigation';
describe('Detection rules, override', () => {
const expectedUrls = getNewOverrideRule().referenceUrls.join('');
@ -100,12 +93,7 @@ describe('Detection rules, override', () => {
});
it('Creates and activates a new custom rule with override option', function () {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
loginAndWaitForPageWithoutDateRange(RULE_CREATION);
fillDefineCustomRuleWithImportedQueryAndContinue(this.rule);
fillAboutRuleWithOverrideAndContinue(this.rule);
fillScheduleRuleAndContinue(this.rule);

View file

@ -17,7 +17,6 @@ import {
SELECT_ALL_RULES_ON_PAGE_CHECKBOX,
} from '../../screens/alerts_detection_rules';
import { goToManageAlertsDetectionRules, waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
deleteFirstRule,
@ -25,7 +24,6 @@ import {
loadPrebuiltDetectionRules,
reloadDeletedRules,
selectNumberOfRules,
waitForRulesTableToBeLoaded,
waitForPrebuiltDetectionRulesToBeLoaded,
selectAllRules,
confirmRulesDelete,
@ -36,7 +34,7 @@ import {
} from '../../tasks/alerts_detection_rules';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { totalNumberOfPrebuiltRules } from '../../objects/rule';
import { cleanKibana } from '../../tasks/common';
@ -52,10 +50,7 @@ describe('Alerts rules, prebuilt rules', () => {
const expectedNumberOfPages = Math.ceil(totalNumberOfPrebuiltRules / rowsPerPage);
const expectedElasticRulesBtnText = `Elastic rules (${expectedNumberOfRules})`;
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
loadPrebuiltDetectionRules();
waitForPrebuiltDetectionRulesToBeLoaded();
@ -74,10 +69,7 @@ describe('Actions with prebuilt rules', () => {
const expectedElasticRulesBtnText = `Elastic rules (${expectedNumberOfRules})`;
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
loadPrebuiltDetectionRules();
waitForPrebuiltDetectionRulesToBeLoaded();

View file

@ -15,11 +15,7 @@ import {
pageSelector,
} from '../../screens/alerts_detection_rules';
import {
goToManageAlertsDetectionRules,
waitForAlertsPanelToBeLoaded,
waitForAlertsIndexToBeCreated,
} from '../../tasks/alerts';
import { goToManageAlertsDetectionRules, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
import {
activateRule,
changeRowsPerPageTo,
@ -48,7 +44,6 @@ describe('Alerts detection rules', () => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
createCustomRule(getNewRule(), '1');
createCustomRule(getExistingRule(), '2');
createCustomRule(getNewOverrideRule(), '3');
@ -79,7 +74,6 @@ describe('Alerts detection rules', () => {
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
changeRowsPerPageTo(5);
const FIRST_PAGE_SELECTOR = pageSelector(1);

View file

@ -51,11 +51,7 @@ import {
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { goToManageAlertsDetectionRules } from '../../tasks/alerts';
import {
changeRowsPerPageTo100,
filterByCustomRules,
@ -79,7 +75,7 @@ import {
} from '../../tasks/create_new_rule';
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import { RULE_CREATION } from '../../urls/navigation';
describe('Detection rules, threshold', () => {
let rule = getNewThresholdRule();
@ -94,15 +90,10 @@ describe('Detection rules, threshold', () => {
createTimeline(getNewThresholdRule().timeline).then((response) => {
rule.timeline.id = response.body.data.persistTimeline.timeline.savedObjectId;
});
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(RULE_CREATION);
});
it('Creates and activates a new threshold rule', () => {
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
selectThresholdRuleType();
fillDefineThresholdRuleAndContinue(rule);
fillAboutRuleAndContinue(rule);

View file

@ -9,7 +9,6 @@ import { getNewRule } from '../../objects/rule';
import { RULE_STATUS } from '../../screens/create_new_rule';
import { goToManageAlertsDetectionRules, waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import { createCustomRule } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
@ -32,8 +31,8 @@ import {
EXCEPTION_FIELD_LIST,
} from '../../screens/exceptions';
import { ALERTS_URL } from '../../urls/navigation';
import { cleanKibana } from '../../tasks/common';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { cleanKibana, reload } from '../../tasks/common';
// NOTE: You might look at these tests and feel they're overkill,
// but the exceptions modal has a lot of logic making it difficult
@ -43,10 +42,9 @@ import { cleanKibana } from '../../tasks/common';
describe('Exceptions modal', () => {
before(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule(getNewRule());
goToManageAlertsDetectionRules();
reload();
goToRuleDetails();
cy.get(RULE_STATUS).should('have.text', '—');

View file

@ -14,7 +14,6 @@ import { getNewRule } from '../../objects/rule';
import { RULE_STATUS } from '../../screens/create_new_rule';
import { goToManageAlertsDetectionRules, waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import { createCustomRule } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
@ -28,8 +27,8 @@ import {
goToExceptionsTab,
} from '../../tasks/rule_details';
import { ALERTS_URL, EXCEPTIONS_URL } from '../../urls/navigation';
import { cleanKibana } from '../../tasks/common';
import { DETECTIONS_RULE_MANAGEMENT_URL, EXCEPTIONS_URL } from '../../urls/navigation';
import { cleanKibana, reload } from '../../tasks/common';
import {
deleteExceptionListWithRuleReference,
deleteExceptionListWithoutRuleReference,
@ -47,10 +46,9 @@ import { createExceptionList } from '../../tasks/api_calls/exceptions';
describe('Exceptions Table', () => {
before(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule(getNewRule());
goToManageAlertsDetectionRules();
reload();
goToRuleDetails();
cy.get(RULE_STATUS).should('have.text', '—');

View file

@ -11,13 +11,7 @@ import { getNewRule } from '../../objects/rule';
import { ALERTS_COUNT, EMPTY_ALERT_TABLE, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { RULE_STATUS } from '../../screens/create_new_rule';
import {
addExceptionFromFirstAlert,
goToClosedAlerts,
goToManageAlertsDetectionRules,
goToOpenedAlerts,
waitForAlertsIndexToBeCreated,
} from '../../tasks/alerts';
import { addExceptionFromFirstAlert, goToClosedAlerts, goToOpenedAlerts } from '../../tasks/alerts';
import { createCustomRule } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
@ -32,18 +26,17 @@ import {
waitForTheRuleToBeExecuted,
} from '../../tasks/rule_details';
import { ALERTS_URL } from '../../urls/navigation';
import { cleanKibana } from '../../tasks/common';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { cleanKibana, reload } from '../../tasks/common';
describe('From alert', () => {
const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert';
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule(getNewRule(), 'rule_testing', '10s');
goToManageAlertsDetectionRules();
reload();
goToRuleDetails();
cy.get(RULE_STATUS).should('have.text', '—');

View file

@ -11,12 +11,7 @@ import { getNewRule } from '../../objects/rule';
import { ALERTS_COUNT, EMPTY_ALERT_TABLE, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { RULE_STATUS } from '../../screens/create_new_rule';
import {
goToClosedAlerts,
goToManageAlertsDetectionRules,
goToOpenedAlerts,
waitForAlertsIndexToBeCreated,
} from '../../tasks/alerts';
import { goToClosedAlerts, goToOpenedAlerts } from '../../tasks/alerts';
import { createCustomRule } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
@ -32,17 +27,16 @@ import {
} from '../../tasks/rule_details';
import { refreshPage } from '../../tasks/security_header';
import { ALERTS_URL } from '../../urls/navigation';
import { cleanKibana } from '../../tasks/common';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { cleanKibana, reload } from '../../tasks/common';
describe('From rule', () => {
const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1';
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsIndexToBeCreated();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule(getNewRule(), 'rule_testing', '10s');
goToManageAlertsDetectionRules();
reload();
goToRuleDetails();
cy.get(RULE_STATUS).should('have.text', '—');

View file

@ -8,11 +8,7 @@
import { ROLES } from '../../../common/test';
import { deleteRoleAndUser, loginAndWaitForPageWithoutDateRange } from '../../tasks/login';
import { ALERTS_URL } from '../../urls/navigation';
import {
waitForAlertsPanelToBeLoaded,
waitForAlertsIndexToBeCreated,
goToManageAlertsDetectionRules,
} from '../../tasks/alerts';
import { goToManageAlertsDetectionRules } from '../../tasks/alerts';
import {
waitForListsIndexToBeCreated,
waitForValueListsModalToBeLoaded,
@ -36,8 +32,6 @@ describe('value lists', () => {
describe('management modal', () => {
beforeEach(() => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
waitForListsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForValueListsModalToBeLoaded();

View file

@ -152,21 +152,6 @@ export const waitForAlerts = () => {
cy.get(REFRESH_BUTTON).should('not.have.text', 'Updating');
};
export const waitForAlertsIndexToBeCreated = () => {
cy.request({
url: '/api/detection_engine/index',
failOnStatusCode: false,
}).then((response) => {
if (response.status !== 200) {
cy.request({
method: 'POST',
url: `/api/detection_engine/index`,
headers: { 'kbn-xsrf': 'create-signals-index' },
});
}
});
};
export const waitForAlertsPanelToBeLoaded = () => {
cy.get(LOADING_ALERTS_PANEL).should('exist');
cy.get(LOADING_ALERTS_PANEL).should('not.exist');

View file

@ -128,11 +128,3 @@ export const deleteCustomRule = (ruleId = '1') => {
failOnStatusCode: false,
});
};
export const createSignalsIndex = () => {
cy.request({
method: 'POST',
url: 'api/detection_engine/index',
headers: { 'kbn-xsrf': 'cypress-creds' },
});
};

View file

@ -92,16 +92,6 @@ export const cleanKibana = () => {
type: 'alert',
},
},
{
match: {
'alert.alertTypeId': 'siem.signals',
},
},
{
match: {
'alert.consumer': 'siem',
},
},
],
},
},
@ -127,7 +117,7 @@ export const cleanKibana = () => {
'POST',
`${Cypress.env(
'ELASTICSEARCH_URL'
)}/.lists-*,.items-*,.siem-signals-*/_delete_by_query?conflicts=proceed&scroll_size=10000`,
)}/.lists-*,.items-*,.alerts-security.alerts-*/_delete_by_query?conflicts=proceed&scroll_size=10000`,
{
query: {
match_all: {},

View file

@ -517,6 +517,7 @@ export const selectIndicatorMatchType = () => {
};
export const selectMachineLearningRuleType = () => {
cy.get(MACHINE_LEARNING_TYPE).contains('Select');
cy.get(MACHINE_LEARNING_TYPE).click({ force: true });
};

View file

@ -11,7 +11,6 @@ import { HOSTS_URL } from '../urls/navigation';
import { waitForPage } from './login';
import { openTimelineUsingToggle } from './security_main';
import { DEFAULT_ALERTS_INDEX } from '../../common/constants';
import { waitForAlertsIndexToBeCreated } from './alerts';
import { createCustomRuleActivated } from './api_calls/rules';
import { getNewRule } from '../objects/rule';
@ -177,7 +176,6 @@ export const refreshUntilAlertsIndexExists = async () => {
};
export const waitForAlertsIndexToExist = () => {
waitForAlertsIndexToBeCreated();
createCustomRuleActivated(getNewRule(), '1', '100m', 100);
refreshUntilAlertsIndexExists();
};