Skip to content

Commit

Permalink
renames 'detections' to 'alerts' (#70164) (#70248)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema authored Jun 30, 2020
1 parent 4fe9c73 commit 57550cf
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SHOWING_ALERTS,
ALERTS,
TAKE_ACTION_POPOVER_BTN,
} from '../screens/detections';
} from '../screens/alerts';

import {
closeFirstAlert,
Expand All @@ -24,13 +24,13 @@ import {
waitForAlertsToBeLoaded,
markInProgressFirstAlert,
goToInProgressAlerts,
} from '../tasks/detections';
} from '../tasks/alerts';
import { esArchiverLoad } from '../tasks/es_archiver';
import { loginAndWaitForPage } from '../tasks/login';

import { ALERTS_URL } from '../urls/navigation';

describe('Detections', () => {
describe('Alerts', () => {
context('Closing alerts', () => {
beforeEach(() => {
esArchiverLoad('alerts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import {
RULE_SWITCH,
SECOND_RULE,
SEVENTH_RULE,
} from '../screens/alert_detection_rules';
} from '../screens/alerts_detection_rules';

import {
goToManageAlertDetectionRules,
goToManageAlertsDetectionRules,
waitForAlertsPanelToBeLoaded,
waitForAlertsIndexToBeCreated,
} from '../tasks/detections';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
} from '../tasks/alerts';
import {
activateRule,
sortByActivatedRules,
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
waitForRuleToBeActivated,
} from '../tasks/alert_detection_rules';
} from '../tasks/alerts_detection_rules';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';

import { ALERTS_URL } from '../urls/navigation';

describe('Detection rules', () => {
describe('Alerts detection rules', () => {
before(() => {
esArchiverLoad('prebuilt_rules_loaded');
});
Expand All @@ -41,7 +41,7 @@ describe('Detection rules', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
cy.get(RULE_NAME)
.eq(FIFTH_RULE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

import { newRule, totalNumberOfPrebuiltRulesInEsArchive } from '../objects/rule';

import {
CUSTOM_RULES_BTN,
RISK_SCORE,
RULE_NAME,
RULES_ROW,
RULES_TABLE,
SEVERITY,
SHOWING_RULES_TEXT,
} from '../screens/alerts_detection_rules';
import {
ABOUT_FALSE_POSITIVES,
ABOUT_INVESTIGATION_NOTES,
Expand All @@ -28,26 +37,12 @@ import {
SCHEDULE_RUNS,
SCHEDULE_STEP,
} from '../screens/rule_details';
import {
CUSTOM_RULES_BTN,
RISK_SCORE,
RULE_NAME,
RULES_ROW,
RULES_TABLE,
SEVERITY,
SHOWING_RULES_TEXT,
} from '../screens/alert_detection_rules';

import {
createAndActivateRule,
fillAboutRuleAndContinue,
fillDefineCustomRuleWithImportedQueryAndContinue,
} from '../tasks/create_new_rule';
import {
goToManageAlertDetectionRules,
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../tasks/detections';
} from '../tasks/alerts';
import {
changeToThreeHundredRowsPerPage,
deleteFirstRule,
Expand All @@ -58,7 +53,12 @@ import {
selectNumberOfRules,
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
waitForRulesToBeLoaded,
} from '../tasks/alert_detection_rules';
} from '../tasks/alerts_detection_rules';
import {
createAndActivateRule,
fillAboutRuleAndContinue,
fillDefineCustomRuleWithImportedQueryAndContinue,
} from '../tasks/create_new_rule';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';

Expand All @@ -77,7 +77,7 @@ describe('Detection rules, custom', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
goToCreateNewRule();
fillDefineCustomRuleWithImportedQueryAndContinue(newRule);
Expand Down Expand Up @@ -172,7 +172,7 @@ describe('Deletes custom rules', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/

import {
goToManageAlertDetectionRules,
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../tasks/detections';
} from '../tasks/alerts';
import { exportFirstRule } from '../tasks/alerts_detection_rules';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import { exportFirstRule } from '../tasks/alert_detection_rules';

import { ALERTS_URL } from '../urls/navigation';

Expand All @@ -35,7 +35,7 @@ describe('Export rules', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
exportFirstRule();
cy.wait('@export').then((xhr) => {
cy.readFile(EXPECTED_EXPORTED_RULE_FILE_PATH).then(($expectedExportedJson) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

import { machineLearningRule, totalNumberOfPrebuiltRulesInEsArchive } from '../objects/rule';

import {
CUSTOM_RULES_BTN,
RISK_SCORE,
RULE_NAME,
RULE_SWITCH,
RULES_ROW,
RULES_TABLE,
SEVERITY,
} from '../screens/alerts_detection_rules';
import {
ABOUT_FALSE_POSITIVES,
ABOUT_MITRE,
Expand All @@ -26,35 +35,26 @@ import {
SCHEDULE_STEP,
RULE_TYPE,
} from '../screens/rule_details';
import {
CUSTOM_RULES_BTN,
RISK_SCORE,
RULE_NAME,
RULE_SWITCH,
RULES_ROW,
RULES_TABLE,
SEVERITY,
} from '../screens/alert_detection_rules';

import {
createAndActivateRule,
fillAboutRuleAndContinue,
fillDefineMachineLearningRuleAndContinue,
selectMachineLearningRuleType,
} from '../tasks/create_new_rule';
import {
goToManageAlertDetectionRules,
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../tasks/detections';
} from '../tasks/alerts';
import {
changeToThreeHundredRowsPerPage,
filterByCustomRules,
goToCreateNewRule,
goToRuleDetails,
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
waitForRulesToBeLoaded,
} from '../tasks/alert_detection_rules';
} from '../tasks/alerts_detection_rules';
import {
createAndActivateRule,
fillAboutRuleAndContinue,
fillDefineMachineLearningRuleAndContinue,
selectMachineLearningRuleType,
} from '../tasks/create_new_rule';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';

Expand All @@ -73,7 +73,7 @@ describe('Detection rules, machine learning', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
goToCreateNewRule();
selectMachineLearningRuleType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ import {
RELOAD_PREBUILT_RULES_BTN,
RULES_ROW,
RULES_TABLE,
} from '../screens/alert_detection_rules';
} from '../screens/alerts_detection_rules';

import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../tasks/alerts';
import {
changeToThreeHundredRowsPerPage,
deleteFirstRule,
Expand All @@ -22,20 +27,15 @@ import {
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
waitForPrebuiltDetectionRulesToBeLoaded,
waitForRulesToBeLoaded,
} from '../tasks/alert_detection_rules';
import {
goToManageAlertDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../tasks/detections';
} from '../tasks/alerts_detection_rules';
import { esArchiverLoadEmptyKibana, esArchiverUnloadEmptyKibana } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';

import { ALERTS_URL } from '../urls/navigation';

import { totalNumberOfPrebuiltRules } from '../objects/rule';

describe('Detection rules, prebuilt rules', () => {
describe('Alerts rules, prebuilt rules', () => {
before(() => {
esArchiverLoadEmptyKibana();
});
Expand All @@ -51,7 +51,7 @@ describe('Detection rules, prebuilt rules', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
loadPrebuiltDetectionRules();
waitForPrebuiltDetectionRulesToBeLoaded();
Expand All @@ -76,7 +76,7 @@ describe('Deleting prebuilt rules', () => {
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertDetectionRules();
goToManageAlertsDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
loadPrebuiltDetectionRules();
waitForPrebuiltDetectionRulesToBeLoaded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ALERT_ID } from '../screens/detections';
import { ALERT_ID } from '../screens/alerts';
import { PROVIDER_BADGE } from '../screens/timeline';

import {
expandFirstAlert,
investigateFirstAlertInTimeline,
waitForAlertsPanelToBeLoaded,
} from '../tasks/detections';
} from '../tasks/alerts';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPage } from '../tasks/login';

import { ALERTS_URL } from '../urls/navigation';

describe('Detections timeline', () => {
describe('Alerts timeline', () => {
beforeEach(() => {
esArchiverLoad('timeline_alerts');
loginAndWaitForPage(ALERTS_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
OPEN_SELECTED_ALERTS_BTN,
MARK_ALERT_IN_PROGRESS_BTN,
MARK_SELECTED_ALERTS_IN_PROGRESS_BTN,
} from '../screens/detections';
} from '../screens/alerts';
import { REFRESH_BUTTON } from '../screens/security_header';

export const closeFirstAlert = () => {
Expand All @@ -43,7 +43,7 @@ export const goToClosedAlerts = () => {
cy.get(CLOSED_ALERTS_FILTER_BTN).click({ force: true });
};

export const goToManageAlertDetectionRules = () => {
export const goToManageAlertsDetectionRules = () => {
cy.get(MANAGE_ALERT_DETECTION_RULES_BTN).should('exist').click({ force: true });
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
SORT_RULES_BTN,
THREE_HUNDRED_ROWS,
EXPORT_ACTION_BTN,
} from '../screens/alert_detection_rules';
} from '../screens/alerts_detection_rules';

export const activateRule = (rulePosition: number) => {
cy.get(RULE_SWITCH).eq(rulePosition).click({ force: true });
Expand Down

0 comments on commit 57550cf

Please sign in to comment.